Test of running programs

5 pts.
Tags:
AS/400 jobs
Before starting RPG program (PROGA) I need to check if the other given programs are running (for instance PROGB and PROGC). (PROGB, PROGC could be start in interactive or batch jobs by different users.) Can you let me know how to do it ? Thanks a lot.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Unfortunately Program objects aren't locked when in use. A modification to PROGB and PROGC to lock data area's named DATAB and DATAC would be detectable by PROGA but it would also prevent multiple versions of PROGB and PROGC from running.
    49,840 pointsBadges:
    report
  • TomLiotta
    Programs can be locked, but locks don't affect whether the programs can run. However, other programs can test the locks to make decisions. . If PROGB runs, the first thing it should do is run ALCOBJ against itself to set a *SHRUPD lock. PROGC should do the same for itself. . When PROGA wants to run, it can attempt to set *SHRNUP against PROGB and PROGC. If it succeeds, then it can continue to run. If it fails, it can wait and try later or send a message and quit. . Because *SHRNUP and *SHRNUPD are mutually exclusive, both PROGB and PROGC will be blocked from running if PROGA has already started. Those programs will have to handle the mutually exclusive condition just like PROGA. So if they try to lock themselves and fail, they need to decide how to run later. . Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Cool.
    49,840 pointsBadges:
    report
  • ToddN2000
    vey cool... Never would have though to try that. Nice alternative to using the dataarea which could have issues if job fails and it's not reset properly.
    9,905 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following