Here is my contribution - it is a rexx exec that will check the STEPLIB (or 
provided ddname) for apf authorization.  It uses the console interface to get 
the apf list and then uses lista to find the dsnames in the allocation.  The 
challenge is that lista does not provide the volser so the assumption is that 
the dataset is on the cataloged volume for both steplib and apflist

/* --------------------  rexx procedure  -------------------- *
 | Name:      CHKAPFSL                                        |
 |                                                            |
 | Function:  Check the datasets in a STEPLIB concatenation   |
 |            against the list of APF authorized libraries    |
 |                                                            |
 | Syntax:    %chkapfsl ddname                                |
 |                                                            |
 |           ddname defaults to STEPLIB                       |
 |                                                            |
 | Usage Notes: Must have a DD that references the STEPLIB    |
 |              Assumes the Dataset is cataloged              |
 |                                                            |
 | Author:    Lionel B. Dyck                                  |
 |                                                            |
 | History:  (most recent on top)                             |
 |            11/22/16 - Creation                             |
 |                                                            |
 * ---------------------------------------------------------- */
 arg dd
 
 parse value '' with null dsns
 if dd = null then dd = 'STEPLIB'
 
/* ------------------------------------- *
 * Setup the CONSOLE command environment *
 * ------------------------------------- */
"CONSPROF SOLDISP(no) SOLNUM(400) UNSOLDISP(yes)"
"CONSOLE ACTIVATE"
 
/* --------------------------------- *
 * Execute the provided z/OS Command *
 * --------------------------------- */
"CONSOLE SYSCMD(D PROG,APF)"
 
/* --------------------------------------------------------------- *
 * Retrieve the results of the z/OS Command.                       *
 *                                                                 *
 * Note that the default wait time is 30 seconds. That value       *
 * can be changed to any time frame that you need. Be aware that   *
 * it is a maximum wait time and that if the command ends before   *
 * that limit is reached then the results will be returned without *
 * waiting for the wait time to expire.                            *
 * --------------------------------------------------------------- */
rc = GETMSG('t.','sol',,,30)
 
/* --------------------------------- *
 * Close out the CONSOLE environment *
 * --------------------------------- */
"CONSOLE DEACTIVATE"
 
/* ----------------------------- *
 | Get APF list into usable stem |
 * ----------------------------- */
 do i = 1 to t.0
    if word(t.i,1) = 'ENTRY' then leave
    end
 do il = i+1 to t.0
    parse value t.il with lib vol dsn
    apf.dsn = vol
    dsns = dsns dsn
    end
 
/* ----------------------------------------- *
 | Now get the list of DSNAMEs in the ddname |
 * ----------------------------------------- */
 
 call outtrap 'trap.'
 "lista sta"
 call outtrap 'off'
 
 hit = 0
 cnt = 0
 tdd = null
 
 do i = 1 to trap.0
    if tdd = dd then hit = 1
    if hit = 1 then
       if tdd <> dd then leave
    if left(trap.i,2) = "--" then iterate
    if left(trap.i,1) <> " " then do
       dsn = word(trap.i,1)
       end
    else do
         if left(trap.i,3) = "   " then do
         if tdd <> dd then iterate
         cnt = cnt + 1
         dsn.cnt = tdd dsn
         end
       else do
            tdd = word(trap.i,1)
            if tdd <> dd then iterate
            cnt = cnt + 1
            dsn.cnt = tdd dsn
            end
       end
    end
 
  do i = 1 to cnt
     stepdsn = word(dsn.i,2)
     if wordpos(stepdsn,dsns) = 0 then
        say stepdsn 'is not APF authorized'
     end


--------------------------------------------------------------------------
Lionel B. Dyck (TRA Contractor)
Mainframe Systems Programmer <AITC Mainframe Support>
Enterprise Infrastructure Support (Station 200) (005OP6.3.10)
VA OI&T Service Delivery & Engineering


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Donald Likens
Sent: Tuesday, November 22, 2016 12:31 PM
To: [email protected]
Subject: [EXTERNAL] Re: REXX determine library that is executed from

I failed to mention that when using EXEC 'rexx.library'. (where 'rexx.library' 
contains member TEMPNAME.)

I am thinking about looking at the output of LISTA but not sure it is worth the 
effort. If anyone else has a need for this capability I may be able to work 
something out and post it.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to