IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Split a vb file to 4 different fixed length file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
guptae

Moderator


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

PostPosted: Tue Aug 29, 2006 4:55 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 5:51 pm
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 Developer


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

PostPosted: Tue Aug 29, 2006 8:54 pm
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:

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: 1208
Location: Bangalore,India

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

Frank,

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

DFSORT Developer


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

PostPosted: Tue Aug 29, 2006 10:17 pm
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: 1208
Location: Bangalore,India

PostPosted: Tue Aug 29, 2006 10:20 pm
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 Developer


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

PostPosted: Tue Aug 29, 2006 11:09 pm
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: 1208
Location: Bangalore,India

PostPosted: Wed Aug 30, 2006 10:52 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top