TITLE 'HZSSAMAC - IBM Health Checker for z/OS ADD CHECK SampleX ' */* START OF SPECIFICATIONS ******************************************* * *01* MODULE NAME: HZSSAMAC * * *01* DESCRIPTIVE-NAME: IBM Health Checker for z/OS * Sample Add Check Exit Routine * * *01* PROPRIETARY STATEMENT= * * **PROPRIETARY_STATEMENT********************************************* * * * * * LICENSED MATERIALS - PROPERTY OF IBM * * THIS MACRO IS "RESTRICTED MATERIALS OF IBM" * * 5694-A01 (C) COPYRIGHT IBM CORP. 2003, 2004 * * * * STATUS= HBB7709 * * * * **END_OF_PROPRIETARY_STATEMENT************************************** * * * * *01* EXTERNAL CLASSIFICATION: OTHER @P1C* *01* END OF EXTERNAL CLASSIFICATION: * * * * * *01* DISCLAIMER = * * * * This sample source is provided for tutorial purposes only. A * * complete handling of error conditions has not been shown or * * attempted. This source is distributed on an "AS IS" basis * * without any warranties either expressed or implied. * * * * * *01* FUNCTION: This module has the following entry points. * * 1. HZSSAMAC HZSSAMAC exit routine that defines checks to * IBM Health Checker for z/OS * * *02* OPERATION: HZSSAMAC * * HZSSAMAC * 1 ENTRY * 2 INVOKE HZSADDCK MACRO to define One Time check to * IBM Health Checker for z/OS * 3 INVOKE HZSADDCK MACRO to define Interval check to * IBM Health Checker for z/OS * 4 RETURN * 5 END HZSSAMAC * *02* RECOVERY-OPERATION: * No recovery is provided for this exit point * *********************************************************************** * *01* NOTES: * * None * *02* DEPENDENCIES: * * None * *02* RESTRICTIONS: * * None * *02* REGISTER-CONVENTIONS: * *03* REGISTERS SAVED: R0-R15 *03* REGISTERS RESTORED: R0-R14 *03* CODE REGISTER: R10 *03* DATA REGISTER: R13 * *02* PATCH-LABEL: None * *01* MODULE-TYPE: Procedure * *02* PROCESSOR: High Level Assembler * *02* MODULE-SIZE: See External Symbol Dictionary * *02* ATTRIBUTES: * *03* LOCATION: Authorized Link List Library *03* LOAD MOD: HZSSAMAC *03* TYPE: Reentrant *03* APF: NO - AC(0) *03* AMODE: 31 *03* RMODE: Any *03* SYSGEN: NONE * *********************************************************************** * *01* ENTRY-POINT: HZSSAMAC * *02* PURPOSE: See FUNCTION section for this module. * *03* OPERATION: See OPERATION section for this module. * *02* ATTRIBUTES: * *03* ENTRY * *04* MODE: Enabled *04* STATE: Supervisor *04* KEY: 8 *04* AMODE: 31 *04* LOCKS HELD: None *04* ASCMODE: Primary *04* MEMORY MODE: P=S=H *04* DISPATCH MODE: Task *04* ADDRESS SPACE: IBM Health Checker for z/OS * *03* EXECUTION * *04* MODE: Enabled *04* STATE: Supervisor *04* KEY: 8 *04* AMODE: 31 *04* LOCKS OBTAINED: None *04* ASCMODE: Primary *04* MEMORY MODE: P=S=H *04* ADDRESS SPACE: IBM Health Checker for z/OS * *02* LINKAGE: Branch Entry * *03* CALLERS: * * IBM Health Checker for z/OS under the HZSADDCHECK exit * *02* INPUT: * * None * *03* ENTRY-REGISTERS: * * R0 - R15 - Irrelevant * *02* OUTPUT: * * 1) Checks added to IBM Health Checker for z/OS via * HZASDDCK MACRO * *02* EXIT-NORMAL: RETURN TO CALLER * *03* CONDITIONS: Successful completion * *03* EXIT-REGISTERS: * * R0 - R14 - Unchanged * R15 - Return Code * *03* RETURN-CODES: * * 0 - Completed successfully * 8 - HZSADDCHK Macro failure * 16 - GETMAIN Macro failure * *02* EXIT-ERROR: None * *********************************************************************** * *01* EXTERNAL-REFERENCES : * *02* ROUTINES: * * None * *02* DATA-AREAS: * * None * *02* CONTROL-BLOCKS: * * Name Macro Use Description * ---------- ---------- ------ --------------------------- * None * * Legend: C=Create, R=Read, W=Write, D=Delete * *01* MACRO-EXCUTABLE: * * Name Macro Use Note * ---------- ---------- ------ ----------------------------- * FREEMAIN FREEMAIN G Release working storage * GETMAIN GETMAIN G Obtain working storage * HZSADDCK HZSADDCK G Define checks with HC * * Legend: G=Generally used macro * *01* SERIALIZATION: * * None * *01* MESSAGES: * * ADCHK01 - GETMAIN Failure, Working storage could not be * obtained. No health checks Added. * ADCHK02 - HZSADDCK Failure. A request to add a health check * failed. * ADCHK03 - RTNCD = xx, RSNCD = xxxxxxxx, * Check Name = xxxxxxxxxxxxxxxx * * *01* ABEND-CODES: * * None * *01* WAIT-STATE-CODES: * * None * *01* CHANGE-ACTIVITY: * * $L0=HCHXS ,HBB7720,050701,PDFX: Sample Healh Checker checks * **** END OF SPECIFICATIONS *******************************************/ HZSSAMAC CSECT HZSSAMAC AMODE 31 Run in 31 bit addressing mode HZSSAMAC RMODE ANY Load load module in any storage R0 EQU 0 Work Register 00300000 R1 EQU 1 Work Register 00350000 R2 EQU 2 ** UNUSED ** 00400000 R3 EQU 3 ** UNUSED ** 00450000 R4 EQU 4 ** UNUSED ** 00500000 R5 EQU 5 ** UNUSED ** 00550000 R6 EQU 6 ** UNUSED ** 00600000 R7 EQU 7 Address of failing check name 00650000 R8 EQU 8 Return Code 00700000 R9 EQU 9 Internal Linkage 00750000 R10 EQU 10 @@@ Program Base 00800000 R11 EQU 11 ** UNUSED ** 00850000 R12 EQU 12 ** UNUSED ** 00900000 R13 EQU 13 @@@ Work Area Base 00950000 R14 EQU 14 Work Register 01000000 R15 EQU 15 Work Register 01050000 HZSSAMAC CSECT J Chk_Over_ID Jump over the identifier DC YL1(Chk_Over_ID-*) ... Length of identifier DC CL8'HZSSAMAC' ... Program Name DC CL8'&SYSDATE' ... Assembly Date DC CL8'&SYSTIME' ... and Time Chk_Over_ID DC 0H STM R14,R12,12(R13) Save Callers Registers LR R10,R15 ... and Establish Program Base USING HZSSAMAC,R10 @@@ Program Base SR R8,R8 Assume all will be O.K. RC=0 GETMAIN RC, Conditionally obtain storage * LV=Work_Area_Len, ... of this size in 31 bit * LOC=(31,31) ... addressing and storage LTR R15,R15 ... Did we get what we wanted? JNZ Chk_ADD_Fail1 ... Nope, we have to quit ST R13,4(0,R1) Set save area Back Chain pointer ST R1,8(0,R13) ... forward chain pointer LR R13,R1 ... and my save/work area base USING Work_Area,R13 @@@ Work Area Base * ------------------------------------------------------------------- * * Add a One Time Only health check to the * * IBM Health Checker for z/OS * * ------------------------------------------------------------------- * Chk_ADD_1 DC 0H HZSADDCK CHECKOWNER=CK_Owner, Supply Owners Name of the check * CHECKNAME=CK1_Name, ... the Name of the Check * CHECKROUTINE=CK_Routine, .. Name of the module with chk * ACTIVE, ... Activate check immediately * LOCAL, ... Run check on every system * ENTRYCODE=CK1_Entry_Code, . Entry code for this check * EXITRTN=CK_Xit_Routine, ... Name of routine adding chk * MSGTBL=CK_MSG_Table, ... Name of message table * DATE=CK1_Date, ... Base date for defaults * REASON=CK1_Reason, ... Reason for this check * REASONLEN=CK1_Rsn_Len, ... ... and its length * SEVERITY=LOW, ... Severity of check * INTERVAL=ONETIME, ... A one time check * USS=NO, ... Check does not use USS * RETCODE=CK_RTN_Code, ... Return code from this MACRO * RSNCODE=CK_RSN_Code, ... and its reason code * MF=(E,HZS_ADDCK_LOC) ... Execute form LTR R15,R15 Was this check added? JZ Chk_ADD_2 ... Yes, go add next check LA R7,CK1_Name Some error occured, pass the BRAS R9,Chk_ADD_Err ... check name to error routine Chk_ADD_2 DC 0H HZSADDCK CHECKOWNER=CK_Owner, Supply Owners Name of the check * CHECKNAME=CK2_Name, ... the Name of the Check * CHECKROUTINE=CK_Routine, .. Name of the module with chk * ACTIVE, ... Activate check immediately * LOCAL, ... Run check on every system * ENTRYCODE=CK2_Entry_Code, . Entry code for this check * EXITRTN=CK_Xit_Routine, ... Name of routine adding chk * MSGTBL=CK_MSG_Table, ... Name of message table * DATE=CK2_Date, ... Base date for defaults * REASON=CK2_Reason, ... Reason for this check * REASONLEN=CK2_Rsn_Len, ... ... and its length * PARMS=CK2_Parm, ... Default Parameters * PARMSLEN=CK2_Parm_Len, ... ... and their length * SEVERITY=LOW, ... Severity of check * INTERVAL=TIMER, ... A check that is executed * HOURS=CK2_Hours, ... ... Every this many hours * MINUTES=CK2_Minutes, ... ... and this many minutes * USS=NO, ... Check does not use USS * RETCODE=CK_RTN_Code, ... Return code from this MACRO * RSNCODE=CK_RSN_Code, ... and its reason code * MF=(E,HZS_ADDCK_LOC) ... Execute form LTR R15,R15 Was this check added? JZ Chk_ADD_Done ... Yes, We all checks added LA R7,CK2_Name Some error occured, pass the BRAS R9,Chk_ADD_Err ... check name to error routine Chk_ADD_Done DC 0H LR R1,R13 Address of area to release L R13,4(0,R13) ... back up the save area chain FREEMAIN RC, Release our working storage * LV=Work_Area_Len, ... of this length and * A=(1) ... pointed at by this register XC 8(4,R13),8(R13) Zero forward chain pointer Chk_Prog_Done DC 0H L R14,12(0,R13) Restore Return Register LR R15,R8 ... Set our Return Code LM R0,R12,20(R13) ... and the other registers BR R14 ... return with RC in R15. Chk_ADD_Fail1 DC 0H Could not obtain working storage WTO 'ADCHK01 - GETMAIN Failure, Working storage could not obX tained. No health checks added.', X Routcde=(2,10), ... and sysprog that critical X Desc=(7,11) ... eventual action is needed. LA R8,16 Show we had something go wrong J Chk_Prog_Done ... And return to * IBM Health Checker for z/OS Chk_ADD_Err DC 0H HZSADDCK MACRO Non-Zero return MVC WTO_Loc,WTO_List Set the WTO Parameter List WTO Text=Chk_ADD_Msg2, ... Put a message on the consoleX Routcde=(2,10), ... & for sysprog that critical X Desc=(7,11), ... eventual action is needed. X MF=(E,WTO_Loc) ... MVC MSG3_Loc,Chk_ADD_Msg3 Set skeleton message text UNPK Work1(3),CK_RTN_Code+3(2) Unpack Return Code and make TR Work1(2),HEX_TR .. it a printable hex value MVC Chk_Msg3_RTN+MSG3_Loc,Work1 .. moved into the message UNPK Work1(9),CK_RSN_Code(5) Unpack Reason Code and make TR Work1(8),HEX_TR .. it a printable hex value MVC Chk_Msg3_RSN+MSG3_Loc,Work1 .. moved into the message MVC Chk_Msg3_Chknm+MSG3_Loc,0(R7) Set check name in message MVC WTO_Loc,WTO_List Set the WTO Parameter List WTO Text=MSG3_Loc, Put our message on the console X Routcde=(2,10), ... & for sysprog with critical X Desc=(7,11), ... eventual action is needed X MF=(E,WTO_Loc) ... routing and descriptor codes LA R8,8 Set an error Return Code BR R9 ... and Return to Caller DROP R13 @@@ Work Area Base DROP R10 @@@ Program Base * ------------------------------------------------------------------- * * Literal Pool * * ------------------------------------------------------------------- * LTORG HEX_TR EQU *-C'0',256,C'X' Translate table to make DC C'0123456789ABCDEF' ... Unpacked hex data printable * ------------------------------------------------------------------- * * HZSADDCK Macro Common Constants * * ------------------------------------------------------------------- * CK_Xit_Routine DC CL8'HZSSAMAC' Name of this routine CK_Routine DC CL8'HZSSAMCK' Name of health check routine CK_MSG_Table DC CL8'HZSSAMMT' Name of Message Table for checks CK_Owner DC CL16'IBMSAMPLE' Owner of these health checks * ------------------------------------------------------------------- * * HZSADDCK Macro Check Specific Constants * * ------------------------------------------------------------------- * CK1_Name DC CL32'HZS_SAMPLE_ONE_TIME' Name for this Hlth Check CK1_Entry_Code DC F'1' Entry code for this check CK1_Date DC CL8'20050701' ... Date this check's defaults * ... were set. The installation * ... must provide a date after * ... this in order to override * ... the defaults CK1_Rsn_Len DC A(L'CK1_Reason) Length of health check reason CK1_Reason DC C'A sample health check to demonstrate a one time hx ealth check.' Reason for this Health Check CK2_Name DC CL32'HZS_SAMPLE_INTERVAL' Name for this Hlth Check CK2_Entry_Code DC F'2' Entry code for this check CK2_Date DC CL8'20050701' ... Date this check's defaults * ... were set. The installation * ... must provide a date after * ... this in order to override * ... the defaults CK2_Hours DC H'00' Hours and Minutes between calls CK2_Minutes DC H'05' ... of this check. CK2_Parm_Len DC A(L'CK2_Parm) Length of health check parms CK2_Rsn_Len DC A(L'CK2_Reason) Length of health check reason CK2_Parm DC C'COUNT(1)' Set the initial count to zero CK2_Reason DC C'A sample check to demonstrate an interval check' * Reason for this health check * ------------------------------------------------------------------- * * HZSSAMAC Messages - These messages are issued if the add of the * * health checks fails for some reason. They * * are NOT the messages issued by the health * * check itself. Those messages are in another * * sample member. * * ------------------------------------------------------------------- * Chk_ADD_Msg2 DC Y(L'Chk_Msg2) Chk_Msg2 DC C'ADCHK02 - HZSADDCK MACRO Failure. A request to adX d a check failed.' Chk_ADD_Msg3 DC Y(Chk_Msg3_End-Chk_Msg3) Chk_Msg3 DC C'ADCHK03 - RTNCD = ' Chk_Msg3_RTN EQU *-Chk_ADD_Msg3,2,C'C' DC CL2'xx',C', ' DC C'RSNCD = ' Chk_Msg3_RSN EQU *-Chk_ADD_Msg3,8,C'C' DC CL8'xxxxxxxx',C', ' DC C'Check Name = ' Chk_Msg3_Chknm EQU *-Chk_ADD_Msg3,32,C'C' DC CL32'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' Chk_Msg3_End EQU * Chk_Msg3_Len EQU *-Chk_ADD_Msg3 * ------------------------------------------------------------------- * * WTO Skeleton Parameter List for issuing messages * * ------------------------------------------------------------------- * WTO_List WTO TEXT=0, Message Text address form * Routcde=(2,10), ... Console and Sysprog * Desc=(7,11), ... Critical and Eventual act * MF=L ... Just the list part WTO_List_Len EQU *-WTO_List Work_Area DSECT DC 18F'0' Save Area Work1 DC XL16'00' Misc Work Area Storage * ------------------------------------------------------------------- * * HZSADDCK Macro Return and Reason Code * * ------------------------------------------------------------------- * CK_RTN_Code DC F'0' HZSADDCK MACRO Return Code CK_RSN_Code DC F'0' ... and Reason Code * ------------------------------------------------------------------- * * HZSADDCK Macro Common Work Areas * * ------------------------------------------------------------------- * HZSADDCK MF=(L,HZS_ADDCK_LOC) Location for Add check list * ------------------------------------------------------------------- * * Message and WTO Work Areas * * ------------------------------------------------------------------- * MSG3_Loc DC CL(Chk_Msg3_Len)' ' Location for message 3 text WTO_Loc DC XL(WTO_List_Len)'00' ... and the WTO Parameter list Work_Area_Len EQU *-Work_Area END HZSSAMAC