View previous topic :: View next topic
|
Author |
Message |
ksouren007
New User
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
|
|
|
|
Hi, I have the below requirement as a database query which I have to convert in a COBOL VSAM read program.
PolicyMaster INNER JOIN ReinsuranceMaster ON
(PolicyMaster.PMEX_CO = dbo23_ReinsuranceMaster.RMST_WRITING_CO
AND PolicyMaster.PMEX_PLC = ReinsuranceMaster.RMST_PLC
AND PolicyMaster.PMEX_POLICY = ReinsuranceMaster.RMST_POLICY
AND PolicyMaster.PMEX_COV = ReinsuranceMaster.RMST_COV)
INNER JOIN Cession ON
(ReinsuranceMaster.RMST_CO = Cession.CESS_CO
AND ReinsuranceMaster.RMST_PLC = Cession.CESS_PLC
AND ReinsuranceMaster.RMST_POLICY = Cession.CESS_POLICY
AND ReinsuranceMaster.RMST_COV = Cession.CESS_COV)
LEFT JOIN Treaty ON
(Cession.CESS_TREATY_NO = Treaty.TRTY_TREATY_NO)
Here,
1. PolicyMaster is a flat file and satisfies all key values to Reinsurancemaster. So I get a direct hit and get one record.
2. Next I got read the Cession file which has multiple record for one Reinsurance record.
Keys for the Cession file are like below
CESS_CO
CESS_PLC
CESS_POLICY
CESS_COV
CESS_ID
So i get first four key values and last one i will leave blank. Now I will read the Cession file till all records for a Reinsurance policy is found.
3. If found I will read the treaty file whose key structure is like below
Treaty_CO
Treaty-NO
There will be only one record in this file for each CESS record.
If all condition matches then i will write the output file else continue.
Now,
1. I am not understanding how to convert a LEFT join into a VSAM read. 2.
2. Also If someone could help me out by advicing on how to perform the loops(just the structural approach like start, perform until) for the above requirement it shall be a great help to me.
Thanks in Advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Post some sample data from all of the files (showing the keys) and then show what you want your process to do with the sample data (i.e. the output).
Explain how the "rules" apply to the sample data. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
once you have done that - PROPERLY and COMPLETELY
you may not need our help.
but, there is more than enough help here to be had. |
|
Back to top |
|
|
|