How I sort the records in a file and copy the first 10
records to another file
Answers were Sorted based on User's Feedback
Answer / balasukumar
//SORTIN DD DSN=INF1
//SORTOT DD DSN=OTF
//SYSIN DD *
SORT FIELDS = COPY
SKIP=0
STOPAFT=10
/*
| Is This Answer Correct ? | 6 Yes | 1 No |
Answer / haleema
Keep first 10 sorted output records.
SUBSET FROM(IN1) TO(OUT1) OUTPUT KEEP FIRST(10)USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(11,5,CH,A)
/*
Do this using ICETOOL job.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / srinivasa yadav
//sysin dd *
sort fields=(starting postion,length,data-type,order)
skip rec=0
stop rec=10
/*
and also we can use file-aid tool. in file-aid
there is an option 3.3
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / girish kumar
just write like this
sysin dd *
sort fields=copy
stop after=10
/*
//
i tryed it's working
| Is This Answer Correct ? | 1 Yes | 1 No |
Name the system library from which modules are retrieved at execution
How is the record format of an output dataset specified?
In job processing, what happens in conversion stage?
How to get the last but one duplicate record of the file using Sort?
What will happen when we try to pass data from JCL to COBOL using PARM parameter without declaring the length field in Linkage Section?
Passing a variable parm from JCL to a cobol/db2 program
Min no of member?s (PDS) in one directory block?
What are the parameter we cannot use in procedure?
Describe the EXEC statement, its meaning, syntax and keywords?
i have a string of 80 chars i want to replace 4th char with "a"?
how to run JCL thru COBOL.
Which is the most widely used batch performance monitor for DB2?