i just need the first and last record from a sequencial
file?how
Answer Posted / paray2x
The best option is to used File-Aid processing options.
If not,
1. Use SORT FIELDS=COPY, STOPAFT=1 to get the first record.
2. Insert line numbers in the file using SEQNUM fucntion of
SORT. Then, do a SORT FIELDS on this line number in
descending order, save it a temp file.
3. Use SORT FIELDS=COPY, STOPAFT=1 on this temp file to get
the last record.
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
Explain dfsort utility?
What is use of restart and how to use it?
How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?
When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?
How do you access an uncatalogued dataset in a jcl?
What is the function of job statement in jcl?
what are the statements that are not valid to be included in an include statement?
what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?
How is a type of file defined in the jcl that executes the cobol program?
Is automatic restart possible in jcl?
Name the parameters which can be used to limit the number of records written to a sysout dataset?
How does jcl specify the job to the operating system?
how do you access an uncataloged dataset in a jcl?
For what purpose steplib and joblib are used ?
what is DD statement is used in JCL?