Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Waiting for SBMJOB to finish

Status
Not open for further replies.

RedMage1967

Programmer
Mar 13, 2003
200
US
Is there a way to have a program wait until a batch jobs completes? Example, Program A does a sbmjob cmd(call pgm(programb)). I need program A to wait until program B completes is batch processing. Is there a way in the CL of program A to make this happen?

RedMage1967
IBM Certifed - RPG IV Progammer
 
Create and lock a data area of file in program a. Have program b attempt to acquire it (in a cl?) using ALCOBJ.
 
Ok, now here's the monkey wench. Would the same thing work if Program A is a Visual Age RPG program running on my desktop?

RedMage1967
IBM Certifed - RPG IV Progammer
 
That's the idea that hit me heading home last night. Instead of having the VRPG program do the sbmjob, I'm going to write a CLP that will 1) change the data area to show I'm running my formating program; 2) the formatting program will change the data area to indicate that's it's completed it's job; 3) the CLP will wait until the data area's been modified.

Thanks for the help, jack1955.

When you mentioned data area in your previous post, kinda got the dust knocked off of the memory cells here.

RedMage1967
IBM Certifed - RPG IV Progammer
 
As silly as this may sound, why is pgm A submitting pgm B then waiting until pgm B finishes. Why not just call pgm B?
 
OK. Here's the problem I had with this app.

First of all, it's a Visual Age RPG (VARPG) application that enables my production manger to do reprints on three different types of statements. This app calls one of three different RPG ILE programs on the As/400, depending on what type of statement is selected. These ILE programs create a SPLF of the statement, then copy that SPLF back into a PF so I can do further manipulation on the file (put into tray sequence, add Xerox and insterter commands, etc).

What was happening is I was getting a SYSOPR message saying the SPLF could not be found. In researching the problem I found that when using VARPG to call the ILE programs, the SPLF's (for some oddball reason) have a different qualified job name than the programs that created them. When the ILE programs are sent to batch, the SPLF's are under the same job as the ILE program creating them. That's why I have to have the VARPG program call a CLP program that does a SBMJOB on one of the three ILE programs. Otherwise, I can't get to my SPLF output.

Hope this makes sense.

RedMage1967
IBM Certifed - RPG IV Progammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top