|
|
| Author |
Message |
cmohanraj
New User
Joined: 04 Apr 2005 Posts: 15
|
|
|
|
Can i Access an ESDS from last record to first?
if yes pls explain me with code |
|
| Back to top |
|
 |
References
|
|
 |
Kingsingh
New User
Joined: 11 Mar 2005 Posts: 9
|
|
|
|
| Through CICS u can access from last to first using STARTBR , READPREV |
|
| Back to top |
|
 |
cmohanraj
New User
Joined: 04 Apr 2005 Posts: 15
|
|
|
|
Thanks kings but i wanna do it in batch.
pls do explain me with coding |
|
| Back to top |
|
 |
somasundaran_k
Active User
Joined: 03 Jun 2003 Posts: 141
|
|
|
|
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 |
|
| Back to top |
|
 |
cmohanraj
New User
Joined: 04 Apr 2005 Posts: 15
|
|
|
|
| thankyou. |
|
| Back to top |
|
 |
|
|