i just need the first and last record from a sequencial
file?how
Answers were Sorted based on User's Feedback
Answer / 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 |
USE SKIP(N) To skip number of records
if 10 accounts are there and u want to skip first 7 records
use
//sysin dd*
repro infile(dd1) -
outfile(dd2) -
skip(07) -
count(03)
/*
for 1st and last
//sysin dd*
repro infile(dd1) -
outfile(dd2) -
count(1) -
skip(08) -
count(01)
/*
| Is This Answer Correct ? | 1 Yes | 4 No |
how to identify a vasam dataset by seeing in 3.4(browse)
What does the keyword DCB mean and what are some of the keywords associated with it?
if you have big pgm. during compilation is abends with (soc7)how do you know which line has soc 7 error.
what is a null indicator in db2?
How to submit a jcl from cics?
SORT card to eliminate duplicity.
I have a Symbolic Parameter which can have a value say 01 or 02 etc. Now consider i have another Symbolic parameters which is used to get 3 digit code of months (JAN, FEB, etc) but for that i need to check the first symbolic parameter's value and provide its corresponding month's name in the second symbolic parameter. Say IF sym1 = 01 then sym2='Jan' ENDIF etc... In JCL, IF condition is used for RC, ABEND purposes of a step etc. When i use Symbolic parameter in IF clause it is showing Error message. Is there a way to get the above result possible in JCL. If you could provide me with an example, i would understand it better.
How is the keyword DUMMY used in JCL?
A file has dta in S9(09) COMP format. How do I move the data into a character field X(10)?
Explain the hierarchy levels in jcl?
Can we use DISP=SHR in output file in JCL
is there any utility for restarting a particular step in jcl reply soon ?