ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

STRWCH and CPF1164

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • STRWCH and CPF1164

    I've created a watch job that monitors for CPF5140 and CPF1164. I use this watch job to check for when a user signs off or shuts down his system. It works 98% of the time; however, sometimes the watch job does not kick off even after I check the job log and see that the CPF1164 message was triggered.

    Here is the watch job:

    Code:
    STRWCH     SSNID(&JOB) WCHPGM(*LIBL/WCHJOBCL2) +           
                 WCHMSG((CPF5140) (CPF1164)) +                 
                 WCHMSGQ((*JOBLOG)) WCHJOB((&NBR/&USER/&JOB))
    Here is the part of the job log that shows the CPF1164 message was kicked off.

    Code:
    CPF1164    Completion              00   12/13/10  07:54:28.933072  QWTMCEOJ     QSYS        00D9     *EXT                    *N
                                         Message . . . . :   Job 710080/AA662/SCTY#LKBA1 ended on 12/13/10 at
                                           07:54:28; 1 seconds used; end code 30 .
                                         Cause . . . . . :   Job 710080/AA662/SCTY#LKBA1 completed on 12/13/10 at
                                           07:54:28 after it used 1 seconds processing unit time.  The job had ending
                                           code 30. The job ended after 1 routing steps with a secondary ending code of
                                           0.  The job ending codes and their meanings are as follows:  0 - The job
                                           completed normally. 10 - The job completed normally during controlled ending
                                           or controlled subsystem ending. 20 - The job exceeded end severity (ENDSEV
                                           job attribute). 30 - The job ended abnormally. 40 - The job ended before
                                           becoming active. 50 - The job ended while the job was active. 60 - The
                                           subsystem ended abnormally while the job was active. 70 - The system ended
                                           abnormally while the job was active. 80 - The job ended (ENDJOBABN command).
                                           90 - The job was forced to end after the time limit ended (ENDJOBABN
                                           command). Recovery  . . . :   For more information, see the Work Management
                                           topic in the Information Center,
                                           http://www.ibm.com/eserver/iseries/infocenter.
    I called IBM and inquired about this but they had no solutions.

    Any advice?

  • #2
    Re: STRWCH and CPF1164

    can you see a pattern to the jobs that dont trigger the watch.

    I did notice that the job ended abby normal (30) here -- could that be IPL, user closing session???

    not sure
    Jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: STRWCH and CPF1164

      No pattern so far. No IPL when this happened. The user just killed his session. I have tested the watch by killing a session and for me it works like a charm, but isn't that part of Murphy's Law?

      Comment


      • #4
        Re: STRWCH and CPF1164

        Everything I test always works
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: STRWCH and CPF1164

          Originally posted by jamief View Post
          Everything I test always works
          so you're admitting to never testing?
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: STRWCH and CPF1164

            Ok, I think I have the pattern.

            What is happening is that when a session gets terminated for AAA1 and the user immediately signs back on, the original STRWCH job for AAA1 has not completely terminated. So, the new STRWCH does not get executed because one already exists, the one that is ending.

            From the job log:
            Code:
            3300 - STRWCH SSNID(NEWYORKAA1) WCHPGM(*LIBL/WCHJOBCL2) WCHMSG((CPF5140 
            *NONE *MSGDTA) (CPF1164 *NONE *MSGDTA)) WCHMSGQ((*JOBLOG))             
            WCHJOB(('715991'/SAMSOND/NEWYORKAA1))                                   
            
            Session ID NEWYORKAA1 already exists.
            This is my solution.

            I will monitor for this:
            Code:
            Message ID . . . . . . :   CPF39E3       Severity . . . . . . . :   40       
            Message type . . . . . :   Escape                                            
            Date sent  . . . . . . :   12/13/10      Time sent  . . . . . . :   09:24:57
            If this occurs, I will issue and ENDWCH and end the job and then do the start watch. I think this should work.

            Comment


            • #7
              Re: STRWCH and CPF1164

              since it's bound to the job why not just create a unique session ID instead of using the job name?
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment


              • #8
                Re: STRWCH and CPF1164

                Oh, I see. If session AAAAA1 exist, then create AAAAA2 and have it use that.

                Comment


                • #9
                  Re: STRWCH and CPF1164

                  or use a defined prefix (like A) then a suffix which would be a sequential number (store the next number in a data area, etc, retrieve sequence number, increment, update the data area and use that number for the session ID) for example data area contains the number 1 (with the data area being 9,0 numeric) in your program the current session ID would be A000000001, then increment the data area value to 2, the next job would generate a session ID A000000002, etc etc...
                  I'm not anti-social, I just don't like people -Tommy Holden

                  Comment


                  • #10
                    Re: STRWCH and CPF1164

                    Why don't using the job number with a letter before ?
                    Patrick

                    Comment


                    • #11
                      Re: STRWCH and CPF1164

                      Originally posted by K2r400 View Post
                      Why don't using the job number with a letter before ?
                      that works too as long as the session ID is unique it doesn't matter...your idea is better than mine but i'm feeling particularly unmotivated today...
                      I'm not anti-social, I just don't like people -Tommy Holden

                      Comment


                      • #12
                        Re: STRWCH and CPF1164

                        Ok, so, now I have the session name issue working; however, there are times when the watch job will not run when the CPF1164 is tripped and it looks like this is the case when the ending code is other than 0(zero). Any way to get it to trip no matter the ending code? I am starting to have to clean up orphan watch jobs that were called but never tripped.

                        Comment


                        • #13
                          Re: STRWCH and CPF1164

                          i haven't ever used watches, i just pointed out the obvious issue. maybe this will be of some help. http://ibmsystemsmag.blogs.com/i_can...h-watches.html from a cursory glance killing the QSCWCHMS batch job might fix it ( or simply do an IPL).
                          I'm not anti-social, I just don't like people -Tommy Holden

                          Comment


                          • #14
                            Re: STRWCH and CPF1164

                            I am going to contact IBM today. From the job logs I can see that CPF1164 goes off but the watch job doesn't trip. It works about 95% of the time. The failures create lots of orphan watch jobs.

                            Comment


                            • #15
                              Re: STRWCH and CPF1164

                              I got IBM involved and they provided some little known facts about STRWCH that weren't published; however, after I made the changes all hell broke lose with the watch and I have a bunch of IBM people on the system looking it over. The problems with the watch are not the results of the changes suggested by IBM. The watch jobs went haywire. It may or may not be a coincidence that IBM was on the system when this happened.

                              I will post the results and the tips when I have things working. I don't want to provide items that don't work.

                              Comment

                              Working...
                              X