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
 

 

Access VSAM File Information in COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sinusam

New User


Joined: 06 Jan 2004
Posts: 18

PostPosted: Tue Apr 12, 2005 9:35 pm    Post subject: Access VSAM File Information in COBOL program
Reply with quote

Hello All, icon_biggrin.gif

Subject:-
I need to retrieve information on any VSAM file in my COBOL Program.


Description:-

In a COBOL program, I need the following information, when a filename is given.

    Type ( KSDS / ESDS / RRDS / LDS )
    Key Length
    Key Start Position
    Record Length
    Control Interval Size
    etc....


In TSO, we have LISTC or IDCAMs utility for this.
or we can use FileAid to get these type of information.

My problem is, I need those values in COBOL WORKING STORAGE variables.

I am declaring (i mean the FD entries and SELECT Clause) the file Dynamically. I got all these information about ESDS files from the MVS Control Blocks. But I failed for KSDS and RRDS.

Can I call IDCAMs or LISTC from COBOL and produce these results in working storage ?
or
Is there any other method / utility for this ?
or
Can I access VSAM Catalogue files (MASTER CATALOGUE, USER CATALOGUE) for this ?
or
If you have any information of the physical representation of VSAM Catalogue files, please inform


You can reply to this post, if you haven't done this before too. You may share any of your suggestions or ideas in this regard. icon_confused.gif

If I should rephrase this post icon_rolleyes.gif , please PM.


Thanks in Advance..

Sinu Sam,
Trivandrum
Back to top
View user's profile Send private message

rajusnair

New User


Joined: 12 Apr 2005
Posts: 1

PostPosted: Tue Apr 12, 2005 10:13 pm    Post subject: Re: Access VSAM File Information in COBOL program
Reply with quote

icon_biggrin.gif
Dear Sinu,

Pl try calling IDCAMS from COBOL and Pl. let me know if you have any problems

regards
Raju
Back to top
View user's profile Send private message
somasundaran_k

Active User


Joined: 03 Jun 2003
Posts: 134

PostPosted: Tue Apr 12, 2005 10:20 pm    Post subject:
Reply with quote

Sinu
I think(never tried) you can invoke IDCAMS from COBOL. Check this link
http://www.naspa.com/PDF/2000/0100%20TS%20PDFs/T0001006.pdf

Let us know whether it worked

hth
-Som
Back to top
View user's profile Send private message
sinusam

New User


Joined: 06 Jan 2004
Posts: 18

PostPosted: Tue Apr 12, 2005 11:09 pm    Post subject: Re: Access VSAM File Information in COBOL program
Reply with quote

Dear Raju and Somu,

Thanks for your Quick reply. Let me investigate on this.

C u soon.

regards,
Sinu
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Apr 13, 2005 1:27 am    Post subject:
Reply with quote

You can definitely call IDCAMS, as well as TSO commands, REXX exec's, CLIST's, ISPF dialogs, and I'd be willing to bet that FileAid has programming API's that you can call.
Back to top
View user's profile Send private message
sinusam

New User


Joined: 06 Jan 2004
Posts: 18

PostPosted: Tue May 03, 2005 2:17 pm    Post subject: Re: Access VSAM File Information in COBOL program
Reply with quote

Hi all,

I was able to call IDCAMS from a COBOL program, as described in the PDF File (from naspa.com). Initially I got S0C4 Abend, because I missed DATA(24) Compiler Option. Later I succeeded and was able to store the output in a file specified in SYSPRINT. That PDF file explains the method in detail.

I tried to execute a TSO Command as superk informed. I searched the net and got details of IKJEFTSR utility (TSO Service Routine). But I got error code 20 (which tells, u should run program in a TSO/E environment). Do you have any other method for this? I've posted it as a new topic in http://ibmmainframes.com/post-7843.html&highlight=#7843.

Thank you very much for all your effort.

Regards,
Sinu
Back to top
View user's profile Send private message
suny_sn1

New User


Joined: 26 Jun 2007
Posts: 6
Location: India

PostPosted: Mon Aug 13, 2007 11:43 pm    Post subject: Calling IDCAMS from Cobol
Reply with quote

Hi,
In the discussion http://ibmmainframes.com/viewtopic.php?t=2164&highlight=idcams it says that it is possible to call idcmas from cobol but the link that is being provided is broken.
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: Tue Aug 14, 2007 12:18 am    Post subject:
Reply with quote

Hello Suny and welcome to the forums,

Please do not reply to topics that are very old with no recent activity. The topic you replied to last last received a repy over 2 years ago. That is probably why the link no linger works.

Please start a new topic for your question.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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