i have 1000 records in input file and i want to sort it and
the first 200 records to be placed in output file. how to
do that??

Answers were Sorted based on User's Feedback



i have 1000 records in input file and i want to sort it and the first 200 records to be placed in ..

Answer / felix

i think, we can use OUTLIM parameter.

Is This Answer Correct ?    2 Yes 3 No

i have 1000 records in input file and i want to sort it and the first 200 records to be placed in ..

Answer / sudeep

I think the answer written by Kavya is not fully correct.It
will cause the sort to stop after first 200 records in the
input file are sorted.But we want the input file to be
sorted completely.and first 200 records to be placed in
output file.

Is This Answer Correct ?    1 Yes 2 No

i have 1000 records in input file and i want to sort it and the first 200 records to be placed in ..

Answer / rajesh

//SYSIN DD *
SORT FIELDS=COPY,
OUTREC FILEDS=(1,2,CH,A) --> WHATEVER U WANNT TO SORT
STOPAFT=100
//

hope this does..

Is This Answer Correct ?    0 Yes 1 No

i have 1000 records in input file and i want to sort it and the first 200 records to be placed in ..

Answer / bachee

//STEP1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTOUT DD DSN=TEST.SAMPLE.OUTPUT.VIN,DISP=SHR
//SORTIN DD DSN=TEST.SAMPLE.INPUT.VIN,DISP=SHR
//SYSIN DD *
SORT FIELDS=( , ,CH,A)
ENDREC=200
//

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More JCL Interview Questions

What is the significance of addrspc parameter in the exec statement?

0 Answers  


Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT COUNT(1)?

8 Answers  


If a field is declared as a comp-3 field and if we want to sort a dataset based on this field, then how will the sort card be??? e.g- if we want to sort by a field which is defined as a PIC X(5) then we will mention - sort fields=(1,5,ch,a). Likewise if a field is defined as PIC S9(10)COMP-3 then in this case how will the sort field be defined (because in this case a sign is also involved)???

8 Answers  


What is the difference between a PDS member and a GDG Generation ? Is it only this, that with a generation we can use +1, 0, -1 etc while with PDS member we can not ?

7 Answers   IBM,


how to split a file

4 Answers   IBM,






When output dataset space is required, what quantity categories are used?

0 Answers  


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


What are some jcl statements that are not allowed in procedures?

0 Answers  


Are all (i), (ii), (iii), (iv) of the below are VALID to reference a temporary dataset ? STEP2 DD1 DD DSN = &&TEMP STEP3 DD2 DD (i) DSN = TEMP (ii) DSN = *.TEMP (iii) DSN = *.STEP1.DD1 (iv) DSN = *.STEP1.DD1.ONE

8 Answers   IBM,


Matching Logic in Jcl not in cobol.Could any one please answer this question

0 Answers  


Can anyone tell me the syntax for printing two files at two different destinations in a single step?

3 Answers  


What is TimeStamp, What is TimeStamp error and What is the Abend Code for TimeStamp Error ?

4 Answers   IBM,


Categories