ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to best handle this

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

  • How to best handle this

    Good morning, we have a program that gets called at various locations that workers use to clock in. The sign on to the AS400 is the same for all locations but activates a job with the workstation ID specific to that location. It does a simple WRITE of a display file format, then a read when someone scans to clock in. When I have a WRITE error (1299), I write to my log file with a counter, so if it happens 5 times it ends the program. It seems to only hit this WRITE error once, then the READ of the screen attempts multiple times to the point it maxes out the message queue. The job doesn't really end until someone logs on and ends it.

    I wanted to make something automated that would restart the program within the job if it errors, so users can continue to clock in especially during nights and weekends.

    I was thinking of adding a flag to the program, so when it errors I would populate the flag and end the program. In the CL over this program I would check for a value in my error flag after the call program command. If the flag is populated, I would wait a few seconds, clear the flag then call the program again.

    Does that seem simple enough or are there other things to consider?

    Thanks in advance.

  • #2
    I don't understand why you are going down that route. I'm not sure what the error 1299 is (if this was the RPG forum, I'd assume it was the error returned by the %Status BIF - an I/O error)? If this is an I/O error, why are you getting it in the first place? Why are you attempting the read after when your program obviously knows there is an error? Surely fixing the program to prevent or handle errors would be a better alternative?
    Last edited by john.sev99; March 13, 2017, 01:57 PM.

    Comment


    • #3
      Yes, this is confusing. Seems to be an RPG question but in the CL forum.

      If RPG, are you doing a workstation timeout? Otherwise, I think you would just do an EXFMT, not separate WRITE and READ.

      Ringer

      Comment


      • #4
        Originally posted by 64waves View Post
        Does that seem simple enough or are there other things to consider?
        First, yes, it seems simple enough. But second, I'm pretty sure there are other things to consider.

        Any complex situation might be reduced to a simple overview description. That description is often "simple enough" even though it might only provide discussion context. After that, any number of alternative paths can lead toward implementation details.

        Each potential path can lead through details to consider. Different paths may have unrelated details.

        IOW, there's little help that can be provided here until some detail is added. A particular detail should be info about the specific error. Code that experiences the error, related joblog messages, description of what happens at the clients around the time of an error, and possibly other elements should be included.
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment

        Working...
        X