View previous topic :: View next topic
|
Author |
Message |
ranjanp
New User
Joined: 02 May 2006 Posts: 25
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Earl
Active User
Joined: 17 Jun 2007 Posts: 148 Location: oklahoma
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
If you decide to chase MVS data areas, the relative GDG number is placed in JFCBELNM.
O. |
|
Back to top |
|
|
|