BCWilkenson
Programmer
I am using a pared down version of RUNINFO to dynamically get the program ID from the control blocks. It works for regular batch programs but not for DB2 programs using the TSO Call Attach Facility(returns a blank). I suspect setting the address X”0000021C” is the reason. Does anyone know what I should use when using TSO to call DB2 programs?
We are using IKJEFT01
PP 5655-S71 IBM Enterprise COBOL for z/OS 4.2.0
Here is my version of the program.
CBL LIST,NOOFF
IDENTIFICATION DIVISION.
PROGRAM-ID. RUNINFO.
AUTHOR. JACK SLEIGHT.
ENVIRONMENT DIVISION.
****************************************************************
* DISPLAYS THE FOLLOWING RUN INFO FOR THE CALLING PROGRAM: *
* *
* * PGM/JOB/JOBSTEP/PROCSTEP NAMES *
* * ENTRY/LOAD/END POINTS AND LENGTH OF PROGRAM *
* *
* FOR COBOL II PROGRAMS ALSO DISPLAYS 4 BYTES OF HEX INDICAT- *
* ORS SHOWING THE COMPILE OPTIONS SELECTED AT COMPILE TIME. *
****************************************************************
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
DATA DIVISION.
FILE SECTION.
****************************************************************
WORKING-STORAGE SECTION.
****************************************************************
01 WHEN-COMPILED-WORK.
05 COMPILE-DATE PIC X(08) VALUE 'MM/DD/YY'.
05 COMPILE-TIME PIC X(08) VALUE 'HH.MM.SS'.
01 WS-TCB-ADDR-01.
10 WS-TCB-ADDR POINTER.
01 WS-DISPLAY-FIELDS.
10 WS-PN-DISPLAY PIC X(008).
/
****************************************************************
LINKAGE SECTION.
****************************************************************
01 LK-TCB-ADDR POINTER.
*--------------------------------------------------------------
*===> T A S K C O N T R O L B L O C K
*--------------------------------------------------------------
01 LK-TCB.
10 FILLER PIC X(012).
10 LK-TIOT-ADDR POINTER.
10 FILLER PIC X(028).
10 LK-LAST-CDE-ADDR POINTER.
*--------------------------------------------------------------
*===> C O N T E N T S D I R E C T O R Y E N T R Y
*--------------------------------------------------------------
01 LK-CDE.
10 LK-PREV-CDE-ADDR POINTER.
10 FILLER PIC X(004).
10 LK-PGM-NAME PIC X(008).
10 LK-EP-ADDR PIC X(004).
10 LK-EXTENT-LST-ADDR POINTER.
****************************************************************
PROCEDURE DIVISION.
****************************************************************
000-MAINLINE.
*--------------------------------------------------------------
*===> ESTABLISH ADDRESSABILITY FOR TIOT
*--------------------------------------------------------------
MOVE X"0000021C" TO WS-TCB-ADDR-01
SET ADDRESS OF LK-TCB-ADDR TO WS-TCB-ADDR
SET ADDRESS OF LK-TCB TO LK-TCB-ADDR
SET ADDRESS OF LK-CDE TO LK-LAST-CDE-ADDR
PERFORM WITH TEST BEFORE UNTIL LK-PREV-CDE-ADDR = NULLS
SET ADDRESS OF LK-CDE TO LK-PREV-CDE-ADDR
END-PERFORM
MOVE LK-PGM-NAME TO WS-PN-DISPLAY
DISPLAY " "
MOVE WHEN-COMPILED TO WHEN-COMPILED-WORK
DISPLAY WS-PN-DISPLAY
' COMPILE DATE/TIME ' COMPILE-DATE
' - ' COMPILE-TIME ' **'
DISPLAY ALL SPACES.
****************************************************************
GOBACK
.
Thanks in advance
Brian
We are using IKJEFT01
PP 5655-S71 IBM Enterprise COBOL for z/OS 4.2.0
Here is my version of the program.
CBL LIST,NOOFF
IDENTIFICATION DIVISION.
PROGRAM-ID. RUNINFO.
AUTHOR. JACK SLEIGHT.
ENVIRONMENT DIVISION.
****************************************************************
* DISPLAYS THE FOLLOWING RUN INFO FOR THE CALLING PROGRAM: *
* *
* * PGM/JOB/JOBSTEP/PROCSTEP NAMES *
* * ENTRY/LOAD/END POINTS AND LENGTH OF PROGRAM *
* *
* FOR COBOL II PROGRAMS ALSO DISPLAYS 4 BYTES OF HEX INDICAT- *
* ORS SHOWING THE COMPILE OPTIONS SELECTED AT COMPILE TIME. *
****************************************************************
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
DATA DIVISION.
FILE SECTION.
****************************************************************
WORKING-STORAGE SECTION.
****************************************************************
01 WHEN-COMPILED-WORK.
05 COMPILE-DATE PIC X(08) VALUE 'MM/DD/YY'.
05 COMPILE-TIME PIC X(08) VALUE 'HH.MM.SS'.
01 WS-TCB-ADDR-01.
10 WS-TCB-ADDR POINTER.
01 WS-DISPLAY-FIELDS.
10 WS-PN-DISPLAY PIC X(008).
/
****************************************************************
LINKAGE SECTION.
****************************************************************
01 LK-TCB-ADDR POINTER.
*--------------------------------------------------------------
*===> T A S K C O N T R O L B L O C K
*--------------------------------------------------------------
01 LK-TCB.
10 FILLER PIC X(012).
10 LK-TIOT-ADDR POINTER.
10 FILLER PIC X(028).
10 LK-LAST-CDE-ADDR POINTER.
*--------------------------------------------------------------
*===> C O N T E N T S D I R E C T O R Y E N T R Y
*--------------------------------------------------------------
01 LK-CDE.
10 LK-PREV-CDE-ADDR POINTER.
10 FILLER PIC X(004).
10 LK-PGM-NAME PIC X(008).
10 LK-EP-ADDR PIC X(004).
10 LK-EXTENT-LST-ADDR POINTER.
****************************************************************
PROCEDURE DIVISION.
****************************************************************
000-MAINLINE.
*--------------------------------------------------------------
*===> ESTABLISH ADDRESSABILITY FOR TIOT
*--------------------------------------------------------------
MOVE X"0000021C" TO WS-TCB-ADDR-01
SET ADDRESS OF LK-TCB-ADDR TO WS-TCB-ADDR
SET ADDRESS OF LK-TCB TO LK-TCB-ADDR
SET ADDRESS OF LK-CDE TO LK-LAST-CDE-ADDR
PERFORM WITH TEST BEFORE UNTIL LK-PREV-CDE-ADDR = NULLS
SET ADDRESS OF LK-CDE TO LK-PREV-CDE-ADDR
END-PERFORM
MOVE LK-PGM-NAME TO WS-PN-DISPLAY
DISPLAY " "
MOVE WHEN-COMPILED TO WHEN-COMPILED-WORK
DISPLAY WS-PN-DISPLAY
' COMPILE DATE/TIME ' COMPILE-DATE
' - ' COMPILE-TIME ' **'
DISPLAY ALL SPACES.
****************************************************************
GOBACK
.
Thanks in advance
Brian