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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am

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