IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JOINKEY conditional formatting


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venkatprasana

New User


Joined: 21 Oct 2013
Posts: 5
Location: india

PostPosted: Thu May 22, 2014 4:27 pm
Reply with quote

Please find the below requirement:

file 1 :

----+----1----+----2----+----3
*****************************
HEADER0000001
PHSL052014CC018AAAAAAAA
HEADER0000002
PHSL052014NC012BBBBBBBB
PHSL052014NC012AAAAAAAA
HEADER0000003
PHSL052014CC001CCCCCCCC
HEADER0000004
PHSL052014CCO50AAAAAAAA
HEADER0000005
PHSL052014NCO50CCCCCCCC
PHSL052014NCO50AAAAAAAA

File 2 :


----+----1----+----2
********************
11111~AAAAAAAA
22222~BBBBBBBB
33333~BBBBBBBB


Expected output :

----+----1----+----2----+----3----+----4
***************************** Top of Dat
HEADER0000001
PHSL052014CC018AAAAAAAA 11111
HEADER0000002
PHSL052014NC012BBBBBBBB 22222
PHSL052014NC012AAAAAAAA 11111
HEADER0000003
PHSL052014CC001CCCCCCCC 33333
HEADER0000004
PHSL052014CCO50AAAAAAAA 11111
HEADER0000005
PHSL052014NCO50CCCCCCCC 33333
PHSL052014NCO50AAAAAAAA 11111

Requirement :

The header records in the input file - 1 needs to be retained.
For the detail records in file -1 position 19,8 (AAAAAAAA) is matched with the position 7,8 in input file-2 and if they mathced the value from file-2 position 1,5 will be put in the output file by appending.

We used below joinkeys :

//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(19,10,A)
JOINKEYS FILE=F2,FIELDS=(7,10,A)
JOIN UNPAIRED F1,F2
REFORMAT FIELDS=(F1:1,30,F2:01,5)
SORT FIELDS=COPY


But the input file-1 records get sorted and in the output all the header records are first printed and details records are next :

HEADER0000001
HEADER0000002
HEADER0000003
HEADER0000004
HEADER0000005
PHSL052014CCO50AAAAAAAA 11111
PHSL052014CC001CCCCCCCC 33333
PHSL052014CC018AAAAAAAA 11111
PHSL052014NCO50AAAAAAAA 11111
PHSL052014NCO50CCCCCCCC 33333
PHSL052014NC012AAAAAAAA 11111
PHSL052014NC012BBBBBBBB 22222

Is the requirement possible with joinkey is sort or do we need to use some other option.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Thu May 22, 2014 5:42 pm
Reply with quote

1.Add Sequence number for F1 using JNF1CNTL
2.Do the joinkey and while reformat add sequence number
3.Also you dont need F1,F2 just F1 ONLY will do
4.sort based on sequence number
5.Use Outrec to fetch the needed data
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu May 22, 2014 6:46 pm
Reply with quote

Are you sure that is the output you get?

Tell us about the file 2. How big is it? How often does it change? How often will the step run?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Rexx formatting CLIST & REXX 2
No new posts Conditional EATTR in MFS ? IMS DB/DC 0
No new posts Conditional replace values in output ... DFSORT/ICETOOL 3
No new posts ICETOOL with JOINKEY for Big record l... DFSORT/ICETOOL 12
Search our Forums:

Back to Top