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

01 A. 10 B pic X(10). move spaces to A. move spaces to B. output in A & B

2 Answers   Perot Systems,


wht r different types of sorts ?

1 Answers   L&T,


I HAVE A SEQUENTIAL FILE CONTAINING ONE RECORD IN WHICH I HAVE ONE FIELD AS CUSTOMER IDENTITY NUMBER FIELD WHICH IS A SIGNED FIELD. HOW TO SEQUENTIALLY INCREMENT THIS FIELD USING OVERLAY PARAMETER?.

1 Answers  


A job has 150 steps i want to execute only 57th step

3 Answers   Cognizant,


How to find out the number of records in a file using JCL

5 Answers   CTS,






I've one sequential file, that file size is LREC=100 (File contain Records like 1 to 100). Now I was increase the file size is LREC=102. My question is I want insert 00 (Two Zeros) in to the new file (That output file looks like : 00123 up to 100). How will write the SORT card in JCL. Please let me know.

2 Answers   Syntel,


How do you restart a step in JCL?

12 Answers   HSBC,


If i am going to change some variable in a copybook( size or variable type) ,what are the changes that need to be done in the corresponding JCL.

4 Answers   IBM,


In my JCL 10 Steps Will Be there Now i want to execute step05 And step06. How to Give the Cond?

2 Answers   IBM,


Name the system library from which modules are retrieved at execution

2 Answers  


what happens in execution stage in job processing?

0 Answers   IBM,


How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you

0 Answers  


Categories