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 |
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. |
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. |
manu wrote: |
I am not looking for source code of ISRDDN and I meant to say vendor supplied programs. Thanks for your inputs. |
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 |
Code: |
/* REXX *********************************************************** 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 Copyright Michael Simpson 2010 ******************************************************************/ rname = 'SRCELINK' /* say 'In 'rname ; trace ?a */ 'isredit macro (parms) NOPROCESS' sw_comp = 0 mod_compile = "" parms = translate(parms) 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 address TSO "execio * DISKW srcelnk (STEM srcelink. FINIS) " address TSO "free dd(srcelnk)" rc = srcelink_created() Address Isredit "res label" Address Isredit "loc 1" exit /********************************************************************** **********************************************************************/ 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 alloc2 = ") shr reuse" address TSO alloc1!!file!!alloc2 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 */ zedsmsg = "" zedlmsg = "Source linkage details created in", "SRCELINK("memb")" address ispexec 'SETMSG MSG(ISRZ001)' return 0 /*********************************************************************** Error calling FMAN ***********************************************************************/ fman_error: zedsmsg = "FMAN error" zedlmsg = "Unexpected error calling FMAN - cannot continue" signal exit2 return 0 /*********************************************************************/ exit2: /* trace ?a */ Address Isredit "res" address ispexec 'SETMSG MSG(ISRZ001)' exit 1 /*********************************************************************/ novalue: 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 |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours