Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 6970
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
No new posts IDCAMS RENAMING VSAM FILE ALONG WITH ... upendrasri JCL & VSAM 11 Tue Apr 17, 2018 10:42 pm
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts converting a mainframe file with ASA ... Lynne Schuler All Other Mainframe Topics 5 Wed Apr 04, 2018 9:44 am
No new posts Limit in Length for a CICS START seahawk789 CICS 6 Mon Apr 02, 2018 8:34 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us