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 retrieve the CPC name and the Current CPC status of a CPC:
.
QueryParm_Ptr = ADDR(QueryParm);
NumberOfAttributes = 2;
QueryParm(1).AttributeIdentifier = HWI_NAME;
QueryParm(1).AttributeValue_Ptr = Addr(Value1);
QueryParm(1).AttributeValueLen = length of value1; 
QueryParm(2).AttributeIdentifier = HWI_OPERSTAT; 
QueryParm(2).AttributeValue_Ptr = Addr(Value2); 
QueryParm(2).AttributeValueLen = 4; 
CALL HWIQUERY (ReturnCode, ConnectToken, QueryParm_Ptr, 
               NumOfAttributes, DiagArea)
.
.
Start of changeA REXX programming example for the HWIQUERY service:
myQueryParm.0  = 4 /* Set number of attributes     */     
myQueryParm.n.ATTRIBUTEIDENTIFIER = HWI_NAME                   
myQueryParm.n.ATTRIBUTEIDENTIFIER = HWI_LUAPROF                   
myQueryParm.n.ATTRIBUTEIDENTIFIER = HWI_MSERIAL                   
myQueryParm.n.ATTRIBUTEIDENTIFIER = HWI_IPADDR                  
                                                         
address bcpii "hwiquery RetCode myConnectToken myQueryParm. 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
Else
  Do n=1 to myQueryParm.0                                              
    Say ' myQueryParm.'n'.ATTRIBUTEVALUE = 'myQueryParm.n.ATTRIBUTEVALUE 
  End
End of change

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014