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
What statement marks the beginning of a job step; assigns a name to the step; identifies the program or catalogued or in-stream procedure to be executed in the step?
Explain how can an in-stream dataset be terminated?
is there any way to execute more than one proc in the same exec statement at the same time..?
How jcl is used for testing batch programs?
What is the function of the dd mgmtclas keyword in sms datasets?
how you will the direct the data to spool using sysout option?
What is the purpose of dd?
A dd statement consists of 4 fields. Name them?
what EXEC statement is and what is the syntax of EXEC statement used in JCL?
What is the format of comment statement?
What does a disposition of (MOD,DELETE,DELETE) mean ?
Explain the function of dd disp parameter?
What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
What happens if both JOBLIB & STEPLIB is specified ?