STRSRVJOB not working for a batch job.

25 pts.
Hi there,

-  I submitted a job with HOLD(*YES)

- I did STRSRVJOB for the held job.

- I released the job with option '6' on the 'Work with Submitted Jobs' screen. Job did not stop to press F10 and enter STRDBG!!!

- I tried to do STRDBG right after the STRSRVJOB, I got error "Command is not allowed while serviced job is not active"

- I released the job, the job went on without stopping!!!

STRSRVJOB will not allow enter STRDBG or STRISDB while job is held, and it won't stop the job after it is released to enter a STRDBG or STRISDB command.

Am I doing something wrong?


Answer Wiki

Thanks. We'll let you know when a new response is added.

You should be able to do the STRSRVJOB, and STRDBG commands while the job is in the JOBQ. You cannot add a breakpoint until the job starts to execute.
Once you have done the two commands above, you can release the job in the Queue.
Then you screen should break and you need to enter DSPMODSRC to put in your breakpoints.
If you did a STRSRVJOB and rhe program ended, you need to do ENDSRVJOB and start a new one if you submitted a new job to the job queue.
Remember each job haqs it’s own unique job number.

Discuss This Question: 5  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.
  • Adassaad
    thanks for the reply. I'm sure of the job number because the I copy and paste the job qualifier from the submit message while the job is held by the JOBD with Hold(*YES .). I do the STRSRV and paste the 'Job 642482/user/jobname', it takes it w/o problem. Job still on hold on jobq, I enter STRISDB PGM(pgmname) UPDPROD(*YES) INVPGM(*NO). The job is held on the jobq, I get these errors: Error occurred setting the first breakpoint. Command is not allowed while serviced job is not active. Errors occurred on command. .
    25 pointsBadges:
  • Teandy
    If this is a CL add this line of code at the start of your program.. DLYJOB DLY(60). This will give you 60 seconds after the job is submitted to start the service job and then start DEBUG. If you need more time, just increase the number of seconds you want the job to wait. If this is an RPGLE program you can delay the job like so:
    D  CMD            S           3000A   VARYING 
     * PROTOTYPE FOR QCMDEXEC API (EXECUTE COMMAND)                         
    D QCMDEXC         PR                  ExtPgm('QCMDEXC')                 
    D   COMMAND                   3000A   const options(*varsize)           
    D   Length                      15P 5 const                             
      CMD = 'DLYJOB DLY(60)';            
    5,860 pointsBadges:
  • CharlieBrowne
    After the STRSRVJOB try STRDBG pgmname UPDPROD(*YES)
    62,385 pointsBadges:
  • Adassaad
    Thanks for the help Charlie. I got it working after I quit trying to do STRISDB and signed off then on then dis STRSRVJOB then STRDBG (not STRISDB). Of course I had to recompile all OPM programs with OPTION(*SRCDBG) after I couldn't see the code with STRDBG. I like STRISDB for the OPM programs because of F13 availaibilty (Run to cursor) which I could not do with STRDBG. Thanks again.
    25 pointsBadges:
  • TomLiotta
    If you insist on doing things the hard way, try using SEPs through the green-screen -- Debugging RPG IV Programs -- The Green-Screen Way. Maybe that will help you work out how to get the jobs to stop when you want them to. Tom
    125,585 pointsBadges:

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.

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


Share this item with your network: