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

Stored Procedure accessing VSAM


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yogesh suryawanshi

New User


Joined: 04 Mar 2013
Posts: 16
Location: India

PostPosted: Wed Mar 18, 2015 6:14 pm
Reply with quote

Hi,

I want to access VSAM File in a Stored Procedure. It is completely new to me. I searched on net and gone through the manuals available on this site. Below is what my understanding.
1. I need to write External Stored Procedure in COBOL .
2. This prcedure should be registered with WLM Env and RACF Env.

Can somebody please provide sample code ? I have difficulty in understanding if I define VSAM file in Stored Procedure written in cobol how will it access exact VSAM File which I need to read. Like in JCL we provide DD Statement . How does it works here.

If you can provide sample code will be great help in understanding this.
Thank you .
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Mar 19, 2015 3:55 am
Reply with quote

Hope these links would help you and if not then please let us know someone would answer more specifically.

ibmmainframes.com/about53662.html
ibmmainframes.com/about46201.html
Back to top
View user's profile Send private message
yogesh suryawanshi

New User


Joined: 04 Mar 2013
Posts: 16
Location: India

PostPosted: Thu Mar 19, 2015 8:51 pm
Reply with quote

Rohit,

Thanks for sharing these links. I have already gone through these link before I post my query yesterday. I also gone through DB2 Manual and documents available on internet sources. But none of them has provided atleast pseudo code which shows how to define file in stored procedure.

I need more specific details or example which shows how a stored procedure is defined using WLM Parameter which has JCL DD Name.
Also want to know if it required a JCL Job to run in batch environment ?

Any help you can provide will be great help. Thank you.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Mar 19, 2015 9:05 pm
Reply with quote

it.toolbox.com/blogs/db2zos/the-magic-triangle-stored-procedures-wlm-and-wlm-started-task-33433
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Mar 19, 2015 9:12 pm
Reply with quote

Yogesh, Are you a DBA? if not then that is not you supposed to do , please redirect this to DBA's.


if you are accessing VSAM files you need a JCL DD statement in the stored procedures address space ,JCL procedure for every file that the stored procedure accesses.

check out more here...

www.redbooks.ibm.com/redbooks/pdfs/sg245485.pdf
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Fri Mar 20, 2015 12:13 am
Reply with quote

anyone one can write a cobol stored procedure, you only need the DBA to setup the access for the stored procedure.
Back to top
View user's profile Send private message
yogesh suryawanshi

New User


Joined: 04 Mar 2013
Posts: 16
Location: India

PostPosted: Fri Mar 20, 2015 8:51 am
Reply with quote

Thanks for the information. It helped to understand. I am already discussing with DBA on this. And DBA said there is no way to make change in WLM Environment. So to talk to him again can you please tell me what steps that has to be followed to get this done. Is it like :
1. Write Stored Procedure in COBOL which access the file (DD name etc)
2. Ask DBA to set up WLM Environment for the Stored Procedures
3. Get Stored Procedure registered in DB2.

Please let m eknow what steps to be followed.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Tue Mar 24, 2015 2:47 am
Reply with quote

Add a DD name of the file (WLM job) that is being referenced in SP.
Back to top
View user's profile Send private message
yogesh suryawanshi

New User


Joined: 04 Mar 2013
Posts: 16
Location: India

PostPosted: Tue Mar 24, 2015 9:28 am
Reply with quote

Thanks Rohit for confirming !!!
On this particular topic there lot of links and documents available but none of them has specifically mentioned what has to be changed and where.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Mar 25, 2015 2:53 am
Reply with quote

Welcome Yogesh and All the best!!
Usually, these are DBA's activity icon_biggrin.gif and please post us back the steps when you know.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top