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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


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