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

Access VSAM File Information in COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
Reply with quote

Sinu
I think(never tried) you can invoke IDCAMS from COBOL. Check this link
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
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

Global Moderator


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

PostPosted: Wed Apr 13, 2005 1:27 am
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
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
Reply with quote

Hi,
In the discussion 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

Moderator Emeritus


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

PostPosted: Tue Aug 14, 2007 12:18 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
Search our Forums:

Back to Top