I have a sequential file in which there are 50 records. Now
I want to copy all the 50 records in the reverse order into
a new file? The last record in the original file should be
the first record in the new file. How can I do it?
Answers were Sorted based on User's Feedback
Answer / avinashn17
The above soultion works only if records are in the sorted
order.
The below piece of code could be used for records which are
not sorted.
******************************************************
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT,
// DISP=SHR
//SORTOUT DD DSN=OUTPUT,
// DISP=(NEW,CATLG,DELETE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0),
// DATACLAS=PSFB
//SYSIN DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTREC BUILD=(1,80)
/*
*********************************************************
Record length of the above file is 80
INREC OVERLAY - places sequence number after 80.
Then it is sorted in descending order of sequence nummber.
OUTREC BUILD - removes sequence number and retains original
record.
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / shammi
But COPYBACK option can be used using File aid only...
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / avinash n
The file could be sorted in the descending order.
Synatx:
SORT FIELDS=(1:Y,CH,D)
where Y = record length.
The output would be in the reverse order!
| Is This Answer Correct ? | 0 Yes | 13 No |
describe the job statement, its meaning,syntax and significant keywords?
What does a disposition of (new,catlg,keep) for a dsn mean?
read all error codes like SB07?
How do you submit a job for execution?
How to rename a VSAM file as well as it's index file?
can we have more than one job in a single job card that is we are specifying only one 'job' statement in the jcl.
whats the diff bw the evaluate also and and?
in a jcl, a large volume dataset is loaded to a table using bmcload in step1 and an image copy of the loaded table is taken using bmccopy in step2. Step2 abends because the image copy dataset cannot hold the volume of the table. How can this be rectified?
what is DSN in JCL and what are the parameters to declare the DSN?
Can we change the LIMIT of GDG?
Can we able insert data into a PS file Using IEBUPDTE utility??? If Yes can anyone describe it please..
how to do automated restart when a job abends?