View previous topic :: View next topic
|
Author |
Message |
Benjamin.L
New User
Joined: 11 Apr 2006 Posts: 17 Location: DL.PRC
|
|
|
|
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 |
|
|
twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
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 |
|
|
Benjamin.L
New User
Joined: 11 Apr 2006 Posts: 17 Location: DL.PRC
|
|
|
|
hi Cheers,
thanks for your helping, I think u r right. |
|
Back to top |
|
|
twissi
Active User
Joined: 01 Aug 2005 Posts: 105 Location: Somerset, NJ
|
|
|
|
Any time, Pal! |
|
Back to top |
|
|
soumyaranjan007
New User
Joined: 30 Aug 2006 Posts: 30 Location: mumbai
|
|
|
|
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 |
|
|
|