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

Getting the GDG version used by a COBOL program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Jul 17, 2007 10:57 pm
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

Global Moderator


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

PostPosted: Tue Jul 17, 2007 10:57 pm
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
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: 2358
Location: Israel

PostPosted: Wed Jul 18, 2007 10:55 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top