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
 

 

GROUP - header data to be repeated in detail records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Mon Feb 01, 2016 11:36 am    Post subject: GROUP - header data to be repeated in detail records
Reply with quote

Hi,

I have a requirement to copy some text from header data to each record in the body of the group. for example, I have an input dataset as follows (FB, LRECL=6). '01' indicates beginning of a group in the 1st column. the next 01 indicates end of a group.

input:
Code:
01tkt1
02dddd
03dddd
01tkt2
02dddd
01tkt3
03dddd

I require an output as follows.

SEQ number to be appended to the end of the record(single digit) and tkt1 or tkt2 or tkt3 in header to be repeated in all of the detail records of the corresponding group.

Code:
01tkt11tkt1
02dddd2tkt1
03dddd3tkt1
01tkt21tkt2
02dddd2tkt2
01tkt31tkt3
03dddd2tkt3

Could anyone please help?
Back to top
View user's profile Send private message

boyti ko

New User


Joined: 03 Nov 2014
Posts: 78
Location: Malaysia

PostPosted: Mon Feb 01, 2016 11:45 am    Post subject:
Reply with quote

Check this example.
http://ibmmainframes.com/about63061.html
Back to top
View user's profile Send private message
Musab Ahmed

New User


Joined: 10 Dec 2012
Posts: 37
Location: India

PostPosted: Mon Feb 01, 2016 12:10 pm    Post subject: PUSH works
Reply with quote

I have written a piece of code where i use the PUSH keyword and it works.

Code:
    SORT FIELDS=COPY                                 
    INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'01'),
                  PUSH=(7:SEQ=1,8:3,4))             
    OUTREC BUILD=(1:1,11)                           

output:

Code:
01tkt11tkt1
02dddd2tkt1
03dddd3tkt1
01tkt21tkt2
02dddd2tkt2
01tkt31tkt3
03dddd2tkt3
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7279

PostPosted: Mon Feb 01, 2016 12:35 pm    Post subject:
Reply with quote

You don't need the OUTREC BUILD at all. Otherwise, good to go.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 3 Wed Feb 22, 2017 8:49 am
No new posts Match records - scdinesh DFSORT/ICETOOL 6 Wed Feb 22, 2017 5:02 am
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts Matching and unmatching records scdinesh DFSORT/ICETOOL 11 Tue Feb 07, 2017 12:41 am


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