Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting the GDG version used by a COBOL program

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

New User


Joined: 02 May 2006
Posts: 25

PostPosted: Tue Jul 17, 2007 10:48 pm    Post subject: Getting the GDG version used by a COBOL program
Reply with quote

I have a job. It executes a COBOL program when submitted. Now we can see the version of GDG used in that particular run by looking into the SPOOL.

But is it possible to get this name in the COBOL code itself and write it in a output file i.e whenever the job runs the code itself will write e.g. XXXX.YYYYY.G00001V05 (or whichever version is picked up by the job) in the output file.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8620
Location: Back in jolly old England

PostPosted: Tue Jul 17, 2007 10:57 pm    Post subject:
Reply with quote

Yes it is possible, but it means that you need to chase MVS system control blocks. And by chasing them it is possible to alter them, which could have catastrophic effects on the whole system.

Why do you need to know the generation number ?

There are easier ways of doing this, usually batch REXX using SDSF being one of them, although you could code a COBOL or whatever program to invoke SDSF. This has been discussed to death in the forum.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Tue Jul 17, 2007 10:57 pm    Post subject: Re: Getting the GDG version used by a COBOL program
Reply with quote

How about this previous topic?
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Wed Jul 18, 2007 1:20 am    Post subject:
Reply with quote

in the old days, not sure if still true, name of dataset used to be at offset +44 out of the cobol FD after open.

FD GDG-FILE


PROCEDURE DIVISION.

OPEN GDG-FILE.

MOVE GDG-FILE(44:32) TO WS-AREA.
DISPLAY WS-AREA.


you could also code an assembler subroutine to get dataset name out of
the JFCB, and call that from your COBOL program.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jul 18, 2007 10:55 am    Post subject:
Reply with quote

If you decide to chase MVS data areas, the relative GDG number is placed in JFCBELNM.

O.
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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us