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
 

 

ICETOOL/Joinkeys Solution for Group By Replication

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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Mar 05, 2014 4:04 pm    Post subject: ICETOOL/Joinkeys Solution for Group By Replication
Reply with quote

Hi,

I have a following requirement for which I'm looking for a Sort-ICETOOL or similar solution.

I/P File: FB:LRECL80

Code:
Record Type   HICN#     CONTRACT#   PBP#
DTL       HICN1     CONTRACT1   PBP1
PRM       HICN1      
SUP       HICN1      
SUP       HICN1   
DTL       HICN2     CONTRACT2   PBP2
PRM       HICN2      
SUP       HICN2      



1. Records will be in a clubbed format i.e. First detail(DTL) type records, then Primary(PRM), and then Supplementary(SUP) type records. So, records in BOLD constitute one complete (clubbed) set of records for a single member, and the normal font are for the second member.

2. Since, The DTL type records have CONTRACT# and PBP# so corresponding Primary and Supplementary records will have spaces for these two fields.

Now, the requirement is to cascade the CONTRACT# and PBP# for a member, from its DTL type records, to its corresponding Primary and supplemental records. That is, the outcome should be as below:

O/P File: FB LRECL 80

Code:
Record Type   HICN#   CONTRACT#   PBP#
DTL   HICN1   CONTRACT1   PBP1
PRM   HICN1   CONTRACT1   PBP1
SUP   HICN1   CONTRACT1   PBP1
SUP   HICN1   CONTRACT1   PBP1
DTL   HICN2   CONTRACT2   PBP2
PRM   HICN2   CONTRACT2   PBP2
SUP   HICN2   CONTRACT2   PBP2


Can this be achieved through Sort utility avoiding a Module where I keep on replicating Contract#+PBP# until Records Type+HICN changes?

Please advise.

Code'd
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Wed Mar 05, 2014 4:39 pm    Post subject:
Reply with quote

Try this

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//S1      EXEC PGM=SORT
//SYSPRINT  DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SORTIN    DD *
DTL HICN1 CONTRACT1 PBP1
PRM HICN1
SUP HICN1
SUP HICN1
DTL HICN2 CONTRACT2 PBP2
PRM HICN2
SUP HICN2
//SORTOUT   DD SYSOUT=*,
//             DCB=(RECFM=FB,LRECL=80)
//SYSIN     DD *
  OPTION COPY
  INREC  IFTHEN=(WHEN=GROUP,BEGIN=(11,13,CH,NE,C'     '),
                 PUSH=(30:11,14))

  OUTREC BUILD=(1:1,10,30,14,80:X)


Output

Code:

DTL HICN1 CONTRACT1 PBP1
PRM HICN1 CONTRACT1 PBP1
SUP HICN1 CONTRACT1 PBP1
SUP HICN1 CONTRACT1 PBP1
DTL HICN2 CONTRACT2 PBP2
PRM HICN2 CONTRACT2 PBP2
SUP HICN2 CONTRACT2 PBP2
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7254

PostPosted: Wed Mar 05, 2014 5:07 pm    Post subject: Reply to: ICETOOL/Joinkeys Solution for Group By Replication
Reply with quote

Code:
  OPTION COPY
  INREC  IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'DTL'),
                 PUSH=(11:11,14))


PUSH is like OVERLAY.

For the record defining the GROUP, the information being PUSHed can be PUSHed over itself when it is to be located in that position in all records. No need for BUILD here.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Wed Mar 05, 2014 7:48 pm    Post subject:
Reply with quote

Thanks a lot to both of you! The GROUP,BEGIN clause worked great!
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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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