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
 

 

JOINKEY conditional formatting

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: JOINKEY conditional formatting
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

Moderator


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

PostPosted: Thu May 22, 2014 5:42 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu May 22, 2014 6:46 pm    Post subject: Reply to: JOINKEY conditional formatting
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    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 Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Syncsort Joinkey nartcr SYNCSORT 2 Thu Jun 02, 2016 3:46 am
No new posts Formatting data from Excel to mainframe kishpra JCL & VSAM 5 Fri Feb 19, 2016 7:12 pm
No new posts Formatting date in DB2 manugeorge2004 DB2 4 Thu Dec 03, 2015 3:18 am
No new posts Help needed in Conditional statement ... vinu78 DB2 5 Tue Sep 15, 2015 10:14 am


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