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


Sample REXX exec

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

Here is a sample REXX exec using BCPii calls that lists the names of all of the interconnected CPCs and then attempts to connect to each one of them:
/* REXX */
ListType = HWI_LIST_CPCS;
Address BCPII “HWILIST Retcode ConnectToken ListType AnswerArea.
DiagArea.”

If RC = 0 & retcode = 0 Then
  Do
    ConnectType = HWI_CPC
      Do i = 1 To AnswerArea.0
        Say “CPC” i “:” AnswerArea.i

        InConnectToken = 0
        Address BCPII “HWICONN Retcode InConnectToken OutConnectToken 
        ConnectType AnswerArea.i DiagArea.”
        If RC = 0  & retcode = 0 Then
        Say “Connected to CPC “AnswerArea.i”.” 
      End
  End
For REXX execs running in an ISV-provided environment, make sure to add the following line prior to the first address BCPii statement:
RC = hwihost("ON")

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014