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
 

 

Extract File Length in DSNUTILB

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Sun Apr 19, 2009 5:35 pm    Post subject: Extract File Length in DSNUTILB
Reply with quote

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
View user's profile Send private message

vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Sun Apr 19, 2009 5:43 pm    Post subject: Reply to: Extract File Length in DSNUTILB
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Sun Apr 19, 2009 6:50 pm    Post subject:
Reply with quote

How about a hex display of the front part of both a VB and an FB record?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Sun Apr 19, 2009 9:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Apr 19, 2009 10:39 pm    Post subject:
Reply with quote

4 for the RDW and 2 for the table ID.
Back to top
View user's profile Send private message
vasif

New User


Joined: 11 Feb 2008
Posts: 35
Location: Chennai

PostPosted: Mon Apr 20, 2009 11:12 am    Post subject:
Reply with quote

Thank You very much Craq Giegerich ! icon_biggrin.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 20, 2009 10:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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