OPS/MVS

 View Only
Expand all | Collapse all

attempting to capture OPS3906I msg from List command, ver 12.1

  • 1.  attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 24, 2016 11:00 PM

    I am attempting to capture the ruleset names and rules sets from the AOF ADDRESS LIST command, but nothing is working in the sample code from one of the provided rexx's.

     

    This should just issue the list command and store the ruleset name then display it in a SAY.  what am I missing?

     

    rc=Opscledq()                       

    Address AOF "List =NOSTATS"         

    i=0                                 

    Do While Queued() > 0               

      Parse Pull msgid rset             

      If substr(msgid,4,4) = 3906 Then Do

        i=i+1                           

        ruleset.i=rset                  

        say 'ruleset.i = ' ruleset.i    

      End                               

    End                                

     

    Thanks for the input.

     

    Chris



  • 2.  Re: attempting to capture OPS3906I msg from List command, ver 12.1
    Best Answer

    Posted Apr 25, 2016 10:47 AM

    Hello Chris,

     

    Your code runs ok as long as you are using our CA OPS/MVS default subsystem name OPSS.

    In my case, after adding the TRACE I statement to your code, I get the following info message:

     

    MSGID=OPS4300I                                         

    RSET=AOF command rejected - subsystem OPSS is not active

      If substr(msgid,4,4) = 3906 Then Do                 

     

    Makes sense for me as I do use a different subsystem names as I run multiple versions of CA OPS/MVS under the same LPAR/system.

    When I add this simple code to your OPS/REXX program to direct it to the correct subsystem name I want to interact with:

     

    address AOF "SUBSYS" OPSC                            

    if RC <> 0 then                                      

      do                                                 

        say "CA OPS/MVS Subsystem" subsys "is not active."

        return                                           

      end                                               

     

    Then I get this from your OPS/REXX based on my system setting:

     

    OPC0996I ruleset.i =  CCLXRULB

    OPC0996I ruleset.i =  CCLXRULM

    OPC0996I ruleset.i =  CCLXRULS

    OPC0996I ruleset.i =  CUSTOM 

    OPC0996I ruleset.i =  STATEMAN

    ***                         

    See if this help Chris

    Regards, Cesar



  • 3.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 25, 2016 04:54 PM

    Hey Cesar, I had to move the code out of the rule and include the SUBSYS setting that you recommended.  Now I have to wonder why I had to do that, right there in parms I have the standard OPSS.

     

     

    OPSCMD Subsystem    ===> OPSS   

     

    Since I inherited this system, I am curious, if something is off, I would like to fix it so there is no need for that additional code.

     

    Thanks

     

    Chris



  • 4.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 25, 2016 05:09 PM

    Chris,

    When I test your code this morning I tried it under a 12.2 system outside of a rule via the !OI Command processor.

    I do not see any documented restrictions about using the Address AOF statement from a rule.

    Share with me the rule you were using so I can take it for a spin.

    I have a lab system available that runs a 12.1 subsystem where I can try it today.

    Regards, Cesar



  • 5.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 26, 2016 03:15 PM

    Afternoon Cesar, here is the code and trace.  I was using it in a TOD rule for testing, that may be the issue.

     

    )TOD *+2 seconds

    )INIT

    /**********************************************************************/

    /*)CMD TESTWTO */

    /*  Rule Type:     command                                            */

    /**********************************************************************/

    )PROC

    trace 'i'

    address AOF "SUBSYS" OPSS

    if RC <> 0 then

       do

         say "CA OPS/MVS Subsystem" subsys "is not active."

         return

       end

     

    c=Opscledq()

    Address AOF "List =nostats"

    i=0

    Do While Queued() > 0

      Parse Pull msgid rset

      If substr(msgid,4,4) = 3906 Then Do

        i=i+1

        ruleset.i=rset

        say 'ruleset.i = ' ruleset.i

      End

    End

     

      return "accept"

     

     

    0N2016/04/26 15:13:13

    OPS0997T - 8:trace 'i'

    OPS0997T - 9: address AOF "SUBSYS" OPSS

    OPS0997T >L>   AOF

    OPS0997T >L>   SUBSYS

    OPS0997T >V>   OPSS

    OPS0997T >O>   SUBSYS OPSS

    OPS4307E SUBSYS AOF command cannot be issued in a rule

    OPS4304E AOF command SYNTAX ERROR: 'SUBSYS OPSS'

    OPS0997T +++    RC(16)

    OPS0997T - 10: if RC <> 0 then

    OPS0997T >V>    16

    OPS0997T >L>    0

    OPS0997T >O>    1

    OPS0997T - 12:     say "CA OPS/MVS Subsystem" subsys "is not active."

    OPS0997T >L>    CA OPS/MVS Subsystem

    OPS0997T >V>    SUBSYS

    OPS0997T >O>    CA OPS/MVS Subsystem SUBSYS

    OPS0997T >L>    is not active.

    OPS0997T >O>    CA OPS/MVS Subsystem SUBSYS is not active.

    OPS1000I CA OPS/MVS Subsystem SUBSYS is not active.

    OPS0997T - 13:     return



  • 6.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 26, 2016 04:51 PM

    Chris,

     

    Same outcome here in our labs and it makes perfect sense.

    The TOD rule is already running under the AOF environment hosted by the subsystem name that had initialized:

     

    OPC0997T *-* 6:trace i                                              

    OPC0997T *-* 7:address AOF "SUBSYS" OPSC                            

    OPC0997T >L>   AOF                                                  

    OPC0997T >L>   SUBSYS                                               

    OPC0997T >V>   OPSC                                                 

    OPC0997T >O>   SUBSYS OPSC                                          

    OPC4307E SUBSYS AOF command cannot be issued in a rule              

    OPC4304E AOF command SYNTAX ERROR: 'SUBSYS OPSC'                    

    OPC0997T +++    RC(16)                                              

    OPC0997T *-* 8:if RC <> 0 then                                      

    OPC0997T >V>   16                                                   

    OPC0997T >L>   0                                                    

    OPC0997T >O>   1                                                    

    OPC0997T *-* 10:    say "CA OPS/MVS Subsystem" subsys "is not active."

    OPC0997T >L>    CA OPS/MVS Subsystem                                

    OPC0997T >V>    SUBSYS                                              

    OPC0997T >O>    CA OPS/MVS Subsystem SUBSYS                         

    OPC0997T >L>    is not active.                                      

    OPC0997T >O>    CA OPS/MVS Subsystem SUBSYS is not active.          

    OPC1000I CA OPS/MVS Subsystem SUBSYS is not active.                 

    OPC0997T *-* 11:    return                                          

    OPC3900O RULE CUSTOM.TODDAILY FOR TOD 2016/04/27 16:38:00 SET      

     

    Now, your original code runs fine under a TOD rule:

     

    OPC0997T *-* 6:trace i                                                      

    OPC0997T *-* 7:Address AOF "List =NOSTATS"                                  

    OPC0997T >L>   AOF                                                          

    OPC0997T >L>   List =NOSTATS                                                

    OPC4320H OPSC2MN  OPSC *LOCAL* AOF verb LIST             command LIST =NOSTATS

    OPC0997T *-* 8:i=0                                                          

    OPC0997T >L>   0                                                            

    OPC0997T >>>   I=0                                                          

    OPC0997T *-* 9:Do While Queued() > 0                                        

    OPC0997T >L>   2147483647                                                   

    OPC0997T >F>   0                                                            

    OPC0997T >L>   0                                                            

    OPC0997T >O>   0                                                            

    OPC3900O RULE CUSTOM.TODDAILY FOR TOD 2016/04/27 16:43:00 SET               

    OPC3906I CCLXRULB                                                           

    OPC3906I CCLXRULM                                                           

    OPC3906I CCLXRULS                                                           

    OPC3906I CUSTOM                                                             

    OPC3906I STATEMAN                                                          

     

    So it still unclear what prevented it from producing the results you were looking for in the first time.

    Always use the TRACE I statement on rules or OPS/REXX code not producing the expected results.

    If that does not help then either start a new discussion or cut a new ticket so we can look at it closer.

     

    Regards, Cesar



  • 7.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 26, 2016 05:43 PM

    When I try to run it under the TOD without the SUBSYS it does nothing.   I am wondering if there is a parm set wrong somewhere.   The only place I can get the LIST command to function properly is as an external rexx with the SUBSYS command.

     

     

    )TOD *+2 seconds

    )INIT

    /**********************************************************************/

    /*)CMD TESTWTO */

    /*  Rule Type:     command                                            */

    /**********************************************************************/

    )PROC

    trace 'i'

    /* address AOF "SUBSYS OPSS"

    if RC <> 0 then

       do

         say "CA OPS/MVS Subsystem" subsys "is not active."

         return

       end */

     

    c=Opscledq()

    Address AOF "List =nostats"

    i=0

    Do While Queued() > 0

      Parse Pull msgid rset

      If substr(msgid,4,4) = 3906 Then Do

        i=i+1

        ruleset.i=rset

        say 'ruleset.i = ' ruleset.i

      End

    End

       return "accept"

     

    Trace

     

    OPS0997T - 8:trace 'i'

    OPS0997T - 16: c=Opscledq()

    OPS0997T >F>

    OPS0997T >>>    C=

    OPS0997T - 17:Address AOF "List =nostats"

    OPS0997T >L>    AOF

    OPS0997T >L>    List =nostats

    OPS4320H OPSMAIN  OPSS LOCAL AOF verb LIST             command LIST =NOSTATS

    OPS0997T - 18:i=0

    OPS0997T >L>    0

    OPS0997T >>>    I=0

    OPS0997T - 19:Do While Queued() > 0

    OPS0997T >L>    2147483647

    OPS0997T >F>    0

    OPS0997T >L>    0

    OPS0997T >O>    0

    OPS0997T - 28:  return "accept"

    OPS0997T >L>    accept

    DISABLE TEST.ONETIME

    OPS3900O RULE TEST.ONETIME  FOR TOD 2016/04/26 17:38:30 NOW DISABLED

    OPS3916I TOD rule TEST.ONETIME has been DISABLEd - all time criteria have expir

    OPS3906I CMD

    OPS3906I MSG

    OPS3906I REQ

    OPS3906I SEC

    OPS3906I SSM

    OPS3906I TEST

    OPS3906I TOD



  • 8.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 26, 2016 06:49 PM

    Hello Chris,

     

    I think I see now why you think you are not getting the complete expected results.

    When I run this very simple code from a OPS/REXX program using the !OI command processor: :

     

    /* REXX */

    address AOF "LIST =NOSTATS" 

    if RC <> 0 then             

      do                        

        say "Return Code was: " RC

        return                  

      end                       

    do while QUEUED() > 0       

       parse pull lne           

       say lne                  

    end                        

     

    The results are:

     

    OPC0996I OPC3906I CCLXRULB

    OPC0996I OPC3906I CCLXRULM

    OPC0996I OPC3906I CCLXRULS

    OPC0996I OPC3906I CUSTOM

    OPC0996I OPC3906I STATEMAN

     

    Now, when I use your code from the same !OI command processor environment the OPC3906I portion of the output above is striped off:

     

    Address AOF "List =NOSTATS"        

    i=0                                

    Do While Queued() > 0              

      Parse Pull msgid rset            

      If substr(msgid,4,4) = 3906 Then Do

        i=i+1                          

        ruleset.i=rset                 

        say 'ruleset.i = ' ruleset.i   

      End                              

    End                               

     

    OPC0996I ruleset.i =  CCLXRULB

    OPC0996I ruleset.i =  CCLXRULM

    OPC0996I ruleset.i =  CCLXRULS

    OPC0996I ruleset.i =  CUSTOM

    OPC0996I ruleset.i =  STATEMAN

     

    Also I  see the 'ruleset.i =' string that is part of the say statement.

    In the output you are getting from the TOD rule only the rule sets are listed:

     

    OPS3906I CMD

    OPS3906I MSG

    OPS3906I REQ

    OPS3906I SEC

    OPS3906I SSM

    OPS3906I TEST

    OPS3906I TOD

     

    And I do too only get the rule set names form the TOD rule as well:

     

    OPC3906I CCLXRULB                                                          

    OPC3906I CCLXRULM                                                          

    OPC3906I CCLXRULS                                                          

    OPC3906I CUSTOM                                                            

    OPC3906I STATEMAN                                                         

     

    Are you questioning the missing 'ruleset.i =' in the say statement when your code runs from the TOD rule?

    Or the message OPS3906I that shows you have 7 rule sets defined in this system is the output you are expecting?

     

    Regards, Cesar



  • 9.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 27, 2016 09:20 AM

    Address AOF from within rules will simply be shipped to the AOF queue and executed asynchronously. This is why you are not getting back the stat info 'in the rule' (EDQ=0). Need to have rule ship OPS/REXX pgm to server that does your desired AOF LIST command.  We need to also update doc to clarify how it works within rules.



  • 10.  Re: attempting to capture OPS3906I msg from List command, ver 12.1

    Posted Apr 27, 2016 10:23 AM

    I was not so concerned with the stat info as the fact that the AOF LIST cmd was not working as it appears it should.

     

    This code works perfect with an external rexx, but does not work at all in a rule.  I inherited these systems and want to make sure that all the parms are set correctly, so when it did not work in a rule, nor did the AOFSYS, I was really concerned.

     

     

      master_lst = ''

      c=Opscledq()

    Address AOF "List =nostats"

    i=0

    Do While Queued() > 0

       Parse Pull msgid rset

       If substr(msgid,4,4) = 3906 Then Do

         i=i+1

         ruleset.i=rset

         master_lst = rset master_lst

         say 'ruleset.i = ' ruleset.i

       End

    End

     

    say 'master_lst = ' master_lst

     

       return "accept"

    exit