SORT JCL to Split data using OUTFIL

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
pkaushi
Member
Posts: 9
Joined: Mon Feb 06, 2006 1:45 pm

SORT JCL to Split data using OUTFIL

Post by pkaushi » Mon Feb 06, 2006 1:48 pm

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.
Thanks and Regards,
Prashant

User avatar
prasad
Member
Posts: 7
Joined: Mon Feb 06, 2006 12:04 am

Try use OUTFIL option

Post by prasad » Tue Feb 07, 2006 8:15 am

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

Guest

split

Post by Guest » Tue Feb 07, 2006 9:45 am

Thanks a ton prasad.... :-)

pzmohanty
Member
Posts: 1
Joined: Wed Feb 22, 2006 12:59 pm

Post by pzmohanty » Thu Feb 23, 2006 1:30 am

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

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Jan 25, 2016 11:11 pm

<< Content deleted By Admin >>

academyindia4

Topic deleted by Admin

Post by academyindia4 » Mon Feb 01, 2016 1:30 am

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others