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)
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
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
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.
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.