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
 

 

Join Paired / Unpaired ? one set of keys data from 2 files

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

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 8:58 pm    Post subject: Join Paired / Unpaired ? one set of keys data from 2 files
Reply with quote

Hi,
I have a Parmlib (80 bytes) that holds keys that are in an 319 byte data set at posiition 35 and can be 20 bytes long. This parmlib member gets updated frequently so the requirement changes and I have to run a report which I have been asked to overhaul.

Code:

 ---3----+----4--
@....06 20870709
3615  0000000  0


my task is to find that key and get the order number at 24,04,PD from F1.

Then from the order file (F2) 45,7,ZD LRECL 1034 bytes:
Code:

+====4==>-+----5----+---
        ACA0009717CAN932
        ACA0038545CAN959
        ACA0039495CAN959
        ACA0575635CANND8
        ACA0575636CANNF3
        ACA0575637CAN959


find the F1 order number and write out the F1 data and the F2 data as one record with Reformat probably.
Only have the starting key for this req. I checked posts for UNPAIRED and could not identify a workable solution that I could plagarize.
Thanks again.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Fri May 04, 2012 9:42 pm    Post subject: Reply to: Join Paired / Unpaired ? one set of keys data from
Reply with quote

So you have three files?

First, an 80-byte record where there is plain text "numbers". One, or more than one?

Then you use that to get the order number on the "first file". Then you get the matches against order number on the 2nd file, outputting a comined record from first and second files.

Where does the "unpaired" come into it?

Are the files all fixed-length records?

Can there be duplicates anywhere?
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 10:07 pm    Post subject:
Reply with quote

yes, 3 files.
first file ( the numbers) ,no duplicates there and more than one.

yes, get matches on second file from the numbers file ( could be duplicates in second file).

Yes, use order number from second file to get order number ( no duplicates).

All files are FB and output is combined 'second' and 'third' full lrecl.

Unpaired / Paired was how i was thinking about trying to get done. Wasn't sure how to work that though.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 04, 2012 10:34 pm    Post subject:
Reply with quote

madmartinsonxx wrote:
yes, 3 files.
first file ( the numbers) ,no duplicates there and more than one.

yes, get matches on second file from the numbers file ( could be duplicates in second file).

Yes, use order number from second file to get order number ( no duplicates).


All files are FB and output is combined 'second' and 'third' full lrecl.

Unpaired / Paired was how i was thinking about trying to get done. Wasn't sure how to work that though.


madmartinsonxx,

You really confuse people with your requirements. I am not sure as to why you complicate simple requests.

Lets start over again. So far I got this . Answer all the fields that have ????

Code:

FILE-NAME   RECFM  LRECL       KEY AND REQUIREMENTS                     
                                                                       
PARMFILE     FB      80        20 BYTES IN POS 1                       
                                                                       
FILE-1       FB    ????        CHECK FOR PARMFILE VALUE IN POS 319     
                               IF EQUAL THEN USE THE VALUE AT POS 24   
                               FOR 4 BYTES IN PD FORMAT AS KEY.         
                               THIS WILL BE MATCHED TO ZD FORMAT KEY   
                               IN FILE-2 AT POS 45 FOR A LENGTH OF 7   
                                                                       
FILE-2       FB    1034        ZD KEY FOR LENGTH OF 7 AT POS 45         
                                                                       
OUTPUT       FB    ????        MATCHED RECORD FROM FILE-1 AND FILE-2 ??
                               UNMATCHED RECORDS FROM FILE-2 ??         
                               UNMATCHED RECORDS FROM FILE-1 ??         
Back to top
View user's profile Send private message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Fri May 04, 2012 11:06 pm    Post subject:
Reply with quote

FILE-1 FB ???? s/b 391

OUTPUT FB ???? s/b 1034 (order record)
MATCHED RECORD FROM FILE-1 AND FILE-2 ?? s/b 1034 (order record)

UNMATCHED RECORDS FROM FILE-2 ?? s/b discarded, bit bucket
UNMATCHED RECORDS FROM FILE-1 ?? s/b discarded, bit bucket
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 04, 2012 11:22 pm    Post subject:
Reply with quote

madmartinsonxx wrote:
FILE-1 FB ???? s/b 391

OUTPUT FB ???? s/b 1034 (order record)
MATCHED RECORD FROM FILE-1 AND FILE-2 ?? s/b 1034 (order record)

UNMATCHED RECORDS FROM FILE-2 ?? s/b discarded, bit bucket
UNMATCHED RECORDS FROM FILE-1 ?? s/b discarded, bit bucket


What is s/b discarded, bit bucket mean? S/B stands for Should be? Can we stick to plain English instead of Chat/Twitter language ? This job gets you all the matched records from the file with LRECL 1034



Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=Your 80 byte parmfile,DISP=SHR
//SORTOUT  DD DSN=&&SYM,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE)
//SYSIN    DD *                                             
  OPTION COPY,STOPAFT=1                                     
  OUTFIL BUILD=(C'PARMVAL,C''',1,20,C'''',80:X)             
//*                                                         
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SYMNAMES DD DSN=&&SYM,DISP=SHR                           
//INA      DD DSN=Your Input FB 1034 byte file,DISP=SHR
//INB      DD DSN=Your Input FB 391 byte file,DISP=SHR
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                             
  OPTION COPY                                               
  JOINKEYS F1=INA,FIELDS=(045,7,A)                         
  JOINKEYS F2=INB,FIELDS=(392,7,A)                         
  REFORMAT FIELDS=(F1:1,1034)
//*                             
//JNF2CNTL DD *                                             
  INCLUDE COND=(319,20,CH,EQ,PARMVAL)                       
  INREC OVERLAY=(392:24,4,PD,ZD,LENGTH=7)                   
  SUM FIELDS=NONE                                           
//*
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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