Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Read multiple VSAM files in loop with partial key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Read multiple VSAM files in loop with partial key
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

Site Director


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

PostPosted: Mon Nov 08, 2010 10:57 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Mon Nov 08, 2010 11:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us