i want to get jobid,stepname,jobname,system symbols etc. in an enterprise pli program.
There´s no api for that, so i have to extract these information from control-blocks.
I´m looking for sample code.
if sombody is doing this in pl/1 already please post it here. thanks
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
To download/ view a .txt attachment, it is often necessary to right-click and Save Target As to the local hard drive. Trying to open in the browser often loses formatting and everything is run together.
What is incomplete or missing : all info on allocated datasets in JFCB, because I need to translate in PL/I the SWAREQ macro.
( If interested, tell me - I will pass when done ).
Cheers
Pierre
PS : this version ( which is an exercise version ) is not really documented , but is , I believe, selfspeaking.
Code:
PED827: PROC OPTIONS(MAIN);
/*-------------------------------------------------------------------*/
/* */
/* DESCRIP : TEST DATA AREAS FROM PED827 */
/* */
/* CREATION: PIERRE DEVILLERS DATE : SEPT 2005 */
/* */
/*-------------------------------------------------------------------*/
/* MODIF NAME DATE Change ref */
/*-------------------------------------------------------------------*/
/*-------------------------------------------------------------------*/
/* E N T R Y */
/*-------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/*- -*/
/*- H O U S E K E E P I N G -*/
/*- -*/
/*----------------------------------------------------------------*/
/*-----HOUSEKEEPING-----------------------------------------------*/
/*----------------------------------------------------------------*/
PUT SKIP LIST ('-----------------------------------------');
PUT SKIP LIST ('JESLEV - '||JESLEV||'-');
SELECT (JESLEV);
WHEN ( 'z/OS 1.9') JESNODE = JESN109;
WHEN ( 'z/OS 1.8') JESNODE = JESN108;
WHEN ( 'z/OS 1.7') JESNODE = JESN107;
WHEN ( 'z/OS 1.6'
, 'z/OS 1.5'
, 'z/OS 1.4') JESNODE = JESN106;
OTHERWISE;
END;
PUT SKIP LIST ('JESNODE- '||JESNODE||'-');
PUT SKIP LIST ('CPU NR - '||PCCA1||'-'
||PCCA2||'-'
||PCCA3||'-'
||PCCA4||'-'
||PCCA5||'-');
PUT SKIP LIST ('-----------------------------------------');
PUT SKIP LIST (' ');
PUT SKIP LIST ('ASUSERID - '||ASUSERID||'-');
PUT SKIP LIST ('PGMNAM2 - '||PGMNAM2||'-');
PUT SKIP LIST ('SYSNAM - '||SYSNAM||'-');
PUT SKIP LIST ('-----------------------------------------');
PUT SKIP LIST (' ');
PUT SKIP LIST ('-----memory allocation ------------------');
AVAIL = LDA.LDALIMIT - LDA.LDALOAL;
EAVAIL = LDA.LDAELIM - LDA.LDAELOAL;
PUT SKIP LIST ('LDALIMIT - '||LDALIMIT||'-');
PUT SKIP LIST ('LDALOAL - '||LDALOAL||'-');
PUT SKIP LIST ('LDAELIM - '||LDAELIM||'-');
PUT SKIP LIST ('LDAELOAL - '||LDAELOAL||'-');
PUT SKIP LIST ('AVAIL - '||AVAIL||'-');
PUT SKIP LIST ('EAVAIL - '||EAVAIL||'-');
PUT SKIP LIST ('-----------------------------------------');
PUT SKIP LIST (' ');
PUT SKIP LIST ('JOBNUME - '||JOBNUME||'-');
PUT SKIP LIST ('JOBNAME - '||F_TIOT1||'-');
PUT SKIP LIST ('STEPNAME - '||F_TIOT2||'-');
PUT SKIP LIST ('F_TIOT3 - '||F_TIOT3||'-');
PUT SKIP LIST ('-----------------------------------------');
PUT SKIP LIST (' ');
PUT SKIP LIST ('S1_TIOT 1- '||S1_TIOT(1)||'-');
PUT SKIP LIST ('S1_TIOT 2- '||S1_TIOT(2)||'-');
PUT SKIP LIST ('S1_TIOT 3- '||S1_TIOT(3)||'-');
PUT SKIP LIST ('S1_TIOT 4- '||S1_TIOT(4)||'-');
PUT SKIP LIST ('S1_TIOT 5- '||S1_TIOT(5)||'-');
PUT SKIP LIST ('S1_TIOT 6- '||S1_TIOT(6)||'-');
PUT SKIP LIST ('S1_TIOT 7- '||S1_TIOT(7)||'-');
PUT SKIP LIST ('-----------------------------------------');
/*-------------------------------------------------------------------*/
/* END OF PROGRAM */
/*-------------------------------------------------------------------*/
What is incomplete or missing : all info on allocated datasets in JFCB, because I need to translate in PL/I the SWAREQ macro.
( If interested, tell me - I will pass when done ).
i´d be interested :-)
(because FILEDDWORD only returns the first dataset in a concatenation)
i´ve found a gold-nugget (bpxwdyn)
if you loop through all allocation with 'INFO INRELNO' you get all allocations
this is the code in rexx (tested, displays all allocations)
drawback: if you want to return the dsn of a special ddname, you have to go through all allocations until you find it
Code:
/* REXX */
do i=1 by 1 until last<>0
IF BPXWDYN('info inrelno('i') inrtddn(dd) inrtdsn(ds)',
' inrtpath(path) inrtlst(last)')^=0 THEN INRTLST(LAST);
if path<>'' then
say left(dd,8) path
else
say left(dd,8) ds
end
this is a SAMPLE for calling bpxwdyn in pl/1 (not tested)
/* Some information in this structure is only avialable if
the jcl provides the DCB parameter or the associated
dataset is open
*/
DEFINE STRUCTURE
1 tDSInfo
, 2 DD CHAR(8) /* DD Name from JCL */
, 2 DSN CHAR(44) /* Datasetname */
, 2 MEMBER CHAR(8) /* Membername */
, 2 DISP CHAR(3) /* Disposition */
, 2 DSORG CHAR(2) /* Datasetorganisation */
, 2 RECFM CHAR(3) /* Recordformat */
, 2 LRECL BIN FIXED(15) /* Logical Recordlength */
, 2 RESERVED CHAR(442) /* For future use */
;
MyCallback:
PROC(pDSInfo,pUserData) RETURNS(BIT(1));
DCL pDSInfo PTR ;
DCL pUSerData PTR ;
DCL 1 DSInfo TYPE tDSInfo BASED(pDSInfo) ;
PUT SKIP EDIT('DSInfo.DD = ' || DSInfo.DD ) (A);
PUT SKIP EDIT('DSInfo.DSN = ' || DSInfo.DSN ) (A);
PUT SKIP EDIT('DSInfo.Member = ' || DSInfo.Member ) (A);
PUT SKIP EDIT('DSInfo.Disp = ' || DSInfo.Disp ) (A);
PUT SKIP EDIT('DSInfo.DSORG = ' || DSInfo.DSORG ) (A);
PUT SKIP EDIT('DSInfo.RECFM = ' || DSInfo.RECFM ) (A);
PUT SKIP EDIT('DSInfo.LRECL = ' || CHAR(DSInfo.LRECL )) (A);
PUT SKIP EDIT('')(A);
PUT SKIP EDIT('')(A);
RETURN('1'B) ; /* Continue Processing */
END;
CALL DSInfo(MyCallback,NULL());
DSInfo:
/* Loops over the MVS Control blocks to get information
for all DD names associated with the current job.
For each DD Name the filenames and some other
data is fetched from then JFCB (Job File
Control Block).
A callback function is invoked for each file.
The callbackfunction is passed from the calling module.
*/
PROC(pEntry,pUserdata);
DCL pEntry ENTRY
( PTR /* Data for each DDName / Dataset */
, PTR /* Userdata */
) RETURNS(BIT(1)) VARIABLE ;
DCL pUserData PTR ; /* any data passed from the calling modul
an routed to the callback function */