IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top