/* REXX */ /* */ /* AUTHOR: Mark Zelden */ /* */ /* Trace ?r */ /*********************************************************************/ /* List ASIDs in the system */ /*********************************************************************/ /* This program will write out the names of all ASIDs in the */ /* system, their ASCB addrses, their ASID number in hex and in */ /* decimal as shown in the examples below: */ /* */ /* ASCB FOUND AT 00FD4100: *MASTER* - ASID X'0001' ( 1 IN DECIMAL) */ /* ASCB FOUND AT 00F4BE80: PCAUTH - ASID X'0002' ( 2 IN DECIMAL) */ /* ASCB FOUND AT 00F4D700: RASP - ASID X'0003' ( 3 IN DECIMAL) */ /* ASCB FOUND AT *NONREUS: *NONREUS - ASID X'000E' ( 14 IN DECIMAL) */ /* ASCB FOUND AT *AVALABL: *AVALABL - ASID X'0037' ( 55 IN DECIMAL) */ /* ASCB FOUND AT *AVALABL: *AVALABL - ASID X'NNNN' (NNNN IN DECIMAL) */ /* */ /* This program also displays totals as shown below: */ /* */ /* Total address spaces in the system: NNNN */ /* Total active address spaces in the system: NNNN */ /* Total available address spaces in the system: NNNN */ /* Total non-reusable address spaces in the system: NNNN */ /* */ /* */ /* ASID USAGE FROM THE ASVT */ /* */ /* MAXUSER from IEASYSxx: NNNN */ /* In use ASIDs: NNNN */ /* Available ASIDs: NNNN */ /* */ /* RSVSTRT from IEASYSxx: NNNN */ /* RSVSTRT in use: NNNN */ /* RSVSTRT available: NNNN */ /* */ /* RSVNONR from IEASYSxx: NNNN */ /* RSVNONR in use: NNNN */ /* RSVNONR available: NNNN */ /* */ /*********************************************************************/ /* TSO execution syntax: TSO %ASIDLIST */ /* TSO %ASIDLIST NODETAIL */ /* TSO %ASIDLIST N */ /* */ /* The "NODETAIL" option can be used to list only the totals from */ /* the ASVT instead of all ASIDs. Note that NODETAIL can be */ /* abbreviated using one or more of its characters. */ /*********************************************************************/ /* Sample batch execution JCL: */ /* */ /* //MYJOB JOB (ACCT),CLASS=A,MSGCLASS=H */ /* //ASIDLIST EXEC PGM=IRXJCL,PARM='ASIDLIST' */ /* //*ASIDLIST EXEC PGM=IRXJCL,PARM='ASIDLIST NODETAIL' */*/ /* //SYSTSIN DD DUMMY */ /* //SYSTSPRT DD SYSOUT=* */ /* //SYSEXEC DD DSN=your.rexx.sysexec.lib,DISP=SHR */ /*********************************************************************/ Arg OPT Numeric digits 10 /* dflt of 9 not enough */ /*********************************************************************/ /* House keeping */ /*********************************************************************/ TOTASIDS = 0 /* counter for total ASIDs (should match ASVTMAXU) */ TOTACTIV = 0 /* counter for total active ASIDs */ TOTAVAL = 0 /* counter for total available ASIDs */ TOTNONR = 0 /* counter for total non-reusable ASIDs */ CVT = C2d(Storage(10,4)) /* point to CVT */ CVTASVT = C2d(Storage(D2x(CVT+556),4)) /* point to ASVT */ /*********************************************************************/ /* "NODETAIL" option - ASVT totals only, then exit */ /*********************************************************************/ If Abbrev('NODETAIL',Translate(OPT),1) <> 0 then do Call ASVT_TOTALS /* write ASVT total messages */ Exit 0 /* exit */ End /*********************************************************************/ Say ' A D D R E S S S P A C E I D L I S T' /* title */ Say ' ' /* blnk line*/ ASVTMAXU = C2d(Storage(D2x(CVTASVT+516),4)) /* max number of entries */ MSTRASVT = CVTASVT+528 /* save address of master for non-reuse check */ /*********************************************************************/ /* This routine checks each ASVT entry. */ /* If the high order bit is on, the entry is the address of the */ /* next available asid (or the last entry if zeros). */ /* If the high order bit is not on, the entry is the address */ /* of the ASCB for that entry. If the high order bit is on and */ /* the entry contains the address of master's ASCB, then the ASID */ /* is non-reusable. */ /*********************************************************************/ Do I = 0 to ASVTMAXU-1 /* start at 0 so I*4 bumps to next entry */ ASVTENTY = Storage(D2x(CVTASVT+528+(I*4)),4) /* cur ASVT entry*/ If Bitand(ASVTENTY,'80000000'x) == '80000000'x then do /* bit on */ ASVTENTY = Bitand(ASVTENTY,'7FFFFFFF'x) /* zero high order bit */ ASVTENTY = C2d(ASVTENTY) /* change to decimal for code below */ If ASVTENTY == MSTRASVT then do /* same addr as mstr = non-reuse */ TASKNAME = '*NONREUS' ASVTENTY = '*NONREUS' TOTNONR = TOTNONR+1 /* counter for total non-reusable ASIDs */ Call SAY_FOUND /* write "ASCB FOUND" message */ End Else do /* different addr than mstr means avaialable asid */ TASKNAME = '*AVALABL' ASVTENTY = '*AVALABL' TOTAVAL = TOTAVAL+1 /* counter for total available ASIDs */ Call SAY_FOUND /* write "ASCB FOUND" message */ End Iterate /* go to next ASVT entry */ End /* If Bitand */ Else do /* valid ASCB address */ ASVTENTY = C2d(ASVTENTY) /* change to decimal for code below */ ASCBJBN = C2d(Storage(D2x(ASVTENTY+172),4)) /* ASCBJBNI */ If ASCBJBN = 0 then , /* not a job - must be START/LOGON/MOUNT */ ASCBJBN = C2d(Storage(D2x(ASVTENTY+176),4)) /* ASCBJBNS */ TASKNAME = Storage(D2x(ASCBJBN),8) /* point to name */ ASVTENTY = Right(D2x(ASVTENTY),8,'0') /* ensure leading zeros */ TOTACTIV = TOTACTIV+1 /* counter for total active ASIDs */ Call SAY_FOUND /* write "ASCB FOUND" message */ End /* else do */ End /* Do I */ Call PGM_TOTALS /* write program total messages */ Call ASVT_TOTALS /* write ASVT total messages */ Exit 0 /*********************************************************************/ /* End of main code */ /*********************************************************************/ /* Start of sub-routines */ /*********************************************************************/ SAY_FOUND: /* Write "ASCB FOUND" message subroutine */ Say 'ASCB FOUND AT' ASVTENTY || ':' , TASKNAME '- ASID X''' || Right(D2x(I+1),4,'0') || ''' (' || , Right((I+1),4,' ') 'IN DECIMAL)' TOTASIDS = TOTASIDS+1 /* counter for total ASIDs */ Return PGM_TOTALS: /* Write totals subroutine */ /* */ /* make more readable */ /* */ TOTASIDS = Right(TOTASIDS,5,' ') TOTACTIV = Right(TOTACTIV,5,' ') TOTAVAL = Right(TOTAVAL,5,' ') TOTNONR = Right(TOTNONR,5,' ') Say ' ' Say ' ' Say ' PROGRAM TOTALS ' Say ' ' Say 'Total address spaces in the system: ' TOTASIDS Say 'Total active address spaces in the system: ' TOTACTIV Say 'Total available address spaces in the system: ' TOTAVAL Say 'Total non-reusable address spaces in the system:' TOTNONR Say ' ' Say ' ' Return ASVT_TOTALS: /* Write ASVT totals subroutine */ ASVTMAXI = C2d(Storage(D2x(CVTASVT+500),4)) /* MAXUSERS from ASVT */ ASVTAAVT = C2d(Storage(D2x(CVTASVT+480),4)) /* free slots in ASVT */ ASVTSTRT = C2d(Storage(D2x(CVTASVT+492),4)) /* RSVTSTRT from ASVT */ ASVTAST = C2d(Storage(D2x(CVTASVT+484),4)) /* free START/SASI */ ASVTNONR = C2d(Storage(D2x(CVTASVT+496),4)) /* RSVNONR from ASVT */ ASVTANR = C2d(Storage(D2x(CVTASVT+488),4)) /* free non-reusable */ Say ' ASID USAGE FROM THE ASVT ' Say ' ' Say 'MAXUSER from IEASYSxx:' Right(ASVTMAXI,5,' ') Say ' In use ASIDs:' Right(ASVTMAXI-ASVTAAVT,5,' ') Say ' Available ASIDs:' Right(ASVTAAVT,5,' ') Say ' ' Say 'RSVSTRT from IEASYSxx:' Right(ASVTSTRT,5,' ') Say ' RSVSTRT in use:' Right(ASVTSTRT-ASVTAST,5,' ') Say ' RSVSTRT available:' Right(ASVTAST,5,' ') Say ' ' Say 'RSVNONR from IEASYSxx:' Right(ASVTNONR,5,' ') Say ' RSVNONR in use:' Right(ASVTNONR-ASVTANR,5,' ') Say ' RSVNONR available:' Right(ASVTANR,5,' ') Return