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 concatenating?
Why block size is multiple of lrecl in jcl?
What is use of restart and how to use it?
Explain how can the attributes of one sms dataset be copied to another dataset?
Describe the various parameters utilized in the creation of a gdg?
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 is the function of dd name parameter with a 2 part structure; audit.report?
The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
How can a jobs execution priority be modified?
How to override loadlib?
how JCL works?
What are the jcl procedures?
How jcl is used for testing batch programs?
how would you create a temporary dataset? And where will you use them?