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: 1537
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: 7315

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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm


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