i have 10,000 records in one input file.i want to sort 1 to
5000 records in one outputfile and remaining records sort in
another output file write the syntax for this?

Answers were Sorted based on User's Feedback



i have 10,000 records in one input file.i want to sort 1 to 5000 records in one outputfile and rema..

Answer / albert

SORT FIELDS=COPY
OUTFIL FILES=1,STOPAFT=5000
OUTFIL FILES=2,SKIPREC=5000

Is This Answer Correct ?    27 Yes 8 No

i have 10,000 records in one input file.i want to sort 1 to 5000 records in one outputfile and rema..

Answer / muttaiah

@Albert:
IF we are using Outfil, we won't use Skiprec & stopaft.

My Answer:
Step1:
sort fields=copy
outfil files=01,endrec=5000
outfil files=02,startrec=5001,endrec=10000
Step2:
Sort fields=(pos,leng,cha,a or d)

Is This Answer Correct ?    7 Yes 0 No

i have 10,000 records in one input file.i want to sort 1 to 5000 records in one outputfile and rema..

Answer / v khurana

One more bethod is there, i.e. by using SPLIT1R

OUTFIL FNAMES=(FILE1,FILE2), SPLIT1R=5000

Is This Answer Correct ?    5 Yes 1 No

i have 10,000 records in one input file.i want to sort 1 to 5000 records in one outputfile and rema..

Answer / prakash

sort fields=copy
outfil files=1,endrec=5000
outfil files=2,start rec=5001,endrec=10000

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More JCL Interview Questions

What is COND=ONLY ?

2 Answers  


What u mean by include statement in JCL ?

3 Answers  


Does jcl support automatic restart?

0 Answers  


can we write a proc with in a proc

4 Answers   IBM,


What is the error in the following JCL statements : I) //step#three exec pgm=hkbc762 ii) //step#3 exec pgm = hkbc762 iii) //step#3 exec pgr = hkbc672

6 Answers  






How to DEBUG a JCL?

9 Answers   Satyam,


How to pass values in jcl to cobol?

4 Answers   IBM, Infosys,


how to run JCL thru COBOL.

1 Answers   Patni,


How to find the length of variable length copybook using fileaid ??

1 Answers   CSC,


Can we use DISP=SHR in output file in JCL

0 Answers  


Can we Execute a job without specifying Job Name in the Job Card?

2 Answers  


What is job control language?

0 Answers  


Categories