IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Read multiple VSAM files in loop with partial key


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Mon Nov 08, 2010 10:35 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 08, 2010 10:57 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Nov 08, 2010 11:29 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top