Previous Topic: CA GSS/REXX InterfaceNext Topic: SARBCH JCL Statements


GREXX Variables

The following GREXX variables are used:

XPVIEW.DBASE

Specifies the CA View database prefix that would normally be specified on the /DBASE NAME=xxxxxx control statement.

This variable must be specified before any XPVIEW commands are issued. As with SARBCH, the length of this prefix must be less than or equal to 17.

RC

A variable set by the XPVIEW host command environment upon completion of the requested command.

RC contains the return code from the requested command as follows:

-3

Command not found.

-2

Not enough memory to perform command.

-1

Unable to access shared variable pool.

0

OK

4

Warning message issued; message text on stack.

8

Error message issued; message text on stack.

9

XPVIEW.DBASE not set.

10

XPVIEW.DBASE string too long.

12

Severe error message issued; message text on stack.

16

Fatal error message issued; message text on stack.

28

Language processor environment could not be found.

Probable CA GSS installation problem.

32

Internal error.

Other

Internal error.

Example

The following sample REXX exec demonstrates the use of the CA View host command environment. This sample is on the distribution tape, in the file CAI.CVDECLS0(HBRMRSPF).

/* REXX */
/*
   Sample XPVIEW/ISERVE GREXX exec
   This exec will look at the users in the CA View
   database and change the banner to PRODBAN for those users
   whose banner is currently set to TESTBAN.
*/
Address XPVIEW                      /*Set the host command env */
              /*----+----1----5--*/ /*Must be <= 17 characters */
XPView.DBase = 'VIEW.SYSTEM1'       /*Set the XPVIEW database */
'/list user=*'                      /*List the users in dbase  */
If RC <> 0 Then Do                  /*Was there an error?      */
   Say 'List users failed, RC='||RC /*Print an error message   */
   Exit 1                           /*Exit with an error       */
End
Else Do                             /*Process the user records */
   NumRecs = Queued()               /* Get the number of records*/
   UserData.0 = 0                   /* Initialize the User list */
   Do i = 1 to NumRecs              /* Pull each record         */
      Parse Pull Record             /*   off of the queue       */
      If SubStr(Record,2,5) <> 'SARBC' Then Do  /* Skip messages */
        UserData.i.UserId    = SubStr(Record,2,8)
        UserData.i.PassWord  = SubStr(Record,12,8)
        UserData.i.Master    = SubStr(Record,22,1)
        UserData.i.Mask      = SubStr(Record,25,8)
        UserData.i.DistId    = SubStr(Record,35,8)
        UserData.i.Acc       = SubStr(Record,45,5)
        UserData.i.Mode      = SubStr(Record,52,4)
        UserData.i.Banner    = SubStr(Record,58,8)
        UserData.i.Language  = SubStr(Record,70,1)
        UserData.0 = UserData.0 + 1
      End
   End
   /*
      We now have the UserData records parsed out.
      Process them here.
   */
   Do i = 1 to UserData.0
      If UserData.i.Banner = 'TESTBAN ' Then Do
         '/defuser user='||Userdata.i.UserId||' Banner=PRODBAN '
         Num = Queued()
         Do Num
            Parse Pull Message
            Say Message
         End
      End
   End
End