Split into files



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Split into files

Postby lodemoss » Fri Jul 17, 2009 12:40 am

I need to split an input file into four outputs. If I use the "split", option, the input data gets parsed to the outputs with the first input record going to the 1st output, the 2nd input record to the 2nd file, etc. How can I send the first 25% of the input file to the first output file, the 2nd 25% to the 2nd file, etc. I will not know the number of records on the input file. Is there another option other than "split"?
lodemoss
 
Posts: 1
Joined: Fri Jul 17, 2009 12:29 am
Has thanked: 0 time
Been thanked: 0 time

Re: Split into files

Postby dick scherrer » Fri Jul 17, 2009 2:03 am

Hello and welcome to the forum,

I am not aware of a way to "split" by some %. . .

What is the business requirement to split this way?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Split into files

Postby Alissa Margulies » Sat Jul 18, 2009 3:19 am

Try this SyncSort for z/OS 1.3 job:
//S1    EXEC PGM=SORT 
//SYSOUT  DD SYSOUT=*                                               
//SORTIN  DD DSN=INPUT.FILE,DISP=SHR                                       
//SORTOUT DD DSN=&TEMP1,DISP=(NEW,PASS)...                                 
//SYSIN   DD *                                                       
  SORT FIELDS=COPY                                                 
  OUTFIL FILES=OUT,REMOVECC,NODETAIL,                             
  TRAILER1=(COUNT=(M11,LENGTH=8))                                 
//*                                                               
//S2    EXEC PGM=SORT
//SYSOUT  DD SYSOUT=*                                                 
//SORTIN  DD DSN=&&TEMP1,DISP=(OLD,PASS)                           
//SORTOUT DD DSN=&&TEMP2,DISP=(NEW,PASS)...                                       
//SYSIN   DD *                                                       
  SORT FIELDS=COPY                                                 
  OUTREC BUILD=(2X,C'SPLIT1R=',1,8,ZD,DIV,+4,TO=ZDF,LENGTH=8,80:X)
//*                                                               
//S3     EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD DSN=INPUT.FILE,DISP=SHR               
//SORTOF01 DD DSN=First25.Percent
//SORTOF02 DD DSN=Second25.Percent           
//SORTOF03 DD DSN=Third25.Percent
//SORTOF04 DD DSN=Fourth25.Percent
//SYSIN    DD *                             
  SORT FIELDS=COPY                       
  OUTFIL FILES=(01,02,03,04),           
//         DD DSN=&&TEMP2,DISP=(OLD,PASS)   
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post