how to split a file

Answer Posted / himanshu

Using SORT utility we can split the file. Sort card will be
as:

//SYSIN DD *
SORT FIELDS=COPY
OUTFILE FNAMES=(SORTOUT1,SORTOUT2,SORTOUT3),SPLIT
/*

If there are 10 records in input and these have to be split
across three files SORTOUT1, SORTOUT2 and SORTOUT3
respectively. After running the Job using this sort card,
record1 would be stored in SORTOUT1, record2 in SORTOUT2,
record3 in SORTOUT3, record4 in SORTOUT1 and so on.

Is This Answer Correct ?    18 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK

1485


Explain how can the disposition of sysout datasets be set for an entire jobstream?

636


What is the difference between the positional and keyword parameters? Give examples.

712


What do you understand by jcl?

629


define cond parameter in jcl?

777






how to compare two datasets without using superce because output is limited to 133 bytes

1483


What is Cataloged Procedures?

714


Explain the function of //jcllib statement?

708


Explain how can return codes be tested before execution of a job step?

832


How to do automated restart when a job abend?

791


What is jcl in mainframe, and how many types of jcl statements are there for a job?

631


What are the jcl procedures?

646


if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?

1616


What is notcat 2 - gs?

941


what is the purpose of coding class parameter in job statement?

722