Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

The length of varchar in unload file??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Benjamin.L

New User


Joined: 11 Apr 2006
Posts: 17
Location: DL.PRC

PostPosted: Wed Aug 30, 2006 8:20 am    Post subject: The length of varchar in unload file??
Reply with quote

Hi all,

the column in DB2 table is varchar(100) , when I unload it into a file, I want to know what is the length in file?

is there anyone can help me?
thanks a lot!
Back to top
View user's profile Send private message

twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Wed Aug 30, 2006 9:52 am    Post subject:
Reply with quote

Hi Benjamin,

If you're unloading using DSNTIAUL, give any record length and it will take what is required!

Or, if you're doing it through a COBOL program, you need to have 2 Bytes reserved for the length part of the VARCHAR field.

If the field is declared as FIELD_1 VARCHAR(100) NOT NULL, the COBOL representation will be
Code:
01 FIELD-1.
     10 FIELD-1-LEN     PIC S9(4) COMP.
     10 FIELD-1-TEXT   PIC X(100).

So, in brief, you need to have 102 bytes reserved for the VARCHAR field you mentioned, in the output file.

Cheers, Twissi.
Back to top
View user's profile Send private message
Benjamin.L

New User


Joined: 11 Apr 2006
Posts: 17
Location: DL.PRC

PostPosted: Wed Aug 30, 2006 10:37 am    Post subject:
Reply with quote

hi Cheers,

thanks for your helping, I think u r right.
Back to top
View user's profile Send private message
twissi

Active User


Joined: 01 Aug 2005
Posts: 105
Location: Somerset, NJ

PostPosted: Wed Aug 30, 2006 1:01 pm    Post subject:
Reply with quote

Any time, Pal!
Back to top
View user's profile Send private message
soumyaranjan007

New User


Joined: 30 Aug 2006
Posts: 30
Location: mumbai

PostPosted: Sat Sep 02, 2006 4:47 pm    Post subject: Re: The length of varchar in unload file??
Reply with quote

Benjamin.L wrote:
Hi all,

the column in DB2 table is varchar(100) , when I unload it into a file, I want to know what is the length in file?

is there anyone can help me?
thanks a lot!



Hi,

the length of the file will be 100. In case of unload table try to use 'DSNUPROC' instead of 'ADUUMAIN' jcl utility.

DSNUPROC---- this jcl utility will take the varchar(100) as 100 length.
ADUUMAIN-----this jcl utility takes the system defined length.

Regards
Soumya Ranjan Pradhan
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us