/*rexx | Name: CFSTATS | v1m0 - March, 2000 - Initial Console command processor | Purpose: OS/390 Console Command processor | Requires: RACF rights to console services | Author: | Bruce R. Gillispie - gillispi@texasrock.com | ! Disclaimer: ! The "CFSTATS" utility IS NOT in the Public Domain Freeware Software. ! You may use this utility AT YOUR OWN RISK, it is provided for your ! enjoyment and neither the Author or his Employer provides any ! warranty for its use. */ starting_point: /* using signal a little */ 'cls' /* clear the screen */ /* Show ISPF Working Panel to User of this exec? */ show_workwait = 'no' /* 'yes' any other value is off */ /* Build the Menu Screen */ firstitem='1'; lastitem='14'; /* set menu limits */ /* add os/390 commands you want supported... stems here! */ cmd.1 = 'D XCF,STR,STAT=ALLOCATED ' cmd.2 = 'D XCF,STR,STAT=NOTALLOCATED ' cmd.3 = 'D XCF,STR,STAT=REBUILD ' cmd.4 = 'D XCF,STR,STAT=STRDUMP ' cmd.5 = 'D XCF,STR,STAT=DEALLOCPENDING ' cmd.6 = 'D XCF,STR,STAT=POLICYCHANGE ' cmd.7 = 'D XCF,STR,STAT=LARGERCFRMDS ' cmd.8 = 'D XCF,STR,STAT=FPCONN ' cmd.9 = 'D XCF,STR,STAT=NOCONN ' cmd.10 = 'D XCF,STR,STAT=ALTER ' cmd.11 = 'D XCF,STR,STAT=INCLEANUP ' cmd.12 = 'D XCF,STR,STAT=DUPREBUILD ' cmd.13 = 'D XCF,CF,CFNAME=* ' cmd.14 = 'D XCF,STR,STRNAME=* ' call makemenu pull indata ; call validate indata call buildcmd indata call issue_standard_cmds UserIn signal starting_point /* play it again sam */ exit /* /\/\_oo_/\/\ called routines below /\/\_oo_/\/\ */ buildcmd: UserIn = value(strip(cmd.||indata)) drop indata; return issue_standard_cmds: procedure expose UserIn show_workwait ; 'cls' /* - - - - - - - - - - - - - - - - - - - - - - - */ /* free work file going into this routine */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO msg_status = MSG("OFF"); "FREE FI("wrktmp1")"; "FREE ATTRLIST(DCB)"; msg_status = MSG("ON"); /* - - - - - - - - - - - - - - - - - - - - - - - */ /* allocate work file */ /* - - - - - - - - - - - - - - - - - - - - - - - */ "ATTRIB DCB RECFM(F) LRECL(80) BLKSIZE(80)"; "ALLOC FILE("wrktmp1") UNIT(VIO) SP(2,1) TRACK USING(DCB) NEW" /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Display "UserIn" and Working panel */ /* - - - - - - - - - - - - - - - - - - - - - - - */ if show_workwait = 'yes' then do function = "===>" UserIn address ISPEXEC "CONTROL DISPLAY LOCK" address ISPEXEC "DISPLAY PANEL("sysplexw")" end else do say '' say 'Issued console command:'strip(UserIn) say '' say 'please wait... processing data now...' say '' say 'press the enter key when you see *** ' end /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Turn Console off going into this routine */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO msg_status = MSG("OFF"); "console deactivate" msg_status = MSG("ON"); /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Construct command */ /* - - - - - - - - - - - - - - - - - - - - - - - */ Cart_V = 'PLEX1'random(100,) /* build CART value */ pass_arg. = "CONSOLE SYSCMD("UserIn") CART("Cart_V")" /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Issue message to Console Services */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO "consprof soldisp(no) solnum(300) unsoldisp(no)" "console activate name("Cart_V") cart("Cart_V")" /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Get Message Results */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO pass_arg. /* present command */ getcode = getmsg('issue_back.','SOL',Cart_V,,30) if getcode <> 0 then do say "getmsg error retrieving message. return code is" getcode end /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Turn Console off going out of this routine */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO msg_status = MSG("OFF"); "console deactivate" msg_status = MSG("ON"); /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Write message to work file */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO "EXECIO * DISKW "wrktmp1" (STEM issue_back." /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Close work file */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO "EXECIO 0 DISKW "wrktmp1" (FINIS"; /* - - - - - - - - - - - - - - - - - - - - - - - */ /* Library Services */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address ISPEXEC "LMINIT DATAID(LMID) DDNAME("wrktmp1")"; /* address ISPEXEC "edit DATAID(&LMID)"; edit rc = 4 */ address ISPEXEC "browse DATAID(&LMID)"; address ISPEXEC "LMFREE DATAID(&LMID)"; /* - - - - - - - - - - - - - - - - - - - - - - - */ /* post routine clean-up */ /* - - - - - - - - - - - - - - - - - - - - - - - */ address TSO drop pass_arg. /* unassigns variables */ drop issue_back. /* unassigns variables */ msg_status = MSG("OFF"); "FREE FI("wrktmp1")"; "FREE ATTRLIST(DCB)"; msg_status = MSG("ON"); return validate: procedure expose indata firstitem lastitem ; if indata == '' then exit 99 /* exit if no input */ if indata == 'H' then call help_info /* gosh... doc too */ if datatype(indata) <> 'NUM' | , /* gota be number */ indata < firstitem | , /* not less than */ indata > lastitem | , /* not more than */ length(indata) > length(lastitem) , /* not longer than */ then do say ' Invalid selection input received, this routine expects: ' say ' number input next to the menu item wanted. ' say ' ' say ' FYI... invalid input received was: ' indata say '=========================================================' exit 99 end else nop ; return help_info: procedure ; 'cls' /* clear the screen */ say 'D XCF,STR,STAT=xxxxx What it is.... ' say ' ' say 'ALLOCATED or ALLOC ' say ' Coupling facility structure is allocated in a coupling ' say ' facility. ' say ' ' say 'NOTALLOCATED or NOTALLOC ' say ' Coupling facility structure is not allocated in any ' say ' coupling facility ' say ' ' say 'POLICYCHANGE or POLCHG ' say ' The activation of a coupling facility resource management ' say ' policy has caused changes to a coupling facility structure ' say ' definition. The changes are pending the allocation of the ' say ' structure in a coupling facility. ' say ' ' say 'DEALLOCPENDING or DEALLOC ' say ' A coupling facility structure is pending deallocation ' say ' because of a loss of connectivity to the coupling facility ' say ' where the structure is allocated or because of a structure ' say ' dump table being associated with the structure. ' say ' ' say 'LARGERCFRMDS or LARGER ' say ' A coupling facility structure has connections that cannot ' say ' be represented in the coupling facility resource ' say ' management couple data set. ' say ' ' say 'REBUILD or RB ' say ' A coupling facility structure is in the process of being ' say ' rebuilt. ' say ' ' say 'STRDUMP or STRD ' say ' A structure dump table is associated with a coupling ' say ' facility structure. ' say ' ' say 'ALTER ' say ' A coupling facility structure is in the process of being ' say ' altered. ' say ' ' say 'FPCONN ' say ' A coupling facility structure has at least one ' say ' failed-persistent connector. The system displays all ' say ' connectors to the structure, including those that are not ' say ' failed persistent. ' say ' ' say 'NOCONN ' say ' A coupling facility structure has no connectors. ' say ' ' drop indata; signal starting_point return makemenu: procedure expose lastitem cmd. say '' say ''left('-',30,'-'), ||center(' CF Stats ',10,), ||left('-',30,'-') do i = 1 to value(lastitem) say ''right(i,length(lastitem),' ')'. '||strip(cmd.i) end say ''left('-',18,'-'), ||center(' press enter to exit or h for help ',35,), ||left('-',17,'-') return