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 |
Is it possible to left uncode disp?
What are isolation levels? Where do we need to specify them in compiling JCL?
Can you delete the GDG base without deleting GDG generations ?
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?
How to release a JOB (from the input queue) held by TYPRUN = HOLD ? and how to see the installation default time after which a JOB will be automatically released ? How to see the list of currently HELD JOBS ?
Can we use COND=EVEN on a job card, when jobs are scheduled through scheduler?
what is the meaning of keyword in jcl?what is is opposite?
what is the compile process of cobol program expalin with code
if we give TIME=0 how many sec that job/step
What is maximum length of block size?
5 Answers Cap Gemini, Kanbay, TCS,
what are the options in file-aid to edit vsam dataset and to compare data sets.
How to delete AIX ? i) IEBGENER ii) IDCAMS iii) PURGE iv) All of the above