somasundaran_k
Active User
Joined: 03 Jun 2003 Posts: 134
|
|
|
|
cmohanraj
Use SORT or FILEAID to reverse the order of the records and read sequentially from the beginning.
To reverse the order of the records you can use the following SORT solution. Assuming the LRECL is 80.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=OUTPUT REVERSED FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
INREC FIELDS=(1,80,SEQNUM,8,ZD)
SORT FIELDS=(81,8,ZD,D)
OUTREC FIELDS=(1,80)
/*
|
Then use your program to read/process the OUTPUT REVERSED FILE.
hth
-Som |
|