Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to reverse record position in ESDS?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jul 07, 2006 9:34 am    Post subject: How to reverse record position in ESDS?
Reply with quote

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
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Fri Jul 07, 2006 9:52 am    Post subject:
Reply with quote

Hi,
I believe sort can be used for this.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jul 07, 2006 10:18 am    Post subject:
Reply with quote

Hi,


Can you anyone provide the code?

Regards,
Murali Mohan K
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jul 07, 2006 8:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 5 Wed Jul 26, 2017 7:35 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us