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
 

 

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: 8593
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: 4648
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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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