Posted: Mon Mar 25, 2019 12:07 pm Post subject: Find the program(s) load library name in a JCL job
Hi,
I am looking for some mechanism or utility to figure out the library name from where each program load is loaded during a job. It includes programs which are dynamically called and all the vendor programs etc.. We have many instances where they are several datasets in the steplib or joblib which we think not used all and thinking of cleaning up.I know we can remove and test it to figure it out. I wanted to know whether there is any other means in which we can get this information.The datasets belong to different vendors or product like eztrieve,DB2,oracle etc. If this information can be retrieved from JES log also, please let me know.
Please let me know your comments on this
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Mon Mar 25, 2019 12:38 pm Post subject:
manu,
If you want to find a load module from your Linklist, then it is quite simple
1. Type TSO ISRDDN and press enter
2. On the next screen, type LOAD modname. For example if you want to find about IDCAMS, then you simply type LOAD IDCAMS and press enter
It under the covers issues an CSVQUERY and displays something like this
Code:
EsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssN
e CSVQUERY Results IDCAMS e
e Command ===> e
e More: + e
e Module IDCAMS was found to be already loaded. Note that e
e invocations of this program name may pick up another copy from e
e STEPLIB or a LIBDEF'ed data set or from a tasklib such as ISPLLIB. e
e Tab to a box and press enter to view the module in storage. e
e +-------------------------+ e
e | Job pack area resident | e
e | Loaded by LLA | e
e | SYS1.LINKLIB | e
e | Module address:00161A00 | e
e | Module size: 0001D4A8 | e
e | Reentrant | e
e | Serially reusable | e
e | Not loadable only | e
e | AMODE 31 | e
e | Authorized library | e
e | Authorized program | e
e +-------------------------+ e
e e
e e
DsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssM
Hi Kolusu,
Thanks for your response. I am looking for information on where Program in the EXEC statement and its dynamically called programs are pulled from JPA,steplib,joblib etc. and from which particular dataset in the concatenation. If I had to use the above way then I have to know all the called module names and I may not have the source code for every one of them. I am looking to create some kind of automated report of this information.
We have several jobs in which steplib, joblib which has several datasets concatenated and few of them might not be used at all. I am looking for someway to identify and remove those datasets.
In other words if a dataset given in the steplib/joblib is never used at all in a particular job runs, then is there a way to identify those datasets?
I know it is kind of odd requirements but I thought I would ask here to see whether it is possible and for any helpful ideas.Thanks for your response.
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Mon Mar 25, 2019 6:33 pm Post subject:
manu wrote:
Hi Kolusu,
Thanks for your response. I am looking for information on where Program in the EXEC statement and its dynamically called programs are pulled from JPA,steplib,joblib etc. and from which particular dataset in the concatenation. If I had to use the above way then I have to know all the called module names and I may not have the source code for every one of them. I am looking to create some kind of automated report of this information.
Why do you need the SOURCE CODE for ISRDDN?
manu wrote:
We have several jobs in which steplib, joblib which has several datasets concatenated and few of them might not be used at all. I am looking for someway to identify and remove those datasets.
In other words if a dataset given in the steplib/joblib is never used at all in a particular job runs, then is there a way to identify those datasets?
I know it is kind of odd requirements but I thought I would ask here to see whether it is possible and for any helpful ideas.Thanks for your response.
Unless these datasets take up huge storage I do not see the reason as to why you want to remove them.
If you want to spend time on looking for trivial stuff, then you can start looking at SMF 14 records which records the INPUT or RDBACK Data Set Activity. So look for SMF14TIOE5 field for STEPLIB/JOBLIB and if you don't a entry for one of your dataset in question, may be then you can delete it. Make sure you have a copy of the dataset somewhere before you actually delete it. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
Posted: Tue Mar 26, 2019 5:18 pm Post subject:
manu wrote:
I am not looking for source code of ISRDDN and I meant to say vendor supplied programs. Thanks for your inputs.
I did not think you are asking for source of ISRDDN. You don't have to have the source for your vendor programs too. As long as the load modules are in the LINKLIST , ISRDDN will pull the information and tell you in which library loadlib resides. _________________ Kolusu
www.linkedin.com/in/kolusu
Joined: 02 Dec 2002 Posts: 627 Topics: 176 Location: Stockholm, Sweden
Posted: Wed Mar 27, 2019 5:47 am Post subject:
Maybe I'm missing something, but couldn't you theoretically write a script that reviews the linkage listings and extracts the libraries containing the source.
It suddenly occurred to me that I'd written something some time ago, so I'll include it here. Remember - this is based on naming standards that were in place where I was working at the time
I'll append it later (just managed to delete a load of lines by mistake, so I'll have to copy the backup back again)
Here's the documentation anway (without screen captures since I don't know how to include them):-
Code:
SRCELINK
This program can be run in TSO to show where the source code for a linked program has been â€found â€. The simplest way to explain this is via a couple of examples.
Endevor linkage listings
When you select L from the Endevor main meny and then select a linkage list (via L), in reality, Endevor is simply formatting the results from a PDS.
Assume you want to review CLUT’s ST1 K460* linkage lists in Endevor, the resulting screen might look similar to the following:-
Note the fact that the results are stored (in this example) in xxx.yyy.CLUT.LINKLST. To run SRCELINK against any of these members, run 3.4 on xxx.yyy.CLUT.LINKLST and view the member you’re interested in. Then, on the command line, enter
Srcelink
If all goes well, you should see a message along the lines of:-
Source linkage details created in SRCELINK(K4600000)
This “tells†you that a file has been created/changed called ‘userid.SRCELINK’, and in it, a member has been created called (in this example) K4600000 containing a list showing each linked module in your program, and from which load library it was fetched for the linkage.
NB NB NB You can also call srcelink with a parameter (COMP) as shown here:-
Srcelink comp
The result are basically the same, but beside each module name in the results, the date it was compiled will also be shown.
“Normal†linkage listings
Assuming you have linked your program using either BTCH or CMPLGEN, edit the linkage listing and enter on the command line
Srcelink
The results will be the same as for an Endevor listing
Takes the linkage listing (Endevor or otherwise) and shows
which modules have been picked up from which libraries. Any
generic modules (defined in the variable ignore_modules)
are ignored from the listing
100305 Added code suggested by BEPO01 - allow the user to specify
COMP as an argument. If they do, we run a "batch" FMAN
command to extract the compilation dates for all modules
and then include it in the output
131205 Changed the code so it always writes the results to a file
'userid.srcelink(memb)' rather than splattering it onto the
screen
select
when parms = "" then
nop
when pos("COMP",parms) <> 0 then
sw_comp = 1
otherwise
nop
end
msgval = msg("off")
Address ISPEXEC
'CONTROL ERRORS RETURN'
'VGET (ZUSER)'
signal on novalue
sw_trace = 0
if zuser <> 'MISI01' then
sw_trace = 0 /* In case I ever forget to switch it off */
Address ISREDIT /* Pass all cmd to EDIT */
'(MEMB) = MEMBER' /* WHICH member? */
'(DS) = DATASET' /* Which dataset */
parse upper var ds proj '.' second '.' third '.'
if memb = "" then
memb = second
/* NB NB NB DON'T forget the trailing / */
ignore_modules = "DFS/IGZ/CEE/CBL/AIB/DSN/CSQ/ILB/ÄPE/ÖDA/DAM/"
Address ISREDIT
/* Get the mandatory *** M O D U L E M A P *** line */
"find '*** M O D U L E M A P ***' first"
if rc <> 0 then
do
/* The line's not there */
rc = missing_module_map()
exit 1
end
'label .zcsr = .stmod 0'
/* Get the mandatory *** DATA SET SUMMARY *** line */
"find '*** DATA SET SUMMARY ***' first"
if rc <> 0 then
do
/* The line's not there */
rc = missing_data_set_summary()
exit 1
end
"(dssum) = cursor"
/* Get all the relevant libraries used first */
endv_libraries.0 = 0
endv_nr.0 = 0
/* Set the Endevor translate table */
endv_tr = '0405060708092B2C2D5AFD'x
do forever
rc = get_next_line()
line = translate(line,' ',endv_tr,' ') /* In case Endevor listing */
line = strip(line)
select
when line == "" then
nop
when left(line,1) = '1' then
leave
when datatype(word(line,2)) <> 'NUM' then
nop
otherwise
do
/* say 'Adding Endevor libraries ' word(line,3) */
endv_libraries.0 = endv_libraries.0 + 1
endv_nr.0 = endv_nr.0 + 1
i = endv_libraries.0
endv_libraries.i = word(line,3)
endv_nr.i = word(line,2)
/* if word(line,3) = 'IMSTEST.II1T.RESLIB' then
trace ?a */
end
end
end
/*
do i = 1 to endv_libraries.0
say endv_nr.i endv_libraries.i
end
*/
/* say 'In 'rname ; trace ?a */
/* srcelink.0 = 0 */
srce = 1
/* Okay - we now have the library names and their "numbers". Let's
start looking at the module map and matching the source code with
the libraries from which they were fetched */
'cursor = .stmod'
"find '------- SOURCE --------' next"
srce_members = ''
srce_nr.0 = 0
do forever
"find p'=CSECT' next"
if rc <> 0 then
leave /* Finished */
rc = get_current_line()
if curr > dssum then
leave /* Finished */
line = translate(line,' ',endv_tr,' ') /* In case Endevor listing */
line = strip(line)
i = words(line)
library = word(line,i-1)
member = word(line,i)
temp = left(member,3)"/"
select
when pos(temp,ignore_modules) <> 0 then
nop
when pos(member"/",srce_members) <> 0 then
nop
otherwise
do
/* say 'Adding to source libraries ' member */
srce_members = srce_members !! left(member,8)"/"
srce_nr.0 = srce_nr.0 + 1
i = srce_nr.0
srce_nr.i = library
end
end
end
/*
temp = srce_members
do i = 1 to srce_nr.0
parse var temp next_member "/" temp
say srce_nr.i next_member
end
*/
rc = prepare_srcelink_file(memb)
if sw_comp = 1 then
rc = get_compile_date()
/* say 'In 'rname ; trace ?a */
/* Look through the endevor libraries. If we find references to them
in the source libraries, then show the details */
do i = 1 to endv_nr.0
endevor_nr = endv_nr.i
members = ''
do i2 = 1 to srce_nr.0
if srce_nr.i2 = endevor_nr then
do
if members = '' then
members = endv_libraries.i"/"
y = 1 + (9*(i2-1))
members = members !! substr(srce_members,y,9)
end
end
if members <> "" then
rc = show_members(members)
end
**********************************************************************/
show_members:
/* say 'In show_members in 'rname ; trace ?a */
arg members
parse var members library "/" members
/*
srcelink.0 = srcelink.0 + 1
i = srcelink.0
*/
srcelink.srce = library ; srce = srce + 1
temp = ""
do while members <> ""
parse var members next_member "/" members
compile_date = ""
/* Look for next_member in mod_compile */
z = pos(next_member"§", mod_compile)
select
when sw_comp = 1 & z = 0 then
/* We want the compilation date, but FMAN didn't return it */
compile_date = "??/??/?? "
when sw_comp = 0 & z = 0 then
/* We DIDN'T want the compilation date */
nop
otherwise
do
/* Found the member ni the mod_compile string */
z = substr(mod_compile,z)
parse var z . "§" compile_date "§" .
compile_date = compile_date" "
end
end
temp = temp !! left(next_member,8)" "compile_date
if words(temp) >= 8 then
do
srcelink.srce = " "temp ; srce = srce + 1
temp = ""
end
end
if temp <> "" then
do
srcelink.srce = " "temp ; srce = srce + 1
end
return 0
/**********************************************************************
Get the compilation date for each module via File Manager
**********************************************************************/
get_compile_date:
procedure expose ignore_modules endv_tr loadlib memb mod_compile rname
/* say 'In get_compile_date in 'rname ; trace ?a */
"find 'LOAD LIBRARY' first" /* Hitta laddbiblioteksnamn*/
if rc <> 0 then
do
rc = no_load_library()
exit 8
end
rc = get_current_line() /* Plocka upp rad i LINE */
line = translate(line,' ',endv_tr,' ') /* In case Endevor listing */
line = strip(line)
loadlib = word(line,3)
/* Omdirigera från terminal till TEMPFIL */
address 'TSO'
"FREE DD(SYSPRINT)"
"ALLOC DD(SYSPRINT) NEW LRECL(132) ",
"RECFM(F B) SPACE(1 1) TRACKS UNIT(VIO)"
if rc <> 0 then
do
rc = no_sysprint(parm)
exit 8
end
/* "Svälj onödigt FMAN-med */
x = outtrap('NOICE.')
/* Skapa FileManager-lista */
"FILEMGR Ã…VLM DSNIN='"loadlib"',",
"MEMBER="memb",",
"FUNCTION=PRINT,DATEFORM=YYMMDD,SORTBY=NAME"
fmanrc = rc
/*",VArname=TAPE." */
x = outtrap('OFF')
if fmanrc <> 0 then
do
rc = fman_error()
exit 8
end
"execio * diskr sysprint (stem list. finis" /* Läs in listan */
"free dd(sysprint)" /* Omdirigera till terminal*/
"alloc dd(sysprint) dsname(*)" /* igen */
/* Plocka ut uppgifter: */
do i=1 to list.0
module = word(list.i,1)
module = left(module,3)
select
when word(list.i,2) <> "SD" then
nop
when pos(module"/",ignore_modules) <> 0 then
nop /* Not a module we're interest in */
otherwise
do
/* Lagra kompileringsdatum "uppslagsbart" i MDAT. */
next_module = substr(list.i,4,8)"§"substr(list.i,80,8)"§"
mod_compile = mod_compile!!next_module
end
end
end
/*
say mod_compile
*/
return 0
/*********************************************************************
Try and allocate the PDSE member for the layout results
*********************************************************************/
prepare_srcelink_file:
/* say 'In prepare_srcelink_file in 'rname ; trace ?a */
arg mem
alloc1 = "allocate dd(srcelnk) da("
/* Always ensure the file created is in the user's dir */
file = "SRCELINK("mem")"
/* Check first whether the print layout file exists */
temp = "SRCELINK" /* To avoid novalue */
rc = sysdsn(temp)
select
when rc = "OK" then
nop
when rc = "ERROR PROCESSING REQUESTED DATASET" then
/* Probably migrated - tell them */
rc = file_migrated(SRCELINK)
otherwise
/* File doesn't exist - allocate it for them */
rc = alloc_srcelink_file()
end
if rc = 0 then
count.0 = 0
else
do
zedsmsg = 'Alloc error'
zedlmsg = "Cannot allocate file '"file"'"
signal exit2
end
return 0
/****************************************************************
Allocate srcelink file - create it if it doesn't exist
****************************************************************/
alloc_srcelink_file:
procedure expose file
/* File will contain the filename INCLUDING a member name */
x = pos('(',file)
temp = substr(file,1,x - 1)
/* temp will now contain the filename WITHOUT the member part */
alloc.0 = 0
address TSO "alloc dd(SRCELNK) da("temp") new SPACE(2,1)",
"tracks lrecl(80) block(3120) DSORG(PO)",
"RECFM(F,B) DIR(20)",
"DSNTYPE(LIBRARY)" /* PDSE */
if rc <> 0 then
do
/* Failed to allocate */
rc = allocate_failure(temp)
signal exit2
return 0
end
else
do
drop alloc. /* Reset the alloc variable */
address TSO 'free dd(SRCELNK)'
end
return 0
/***********************************************************************
Return the current line where the cursor is
***********************************************************************/
get_current_line:
'(curr) = CURSOR ' /* Get the row number */
'(LINE) = LINE .zcsr' /* Take data from that line */
return 0
/***********************************************************************
Return the NEXT line from where the cursor is
***********************************************************************/
get_next_line:
'(curr) = CURSOR ' /* Get the row number */
curr = curr + 1 /* Point to next row */
'cursor = 'curr
'(LINE) = LINE .zcsr' /* Take data from that line */
return 0
/**********************************************************************
File migrated ?
**********************************************************************/
file_migrated:
arg filename /* Will be filename */
zedsmsg = "Allocate failed"
zedlmsg = "Is the file ('"zuser!!'.'!!filename"') migrated ? If so,",
"recall it first, then try again"
signal exit2
return 0
/***********************************************************************
Couldn't allocate the relevant file
***********************************************************************/
allocate_failure:
arg filename /* Will be filename */
zedsmsg = "Allocate failed"
zedlmsg = "Failed to allocate "filename" - investigate"
signal exit2
return 0
/***********************************************************************
Missing *** M O D U L E M A P *** line
***********************************************************************/
MISSING_MODULE_MAP:
zedsmsg = "No MODULE MAP"
zedlmsg = "Couldn't find a line containing the string",
"*** M O D U L E M A P *** - are you SURE you're",
"editting a valid linkage listing ?"
signal exit2
return 0
/***********************************************************************
Missing *** DATA SET SUMMARY *** line
***********************************************************************/
MISSING_DATA_SET_SUMMARY:
zedsmsg = "No DATA SET SUMMARY"
zedlmsg = "Couldn't find a line containing the string",
"*** DATA SET SUMMARY *** - are you SURE you're",
"editting a valid linkage listing ?"
signal exit2
return 0
/***********************************************************************
Missing LOAD LIBRARY line
***********************************************************************/
no_load_library:
zedsmsg = "LOAD LIBRARY missing"
zedlmsg = "Couldn't find a line containing the string",
"LOAD LIBRARY - are you SURE you're",
"editting a valid linkage listing ?"
signal exit2
return 0
/***********************************************************************
Couldn't allocate sysprint
***********************************************************************/
no_sysprint:
parse arg parm
zedsmsg = "SYSPRINT allocate error"
zedlmsg = "Couldn't allocate SYSPRINT - cannot create",
parm" information"
signal exit2
return 0
/***********************************************************************
Details created
***********************************************************************/
srcelink_created:
/* say 'In srcelink_created in 'rname ; trace ?a */
if zuser = 'MISI01' then
do
say 'In NOVALUE COUNT - we came here from line 'SIGL
pull fred
end
else
do
zedsmsg = ""
zedlmsg = "The code has uncovered a bug on line "SIGL,
"- contact Michael Simpson"
end
signal exit2
return
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum