Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us