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

Dynamically allocating number of output dataset in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Tue Jul 14, 2009 4:50 pm
Reply with quote

I have a input file which is having more 15000 lines and i wanna split it into several output files each having 5,000 records. This is the JCL im using,

Code:


//SPLITFLS EXEC PGM=SORT                                               
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSUDUMP DD SYSOUT=*                                                 
//SORTIN   DD DSN=input.xxx.yyy.zzzzz,DISP=SHR         
//SORTOF01 DD DSN=output1,                   
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,                       
//            SPACE=(CYL,(1,1),RLSE),                                   
//            RECFM=FB,LRECL=80                                         
//SORTOF02 DD DSN=output2,                   
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,                       
//            SPACE=(CYL,(1,1),RLSE),                                   
//            RECFM=FB,LRECL=80                                         
//SORTOF03 DD DSN=Output3,                   
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,                       
//            SPACE=(CYL,(1,1),RLSE),                                   
//            RECFM=FB,LRECL=80                                         
//SYSIN    DD *                                                         
   SORT FIELDS=COPY                                                     
    OUTFIL FILES=01,ENDREC=5000,REMOVECC,                               
     TRAILER1=(2/,'RECORDS COPIED IN THIS RPT: ',COUNT=(M11,LENGTH=8)) 
    OUTFIL FILES=02,STARTREC=5001,ENDREC=10000,REMOVECC,               
     TRAILER1=(2/,'RECORDS COPIED IN THIS RPT: ',COUNT=(M11,LENGTH=8)) 
    OUTFIL FILES=03,STARTREC=10001,ENDREC=15000,REMOVECC,               
     TRAILER1=(2/,'RECORDS COPIED IN THIS RPT: ',COUNT=(M11,LENGTH=8)) 
//*                                                                     



How to allocate output datasets dynamically?

For example :

If an input file comes with 30,000 lines,according to my requirement i should seperate this into 6 files. At the time of processing i shuld give only number '6' my JCL should automatically allocate output datasets.

Please give me some suggestions!!
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 Jul 14, 2009 8:28 pm
Reply with quote

You could use the technique shown in the "Split a file to n output files dynamically" Smart DFSORT Trick to divide the records. You could "generate" the output DD statements automatically and create a job to submit to the internal reader - see the "Generate JCL to submit to the internal reader" Smart DFSORT Trick. The Smart DFSORT Tricks are at:

www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000094
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top