Need to create File C with layout identical to File B where INCURRED-DT falls between BGN-INCURRED-DT and END-INCURRED-DT where the CONTRACT-IDs match between files.
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Mar 30, 2020 3:37 pm Post subject:
Hi Kolusu,
FileA has approx 1000 records and FileB about 1Million records. File B is like the transaction data so each Contract ID Patend Cd combo can have multiple records in File B so the date range is the filter.
The Key is composite of Contract ID and Patient Code. I had overlooked patient code in original post.
Need to create File C with layout identical to File B where INCURRED-DT falls between BGN-INCURRED-DT and END-INCURRED-DT where the CONTRACT-IDs match between files.
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Mar 30, 2020 3:50 pm Post subject:
Sample Data .... the layout in original post was made up for ease the actual spacing and lengths may vary....
File A
Code:
R00113078 A 06/27/2017 04/09/2019
R00436436 C 01/23/2015 04/08/2016
File B
Code:
R00113078 A 02/22/2015
R00113078 A 01/09/2016
R00113078 A 06/28/2017
R00113078 A 07/22/2018
R00436436 C 01/12/2014
R00436436 C 11/12/2015
R00436436 C 12/12/2015
R00436436 C 03/27/2016
File C
Code:
R00113078 A 06/28/2017
R00113078 A 07/22/2018
R00436436 C 11/12/2015
R00436436 C 12/12/2015
R00436436 C 03/27/2016
For INB file, we build a record using JNF2CNTL with only fields that are required which are
Code:
Contract-id PIC X(09)
Patient-cd PIC X(01)
Begin-date PIC 9(08) as CCYYMMDD
Filler PIC X.
End-date PIC 9(08) as CCYYMMDD
One we have the matched records now, we perform 2 calculations.
1. Incur-date minus Begin-date. This should be a positive value if the incur-date >= begin-date
2. End-date minus Incur-date. This should be positive if the incur-date <= End date
Now using OUTFIL we check for date difference >=0 and write out the first 80 bytes that we need
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//INA DD *
----+----1----+----2----+----3----+----4----+----5----+----6--
R00113078 A 02/22/2015
R00113078 A 01/09/2016
R00113078 A 06/28/2017
R00113078 A 07/22/2018
R00436436 C 01/12/2014
R00436436 C 11/12/2015
R00436436 C 12/12/2015
R00436436 C 03/27/2016
//INB DD *
R00113078 A 06/27/201704/09/2019
R00436436 C 01/23/201504/08/2016
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=INA,FIELDS=(01,09,A, # Contract-id
15,01,A) # Patient-cd
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Mar 30, 2020 10:12 pm Post subject:
Hi Kolusu,
My sincere apologies for the less than ideal stating of requirements...
Ran the job with positions changed per what I understood/guessed but it did not pair any records.
That must be owing to me not quite following from the INREC OVERLAY part onwards ... what are positions 099, 110 and 120 ?
Am now posting the actual layouts of both FILEA and FILEB because am unable to follow my apologies for same and getting no paired records and hence nothing in output.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Mar 30, 2020 11:39 pm Post subject:
Vini,
You have been on this board for more than a decade and you should by now know the rules or how to post a question. You are just wasting my time as well as your time.
Your rebuilt INB using INREC in JNF2CNTL so your patient id is now at position 10 and not at position 17. Secondly on the main task INREC you did not change the positions of INCUR date. Luckily the JOIN did not find any matching records and you never got to the INREC part of it.
Here are the updated control cards. I also added a check for invalid dates. You really need to understand the job. One way to understand the job is removing the OUTFIL statement and check the results. it will show you how the dates are added and how the date difference is calculated.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum