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
 

 

SORT step to copy field from HEADER to all DETAIL records?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Mrspredeep

New User


Joined: 30 Jun 2010
Posts: 28
Location: USA

PostPosted: Thu Feb 23, 2012 9:37 pm    Post subject: SORT step to copy field from HEADER to all DETAIL records?
Reply with quote

This is my requirement:

Multiple generations of a GDG are processed together.

I need to filter the records from the most recent GDG for a person.

For this I need to append the timestamp from the header record of one GDG to all the detail records of that GDG.

I thought of writing an EZTREIVE program for this, but also want to know if this could be achieved through SORT?
Back to top
View user's profile Send private message

elango_K

New User


Joined: 18 Aug 2011
Posts: 44
Location: India

PostPosted: Thu Feb 23, 2012 9:53 pm    Post subject:
Reply with quote

Time stamp can be appended to all detail records by using GROUP funtion.

Input:
Code:

H00:01
D00030
D00100
D00032
D00443
D00003
D00004
D00015
D00077
D00086
D00088
TEND   


JCL
Code:

//SYSIN DD *                                 
  OPTION COPY                               
  INREC IFTHEN=(WHEN=INIT,BUILD=(1:1,80)),   
  IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'H'),
  END=(1,1,CH,EQ,C'T'),PUSH=(30:2,5))       


output:
Code:

H00:01                       00:01
D00030                       00:01
D00100                       00:01
D00032                       00:01
D00443                       00:01
D00003                       00:01
D00004                       00:01
D00015                       00:01
D00077                       00:01
D00086                       00:01
D00088                       00:01
TEND                         00:01


Hope this helps...
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am


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