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

Accessing VSAM file thru Stored procedure written in COBOL


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

New User


Joined: 15 Apr 2008
Posts: 5
Location: Airoli

PostPosted: Thu Mar 03, 2011 12:17 pm
Reply with quote

I am writing Stored procedure in COBOL. This will be called from webservice. I want to access VSAM file in stored procedure and pass data to webservice. Can anyoe please help if it is possible to access VSAM file in SP? If yes, please can you guide me thru this?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Mar 03, 2011 1:58 pm
Reply with quote

I never did it but my guess :
Just like in any cobol program, just make sure the DD is in the JCL of the WLM-environment.
You would need to open and close the VSAM each call to the SP, there would be RACF authorization stuff to handle, ...
It just might be easier to convert it to a DB2 table

sg247604 - Stored Procedure Through the CALL and beyond wrote:
For example, you may have a CICS application that accesses data from a VSAM file. If you
are developing DB2 applications that need to access data from that VSAM file, and you do not
have the resources to migrate that data from VSAM to DB2 at this time, you can access the
VSAM file from a DB2 stored procedure using the external CICS interface or DB2-supplied
stored procedure DSNACICS to execute an existing CICS program. You can also access the
VSAM file from within your stored procedure, but that would require you to define a DD
statement for that file within your application environment. Then, if you alter the stored
procedure to execute in a different environment, you need to change the JCL for the old and
new environments.
Back to top
View user's profile Send private message
pratham

New User


Joined: 15 Apr 2008
Posts: 5
Location: Airoli

PostPosted: Thu Mar 03, 2011 2:16 pm
Reply with quote

Thanks a lot. I am new to Stored Procedure. Can you please provide me with any study material or any link where i can follow steps to do as you mentioned? It will really help.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Thu Mar 03, 2011 3:06 pm
Reply with quote

Typical example of first picking the tool and then do any job with it.

You don't pick a hammer because you ever borrowed a hammer to put a nail in and then ask how to use a hammer for putting in a screw.
Maybe you should use a screwdriver? In this case cics transaction gateway or something.

If you can't find study material by yourself, you shouldn't be in IT.

(Does it show I'm in a bad mood today ?)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Mar 03, 2011 3:14 pm
Reply with quote

expressing proper concepts is not a symptom of bad mood...
just of good judgement icon_biggrin.gif

looking and searching for documentation is something pretty unknown around here!
Back to top
View user's profile Send private message
pratham

New User


Joined: 15 Apr 2008
Posts: 5
Location: Airoli

PostPosted: Thu Mar 03, 2011 3:16 pm
Reply with quote

Thanks a lot for your valuable information.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Thu Mar 03, 2011 5:27 pm
Reply with quote

Pratham,

In google type this without quotes"Accessing non-DB2 resources in your stored procedure"

Regards,
Sushanth
Back to top
View user's profile Send private message
pratham

New User


Joined: 15 Apr 2008
Posts: 5
Location: Airoli

PostPosted: Fri Mar 04, 2011 10:09 am
Reply with quote

Hi,
I have got solution and related documents. Thanks to all of you.
Back to top
View user's profile Send private message
shivaganeshaa

New User


Joined: 11 Aug 2005
Posts: 14
Location: chennai

PostPosted: Fri Mar 23, 2012 3:08 am
Reply with quote

sushanth bobby

Inofrmation you provided was helpful
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top