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.
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.
Comment