Steve Horein suggested:

>To me, it appears your variable names and values are not lining up, like
>your CECMODEL variable reflects your CECMSUS value, etc.
>Hopefully that helps?

 

Doh. All I did was take the code you posted and add a bunch of SAY
statements at the end, but in doing so I somehow got off by one *after the
first statement* and didn't notice-I verified the first one, then failed to
do so for the rest! That's what I get for doing things while on another
call. Now my test system is down but I'm 100% sure this will make it work
right.

 

Just in case anyone else wants to play with it, to save them the trouble of
doing what I did (twice):

/* Rexx -------------------------------------------------------------*/
/* Call the Query Virtual Server service provided by WLM to get      */
/* CEC and Image capacity, as well as other hardware identification. */
/* "IRAQVS" maps the returned data.                                  */
/*-------------------------------------------------------------------*/
QVSLEN  = 97                           /* Set output area length     */
QVSLENX = RIGHT(X2C(D2X(QVSLEN)),,     /* Set area length as char    */
                4,,                    /* Pad to fullword            */
                D2C(0))                /* Pad with '00'x             */
                                       /*----------------------------*/
QVSOUT  = QVSLENX ,                    /* Output area with length    */
||        COPIES('00'X,QVSLEN-4)       /* Pad remainder with '00'x   */
                                       /*----------------------------*/
ADDRESS LINKPGM 'IWMQVS QVSOUT'        /* Call Query Virtual Server  */
                                       /*----------------------------*/
IF RC > 0 ,                            /* Something didn't work      */
THEN DO                                /* Perform the following      */
  SAY "IWMQVS ERROR. RC =" RC          /* Provide some diagnostics   */
  EXIT                                 /* Nothing more to do         */
END                                    /* End program error          */
                                       /*----------------------------*/
QVSVER   = C2D(SUBSTR(QVSOUT,5,1))     /* QVS version                */
QVSFLAGS = C2X(SUBSTR(QVSOUT,6,1))     /* Isolate returned flags     */
CECVALID = SUBSTR(X2B(QVSFLAGS),1,1)   /* CEC information found?     */
IMGVALID = SUBSTR(X2B(QVSFLAGS),2,1)   /* Image information found?   */
                                       /*----------------------------*/
IF QVSVER = 2 ,                        /* QVS extended information   */
THEN                                   /* Perform the following      */
  VER2 = X2B(C2X(SUBSTR(QVSOUT,97,1))) /* Get the bits I guess (TBD) */
                                       /*----------------------------*/
IF CECVALID ,                          /* CEC information found      */
THEN DO                                /* Perform the following      */
  CECSTAT  = C2D(SUBSTR(QVSOUT,8,1))   /* Nominal/reduced capacity?  */
  CECTYPE  =     SUBSTR(QVSOUT,9,4)    /* Machine type               */
  CECMODEL =     SUBSTR(QVSOUT,13,3)   /* Machine model              */
  CECMSUS  = C2D(SUBSTR(QVSOUT,65,4))  /* Machine MSU capacity       */
END                                    /* End CEC information found  */
                                       /*----------------------------*/
IF IMGVALID ,                          /* MVS running in a partition */
THEN DO                                /* Perform the following      */
  LPARNAME =     SUBSTR(QVSOUT,69,8)   /* Get LPAR name              */
  LPARID   = C2D(SUBSTR(QVSOUT,77,2))  /* Get LPAR numeric identifier*/
  LPARMSUS = C2D(SUBSTR(QVSOUT,81,4))  /* Get LPAR MSU capacity      */
END                                    /* End running in a partition */

say 'QVSVER =' QVSVER
say 'CECMODEL =' CECMODEL
say 'CECMSUS =' CECMSUS
say 'CECSTAT =' CECSTAT
say 'CECTYPE =' CECTYPE
say 'CECVALID =' CECVALID
say 'IMGVALID =' IMGVALID
say 'LPARID =' LPARID
say 'LPARMSUS =' LPARMSUS
say 'LPARNAME =' LPARNAME
say 'QVSFLAGS =' QVSFLAGS
say 'VER2 =' VER2


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to