View previous topic :: View next topic
|
Author |
Message |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hi,
How do we can copy an existing ESDS records to another ESDS/Flat file in reverse order? (Assumption - # of records unknown, should not use any Language)
Example - Assuming we have 5 records in ESDS-
1st Record
2nd Record
3rd Record
4th Record
5th Record
New ESDS/Flat file should look like
5th Record
4th Record
3rd Record
2nd Record
1st Record
Regards,
Murali Mohan K |
|
Back to top |
|
|
parikshit123
Active User
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
Hi,
I believe sort can be used for this. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hi,
Can you anyone provide the code?
Regards,
Murali Mohan K |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job to do what you asked. I assumed your ESDS has fixed 80-byte records. But you can change the job appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... original ESDS
//SORTOUT DD DSN=... new ESDS
//SYSIN DD *
RECORD TYPE=F
* Add sequence number.
INREC OVERLAY=(81:SEQNUM,8,ZD)
* Sort in descending order on sequence number.
SORT FIELDS=(81,8,ZD,D)
* Remove sequence number.
OUTREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
|