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 a list CPCs that can be accessed.
.
.
ListType = HWI_LIST_CPCS; 
AnswerArea_Ptr = addr(AnswerArea);
AnswerAreaLen = 125;               
CALL HWILIST (ReturnCode, ConnectToken, ListType, NumofDataItemsReturned.      
              AnswerArea_Ptr, AnswerAreaLen, DiagArea)
.
.
Start of changeA REXX programming example for the HWILIST service:
myListType = HWI_LIST_IMAGES

address bcpii                                    
    "hwilist RetCode myConnectToken myListType myAnswerArea. 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
    Say 'Number of items returned = 'myAnswerArea.0  /* Count of items returned */ 

    If myAnswerArea.0 > 0 Then                                             
      Do n=1 to myAnswerArea.0                                             
        Say 'Image #'n' = 'myAnswerArea.n                                
      End
  End 
End of change

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014