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 the maximum length of a single line of jcl?

0 Answers  


can we maintain 2 generations with different Lengths in Same GDG ?

3 Answers   RBS,


In order to continue a job after a return code of 12 in step1, what the step2 exec statement include?

1 Answers  


Explain the function of job statement in jcl?

0 Answers  


Explain the job statement in jcl?

0 Answers  






What do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?

0 Answers  


How to execute step2,step1,step3 when step1,2&3 are in order

6 Answers   TCS,


GDGs can be CREATED (not COPIED) only on DASD and NOT on tape drives ? Is it True ?

2 Answers   ABC, IBM,


A STEP has more than 1 file as INPUT. And we have to put all these records int 1 output file. How to do ? //InputF  DD DSN=ID.File1              DSN=ID.File2              DSN=ID.File3

1 Answers   FIS,


How to do automated restart when a job abend?

0 Answers  


Is Default for MSGCLASS = (1,1) ?

2 Answers   IBM,


Can we able insert data into a PS file Using IEBUPDTE utility??? If Yes can anyone describe it please..

1 Answers  


Categories