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 |
//ERFDS JOB //STEP1 //STEP2 //STEP3...COND=(4,LT) //STEP4 1.CONDITION IN STEP3 REFERS TO WHICH STEP'S RETURN CODE (STEP1 OR STEP2)? 2.IN ABOVE PROGRAM IF CONDITION SATISFIES IN STEP3 WHICH STEPS WILL EXECUTE?? AND WHY? IF CONDITION IN STEP3 SATISFIES
What is one line to pass PARM from JCL to COBOL?
Name the statement which can be used to send data to another mvs jes3 node?
how to identify a vasam dataset by seeing in 3.4(browse)
wht do u mean by inrec and outrec ?
How can unused space allocation be returned to the system when a dataset is closed?
Hi Guyz, My requirement is to empty out a PS file but not to delete. How would I do that. Is there any Utility. If any other way, plz answer. Thanks.
9 Answers iGate, Lehman Brothers,
List in order the hierarchical levels of jcl?
What is the difference between BLKSIZE and LRECL?
Name some of the JCL statements that are not allowed in procs.?
what is the Difference between SYSIN and PARM ?
can any one plzzzzzz tell the jcl code for creating ps using idcams