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 ?    28 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

When will we need to specify Space parameter ?

3 Answers   Wipro,


How are GDGs concatenated?

1 Answers  


how to set dependancy for jobs?

4 Answers  


How to use COND Parameter in jcl

4 Answers   NIIT, Wipro,


How can i execute 5th step without executing first 4 steps?

4 Answers  


What is the improvement to COND= in the latest version of MVS?

3 Answers  


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

0 Answers  


What is the use of disp parameter?

0 Answers  


Describe the EXEC statement, its meaning, syntax and keywords?

2 Answers  


What are s0c1, s0c4, s0c5, s0c7 and socb?

0 Answers  


What is COND=EVEN ?

9 Answers   IBM,


how to resolve the soc4 error?

5 Answers   ITC Infotech,


Categories