|
View previous topic :: View next topic
|
| Author |
Message |
madmartinsonxx
New User

Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
madmartinsonxx
New User

Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| 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 |
|
 |
madmartinsonxx
New User

Joined: 10 Dec 2010 Posts: 96 Location: Massachusetts
|
|
|
|
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 |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| 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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|