Here is the sysrexx
CMDRESULT=AXRCMD('/DI(1-2)','OUTPUTVAR.',1);
ACTIVE=0
DRAINED=0
INACTIVE=0
IF CMDRESULT =0 THEN
DO
  SAY OUTPUTVAR.0
  DO C = 1 TO  OUTPUTVAR.0
    STATUS  = SUBSTR(WORD(OUTPUTVAR.C,3),8,6)
    SAY  STATUS
    IF STATUS = 'ACTIVE' THEN
         ACTIVE = ACTIVE + 1
    ELSE IF STATUS = 'DRAINE' THEN
         DRAINED = DRAINED + 1
    ELSE IF STATUS = 'INACTI' THEN
         INACTIVE = INACTIVE + 1
  END;
  SAY  'ACTIVE   INIT='||ACTIVE;
  SAY  'INACTIVE INIT='||INACTIVE;
  SAY  'DRAINED INIT='||DRAINED;
END ;

Here is the completed sysout
 ZXXX237  00000290  REXXD2
INITINFO
 *AXT01D2 00000290
/DI(1-2)
 *AXT01D2 00000090  /HASP892 INIT(1)
839
      839 00000090  /HASP892 INIT(1)
STATUS=ACTIVE,
      839 00000090  /HASP892
CLASS=DAFJKLMNTHUEWXYZQV123456789,NAME=1,
      839 00000090  /HASP892
ASID=002B,JOBID=JOB06877
 *AXT01D2 00000090  /HASP892 INIT(2)
840
      840 00000090  /HASP892 INIT(2)
STATUS=INACTIVE,
      840 00000090  /HASP892
CLASS=DAFJKLMNTHUEWXYZQV123456789,NAME=2,
      840 00000090  /HASP892
ASID=002C
 ZXXX237  00000090  AXR0500I AXREXX OUTPUT DISPLAY
841
      841 00000090  EXECNAME=INITINFO
REQTOKEN=0000400000000000C342EBFA2FB94FC1
      841 00000090
4
      841
00000090
      841 00000090
ACTIVE
      841
00000090
      841
00000090
      841 00000090  ACTIVE
INIT=1
      841 00000090  INACTIVE
INIT=0
      841 00000090  DRAINED
INIT=0

On Fri, Nov 7, 2008 at 7:19 PM, Walt Farrell <[EMAIL PROTECTED]> wrote:

> On Fri, 7 Nov 2008 17:34:03 +0800, Tommy Tsui <[EMAIL PROTECTED]> wrote:
>
> >I checked the result, it only can show up the first 4 lines statement,
> >INIT(1), even the AXRCMD run successfully. I also try "/DI(1-2)", the
> >result is also 4.
> >
> >CMDRESULT=AXRCMD('/DI(1-2)','OUTPUTVAR.',100);
> > SAY OUTPUTVAR.0
> >
>
> A couple of comments:
> (a) when you're trying to write an exec like this, I think you should start
> out with having the exec issue the command (as you've done), but then have
> it print all the output it got, rather than
> immediately jumping in and trying to parse the output.  So far, you've
> showed us the output of a command issued by an operator, but have never
> shown us the output that the exec received.  So,
> I would start by printing all the trapped output.
>
> (b) It looks to me (from the command output you showed) that the response
> has multiple lines for each initiator.  In that case, your logic in parsing
> the output must be more complex, as you're trying to get data from only the
> first line for each initiator, but you're currently parsing each line of
> output.
>
> --
>  Walt
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
> Search the archives at http://bama.ua.edu/archives/ibm-main.html
>
>

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to