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
 

 

Split a vb file to 4 different fixed length file

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

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 4:55 pm    Post subject: Split a vb file to 4 different fixed length file
Reply with quote

Hi,

I want to split a vb length file to 4 different fb file.
I am able to slit but no able to make them fb length.
Code:

//STEP001  EXEC PGM=SORT                                     
//SORTLIB  DD DSN=SYS1.SORTLIB,DISP=SHR                     
//SORTWK01 DD SPACE=(CYL,(100)),UNIT=DISK                   
//SORTWK02 DD SPACE=(CYL,(300)),UNIT=DISK                   
//SORTWK03 DD SPACE=(CYL,(300)),UNIT=DISK                   
//SORTWK04 DD SPACE=(CYL,(300)),UNIT=DISK                   
//SYSIN    DD *                                             
 SORT FIELDS=(6,65,CH,A)                                     
 OUTFIL FILES=1,                                             
        INCLUDE=(5,1,CH,EQ,C'A')                             
 OUTFIL FILES=2,                                             
        INCLUDE=(5,1,CH,EQ,C'B')                             
 OUTFIL FILES=3,                                             
        INCLUDE=(5,1,CH,EQ,C'C')                             
 OUTFIL FILES=4,                                             
        INCLUDE=(5,1,CH,EQ,C'D')                             
/*                                                           
//SORTIN   DD DSN=TBH2.XOI.DATA,DISP=SHR                     
//SORTOF1  DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),
//            DSN=TBH2.SOI.A.DATA                           
//SORTOF2  DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),
//            DSN=TBH2.SOI.B.DATA                           
//SORTOF3  DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),
//            DSN=TBH2.SOI.C.DATA                           
//SORTOF4  DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),
//            DSN=TBH2.SOI.D.DATA                           
//SYSOUT   DD SYSOUT=*                                       
//STATOUT DD SYSOUT=*                                       
//SYSUDUMP DD SYSOUT=* 


but o/p file length should be...
For A 1009
B 422
C 322
D 122

Please tell me is there any option in sort to change characterstic of o/p file or we need to use any other ieb utility to change record format .
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 5:51 pm    Post subject:
Reply with quote

I also tried convert option..
Code:

//STEP001  EXEC PGM=SORT                                         
//SORTLIB  DD DSN=SYS1.SORTLIB,DISP=SHR                         
//SORTWK01 DD SPACE=(CYL,(100)),UNIT=DISK                       
//SORTWK02 DD SPACE=(CYL,(300)),UNIT=DISK                       
//SORTWK03 DD SPACE=(CYL,(300)),UNIT=DISK                       
//SORTWK04 DD SPACE=(CYL,(300)),UNIT=DISK                       
//SYSIN    DD *                                                 
 SORT FIELDS=(6,65,CH,A)                                         
 OUTFIL FILES=FILE1,CONVERT,                                     
        INCLUDE=(5,1,CH,EQ,C'A')                                 
 OUTFIL FILES=FILE2,CONVERT,                                     
       INCLUDE=(5,1,CH,EQ,C'B')                                 
 OUTFIL FILES=FILE3,CONVERT,                                     
             INCLUDE=(5,1,CH,EQ,C'C')                           
 OUTFIL FILES=FILE4,CONVERT,                                     
             INCLUDE=(5,1,CH,EQ,C'D')                           
/*                                                               
//SORTIN   DD DSN=TBH2.XOI.DATA,DISP=SHR                         
//FILE1    DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),   
//            DCB=(RECFM=FB,LRECL=1009,BLKSIZE=1009),           
//            DSN=TBH2.SOI.A.DATA                               
//FILE2      DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE), 
//            DCB=(RECFM=FB,LRECL=422,BLKSIZE=4220),             
//            DSN=TBH2.SOI.B.DATA                               
//FILE3     DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),   
//            DCB=(RECFM=FB,LRECL=190,BLKSIZE=1900),             
//            DSN=TBH2.SOI.C.DATA                               
//FILE4     DD DISP=(,CATLG),UNIT=3380,SPACE=(CYL,(1,1),RLSE),   
//            DCB=(RECFM=FB,LRECL=407,BLKSIZE=4070),             
//            DSN=TBH2.SOI.D.DATA                               
//SYSOUT   DD SYSOUT=*                                           
//STATOUT DD SYSOUT=*                                           
//SYSUDUMP DD SYSOUT=*                                           


But it's giving syntax error
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 29, 2006 8:54 pm    Post subject:
Reply with quote

You need to use OUTREC= (or BUILD=) along with CONVERT (or VTOF). For more information on this, see the "VB to FB conversion" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 9:56 pm    Post subject:
Reply with quote

Frank,

Sorry but can u explain it .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 29, 2006 10:17 pm    Post subject:
Reply with quote

Not sure what you want me to explain. You have four OUTFIL statements each with CONVERT. You need to add OUTREC=(bytes) to each OUTFIL statement to tell DFSORT which fields from the variable record you want to have in the fixed output records. For example, if you want the first 122 bytes of each VB record in the FILE4 FB output records, you would change that OUTFIL statement to:

Code:

  OUTFIL FILES=FILE4,CONVERT,OUTREC=(5,122),
             INCLUDE=(5,1,CH,EQ,C'D')


Likewise for the other OUTFIL statements depending on which bytes you want to extract. Notice that the first position in OUTREC= is 5 because presumably you don't want the RDW from positions 1-4.

I can't really tell you much more because I don't know what you're trying to extract from the VB records to the FB records.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 10:20 pm    Post subject:
Reply with quote

yeap thanks alot frank...
One more doubt is it compulsory to specify outrec if u include either VTOF or CONVERT
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 29, 2006 11:09 pm    Post subject:
Reply with quote

Yes, you must specify OUTREC= or BUILD= with VTOF or CONVERT.

(You do not have to specify OUTREC= or BUILD= with FTOV.)
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Aug 30, 2006 10:52 am    Post subject:
Reply with quote

Thanks alot ...icon_smile.gif
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 splitting a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 11:51 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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