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
 

 

Joinkeys - Efficient solution for unpaired F1 required

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

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Thu Sep 06, 2012 11:15 am    Post subject: Joinkeys - Efficient solution for unpaired F1 required
Reply with quote

Hi,
I have two files, already sorted. I need unpaired records from File1 and paired records.

For unpaired records, I don't always need 'blanks' for fields from file2. Because some fields from file 2 can be alphanumeric and some fields can have packed decimal values, the final output file will be used as an input to a COBOL program. So I am using FILL to override blanks with '$' for such cases and I am using OUTREC IFTHEN and HIT=NEXT to replace $ values with blanks or zeroes, whereever applicable .

Below is the code I used. Still I have a feeling that there could be a better solution in DFSORT to do this. Could any one provide your suggestion to improve the below code.

Code:

JOINKEYS F1=IN1,FIELDS=(1,16,A),SORTED,NOSEQCK                 
JOINKEYS F2=IN2,FIELDS=(1,16,A),SORTED,NOSEQCK                 
JOIN UNPAIRED,F1                                               
REFORMAT FIELDS=(F1:1,19,34,4,                                 
                    38,8,54,6,                                 
                    84,16,                                     
                 F2:72,4,77,2,80,2,                           
                    82,8,                                     
                    90,4,95,2,98,2,                           
                    100,20,                                   
                    122,8,                                     
                    131,6,                                     
                    159,22,                                   
                 F1:109,22,                                   
                 F2:181,31,                                   
                 F1:100,9,                                     
                 F2:221,9,232,2,                               
                 F1:131,2,                                     
                 F2:234,2,71,1,                               
                 F1:20,6,46,8,60,8,26,8,68,16,                 
                   F2:38,6,29,1),FILL=C'$'           
  SORT FIELDS=COPY                                   
  INREC BUILD=(C'23',1,19,X,C'00',20,4,X,24,14,X,   
                 38,16,X,                           
                 54,44,C'00',                       
                 98,114,2X,                         
                 212,46,X'000000000000000C',         
                 258,6,C'0',                         
                 264,1,C'01010001',                 
                 X'000000000000000C',               
                 X'000000000000000C')               
  OUTREC IFTHEN=(WHEN=(62,8,CH,EQ,C'$$$$$$$$'),     
                 OVERLAY=(62:8X),HIT=NEXT),         
         IFTHEN=(WHEN=(70,8,CH,EQ,C'$$$$$$$$'),     
                 OVERLAY=(70:X'000000000000000C'))   
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu Sep 06, 2012 12:32 pm    Post subject: Reply to: Joinkeys - Efficient solution for unpaired F1 requ
Reply with quote

In the REFORMAT record, use the ? marker.

If this has a value of "1", then you have an unpaired-F1 and you can do all your intiialisation in one IFTHEN.
Back to top
View user's profile Send private message
senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Thu Sep 06, 2012 1:12 pm    Post subject: Reply to: Joinkeys - Efficient solution for unpaired F1 requ
Reply with quote

Thanks Bill, Now I got what I want.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu Sep 06, 2012 1:58 pm    Post subject: Reply to: Joinkeys - Efficient solution for unpaired F1 requ
Reply with quote

Thanks for letting us know.

The FILL "technique" for testing for the non-presence of a record on F1 or F2 is never needed for DFSORT, as the ? in the REFORMAT record answers the question with certainty so you don't worry about whether the FILL value can genuinely exist somewhere in the record.
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 Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Joinkeys operation betwen VB and FB file Susanta SYNCSORT 4 Sun Sep 25, 2016 9:49 pm


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