z/OS MVS Programming: Callable Services for High-Level Languages
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example

z/OS MVS Programming: Callable Services for High-Level Languages
SA23-1377-02

In the pseudocode example, the caller issues a call to register to be notified when the command response events and status change events occur.
Declare (ReturnCode, EventAction, EventExitMode) Fixed(31);
Declare ConnectToken Isa(HWI_CONNTOKEN_TYPE):
Declare EventIDs Isa(HWI_EVENTIDS_TYPE):
Declare (EventExitAddr, EventExitParm) Ptr(31);
Declare DiagArea Isa(HWI_DIAGAREA_TYPE);
Declare EventExit Entry External;

EventAction = HWI_EVENT_ADD;
Hwi_EventID_EyeCatcher = HWI_EVENTID_TEXT;
Hwi_Event_CmdResp = on;
Hwi_Event_StatusChg = on;
Hwi_Event_Reserved = 0;
EventExitMode = HWI_EVENT_TASK;
EventExitAddr = ADDR(EventExit);
EventExitParm = 0;

CALL HWIEVENT (ReturnCode, ConnectToken, EventAction, EventIDs, 
               EventExitMode, EventExitAddr, EventExitParm, DiagArea);
Start of changeA REXX programming example for the HWIEVENT service:
myAction = HWI_EVENT_ADD  
myEventIDs. = 0            /*Initialize all EventIds to 0 */ 
myEventIDs.Hwi_Event_CmdResp = 1 
myEventIDs.Hwi_Event_StatusChg = 1
myEventIDs.Hwi_Event_ActProfChg = 1
 
myMode = HWI_EVENT_TASK 
myEventExitAddr = 0F123456    /* char rep of 4 byte hex address */ 
myEventExitParm = 0  

address bcpii  
"hwievent RetCode myConnectToken myEventAction myEventIDs. myEventExitMode
   myEventExitAddr myEventExitParm myDiag."
 
If (RC <> 0) | (Retcode <> 0) Then  
  Do  
     Say 'Service failed with REXX RC = 'RC' and API Retcode = 'Retcode'.'       
     If (RC=Hwi_REXXParmSyntaxError | Retcode<>0) Then
       Do
         Say ’ Diag_index=’ myDiag.DIAG_INDEX
         Say ’ Diag_key=’ myDiag.DIAG_KEY
         Say ’ Diag_actual=’ myDiag.DIAG_ACTUAL
         Say ’ Diag_expected=’ myDiag.DIAG_EXPECTED
         Say ’ Diag_commerr=’ myDiag.DIAG_COMMERR
         Say ’ Diag_text=’ myDiag.DIAG_TEXT
       End
  End
End of change

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014