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: 7223

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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts ODPP(Optim Data privacy Provider) Iss... Rama kishore IBM Tools 1 Mon Nov 07, 2016 5:46 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm


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