Page 1 of 1

SORT JCL to Split data using OUTFIL

Posted: Mon Feb 06, 2006 1:48 pm
by pkaushi
Hi,

I want to split a file contaning 700 records into 3 files where 1st file has 200, 2nd has 200 and 3rd has 300. I triedusing the SPLIT function in SYNCSORT but then the records where getting splitted evenly but not yb the record count as such.

Kindly help me out with this.

Try use OUTFIL option

Posted: Tue Feb 07, 2006 8:15 am
by prasad
Hi pkaushi,

We can split the files using OUTFIL option. Check below example.

Code: Select all

//***********************************************************
//SPLITFLS EXEC PGM=SORT
//***********************************************************
//SYSPRINT DD SYSOUT=* 
//SYSOUT   DD SYSOUT=* 
//SYSUDUMP DD SYSOUT=* 
//SORTIN   DD DSN=FILE1......,DISP=SHR 
//SORTOF01 DD DSN=OUTPUTFILE1......., 
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA, 
//            SPACE=(CYL,(1,1),RLSE), 
//            RECFM=FB,LRECL=20 
//SORTOF02 DD DSN=OUTPUTFILE2.............., 
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA, 
//            SPACE=(CYL,(1,1),RLSE), 
//            RECFM=FB,LRECL=20 
//SORTOF03 DD DSN=OUTPUTFILE3.............., 
//            DISP=(NEW,CATLG,DELETE),UNIT=SYSDA, 
//            SPACE=(CYL,(1,1),RLSE), 
//            RECFM=FB,LRECL=20
//SYSIN DD *      
  SORT FIELDS=COPY 
  OUTFIL FILES=01,ENDREC=200 
  OUTFIL FILES=02,STARTREC=201,ENDREC=400 
  OUTFIL FILES=03,STARTREC=401,ENDREC=700 
//* 
If above example is not answered your question, let me know.


Thanks,
Prasad

split

Posted: Tue Feb 07, 2006 9:45 am
by Guest
Thanks a ton prasad.... :-)

Posted: Thu Feb 23, 2006 1:30 am
by pzmohanty
Hi ,

here is the link from IBM DFSORT TRICK site detailing fours ways to acomplish splitting of files :

http://www-03.ibm.com/servers/storage/s ... 1.html#t01

Thanks
Priyaranjan Mohanty

Topic deleted by Admin

Posted: Mon Jan 25, 2016 11:11 pm
by academyindia4
<< Content deleted By Admin >>

Topic deleted by Admin

Posted: Mon Feb 01, 2016 1:30 am
by academyindia4
<< Content deleted By Admin >>