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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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