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

Joinkeys - Efficient solution for unpaired F1 required


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Sep 06, 2012 12:32 pm
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
Reply with quote

Thanks Bill, Now I got what I want.
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 Sep 06, 2012 1:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts SDSF like solution in EJES (store com... All Other Mainframe Topics 4
No new posts how to keep unpaired records with REPRO. JCL & VSAM 9
Search our Forums:

Back to Top