Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi,
In my table i had a field of type VARCHAR of length 78. When i do the unload the output file it is creating as VB format.
Say the file name as UNLOAD.TABLE.VBFMT
Now i am using this table as my input and sorting. The output file is FB format.
The job is as follows:
//SORTJOB JOB 1,CLASS=6,MSGCLASS=0,NOTIFY=&SYSUID
//STEP010 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=C
//SYSPRINT DD SYSOUT=*
//*INPUT FILE
//INPUT DD DSN=UNLOAD.TABLE.VBFMT,DISP=SHR
//*OUTPUT FILE
//OUTPUT DD DSN=OUTPUT.FILE.AFTER.SORT,
// DISP=(,CATLG,DELETE),SPACE=(CYL,(500,500),RLSE),
// RECFM=FB,LRECL=569
//TOOLIN DD *
COPY FROM(INPUT) TO(OUTPUT) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(5,7,PD,A,44,3,CH,A)
OUTFIL FNAMES=OUDMCSTA,REMOVECC, VTOF,
OUTREC=(1:5,569)
/*
When i run this the output file is creating. But the data alignment is not proper.
This is because even though my varchar is of 78 length i am giving data of 10 characters. So the rest of 68 is filled by the data next to it. But it should be spaces. So the data alignment is not proper. If i give the value for the entire varchar field then i am getting proper output. If it is less than 78 the later part of data is moved to this varchar field.
What should i do in this regard.
i think,this is the post which related to ur previous post.
If yes,why u posted this as a NEW post?
getting confuse.u hav to give a reply for that,not new post.
If it is same post,
then I/P file LRECL=569,VB ,am i corrct?
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
Sorry about my previous post.
Quote:
This is because even though my varchar is of 78 length i am giving data of 10 characters
Since your variable is varchar variable, you are getting overlap. If you are data lenght in the var is always 10, change the sort card such that 68 spaces are padded.
Joined: 01 Feb 2007 Posts: 123 Location: Hyderabad
Hi,
For the above Query the probelm got resolved.
While i am unloading from the table i had to code like this
UNLOAD
FORMAT DSNTIAUL
DIRECT AUTO
SELECT
xxx
,yyy
,zzz
from table-name;
So if code FORMAT DSNTIAUL while unloading, it will convert the varchar filed to char and generates my output file as FB. Now my data is matching with copybook.