Problem solve Get help with specific problems with your technologies, process and projects.

A controlling program for canceling a submitted job

I want to create a (controlling) program which submits another job and cancels the submitted job occasionally. I believe that to cancel the job successfully the controlling program has to know the submitted job's job number. Is there any way to get job number of the submitted job when the controlling program submits the job?

When the job is submitted, it will generate a message CPC1221 stating that "Job 000000/USER/JOBNAME was submitted to..." You can retrieve that message from the program message queue using a RCVMSG and strip out the job number. There are some examples in the CL users guide found at the AS/400 books library.

Dig Deeper on RPG iSeries programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.