View previous topic :: View next topic
|
Author |
Message |
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
Hi Friends,
I used DSNUTILB program to extract a DB2 table. The extract file is in VB format with length 302. Acc to the DCLGen, the length of the table is 296 bytes. To convert it into FB, i used the following logic in DFSort:
Code: |
//STEP20 EXEC PGM=SORT
//SORTIN DD DSN=USERID.DB2TBL.EXTRACT,
// DISP=SHR
//OUTPFIL DD DSN=USERID.DB2TBL.EXTRACT.FB,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(10,10),RLSE),
// UNIT=DISK
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL VTOF,FNAMES=OUTPFIL,VLFILL=C' ',
OUTREC=(1:5,296)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=* |
As in any VB file, first 4 bytes are RDW, and data starts from the 5th byte, i used OUTREC=(1:5,296).
But i am getting 2 extraneous characters(..) in the beginning of each record and the whole record is shifted to the right by these 2 characters.
Later when i used OUTREC=(1:7,296) the output was correct. Can anybody explain why use 7 and not 5 as the starting position as used for any VB file.
Thanks,
Asif. |
|
Back to top |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
I also used the following code but got the same first characters(..) and whole record got shifted right
Code: |
//STEP10 EXEC PGM=ICEGENER
//SYSIN DD *
GENERATE MAXFLDS=1
RECORD FIELD=(296,1,,1)
/*
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=USERID.DB2TBL.EXTRACT,DISP=SHR
//SYSUT2 DD DSN=USERID.DB2TBL.EXTRACT.FB,
// DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=296),
// SPACE=(CYL,(1,1),RLSE),UNIT=SYSDA
|
|
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
How about a hex display of the front part of both a VB and an FB record? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
4 for the RDW and probably 2 for the first column which is varchar?
if you don't want any more guesses, provide us with the select statement and the table def. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
4 for the RDW and 2 for the table ID. |
|
Back to top |
|
|
vasif
New User
Joined: 11 Feb 2008 Posts: 35 Location: Chennai
|
|
|
|
Thank You very much Craq Giegerich ! |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
vasif,
You don't even have to convert from VB to FB. Take a look at your SYSPUNCH dd from your unload step , It will list all the columns which are null and varchar columns with positions. You can use the functions IFNULL, VALUE, COALESCE to have default values for them. For VARCHAR fields use the function CHAR to make them char data. By doing this you can avoid the conversion of the file from VB to FB |
|
Back to top |
|
|
|