SBMJOB command: AS/400 job not found

20 pts.
Tags:
AS/400
AS/400 jobs
SBMJOB
I have submitted job using command SBMJOB in RPG Program though QCMDEXC. But sometimes it's not working after submitted. SBMJOB CMD (call pgm (xyz) parm (&a &b)) Apart from above CMD, I need to specify anything else? Please advice.

Software/Hardware used:
software
ASKED: June 6, 2013  3:43 AM
UPDATED: August 27, 2013  7:02 PM

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: 10  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
  • TomLiotta
    But sometimes not working...
    .
    What isn't working? What happens? Is there an error? What is the error?
    .
    If the job can't be found, how do you look for it? How do you know the job didn't finish? Maybe it finished and it's not in the system anymore.
    .
    We need to know what your problem is before we can help.
    .
    Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    This may be trival .. but we don't know what knowledge you have. Smbjob sends the job to a particular jobq based on the jobd. If the jobq is Assigned to an active subsystem and not on hold then the subsystem will pick up requests from the Jobq based on the subsystems rules. So a job may run immediately or after other jobs or it may be on hold forever depending on the jobq. Here is a sample of the command 1730.00 C CALL 'QCMDEXC' 1731.00 C PARM SBMJOB 1732.00 C PARM CMDLEN 15 5 Where SBMJOB contains the actual command string. It cannot contain refereces to variables in the calling program. And CMDLEN should be the lenght of the command string. When the job does run it might take a second, if the program isn't found in the jobs library list or it could take hours if it contains enough work to keep it running. The original job from which you are submitting the new job will not wait for the new job to run or complete and will not detect an error in the new job.
    48,545 pointsBadges:
    report
  • TomLiotta
    Though it could be done through RPG, it looks like it's done in a CL program. That means that program variable references can be used in the command. -- Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    I would call QCMDEXC a red herring? Yes, the variables in the call would work. So submitting a job requires that it goes to a jobq and becomes active when the jobq rules activate it. And then the job needs to find the required program in the jobs library list.
    48,545 pointsBadges:
    report
  • philpl1jb
    Not jobq rules, jobq is not on hold, subsystem is active and then jobs are selected based on the subsystem rules.
    48,545 pointsBadges:
    report
  • TomLiotta
    Sheesh... yes, I decided to re-read the question, and you were right that it's an RPG question. I kept seeing the format of SBMJOB and was blinded. . The way SBMJOB is shown in the question is not valid. It can't be done with "&a" and "&b" in RPG because they don't exist. Those are only available in CL programs. . Man... and I just washed my glasses a couple days ago. . Tom
    125,585 pointsBadges:
    report
  • SBMJOB
    From SBMJOB, i have call pgm (xyz) to create some transaction into a file. But after submit the file is empty, which mean the calling not function. I'm wondering why the SBMJOB sometimes work and sometimes not work even same data using. I have no idea what caused this.
    20 pointsBadges:
    report
  • TomLiotta
    First, we need to see how the SBMJOB is executed. You need to show the source statements that run SBMJOB and all variable definitions used by those source statements. . Next, we probably need to see the joblog messages from the program that runs SBMJOB. It might be enough to see the programming, but any errors for the SBMJOB command will be in the joblog when the command is run. . Until we see how you are doing it, we can't do anything but make guesses, and there can be thousands of guesses possible. . Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    When you submit a job it may run immediately but it may not (see discussion above) If the parent program needs the results of the child program before proceeding then do not use sbmjob Just call the child program from the parent.
    48,545 pointsBadges:
    report
  • TomLiotta
    BTW, the joblog of the submitted job is the first place you should look. If an error caused a failure, it should show in the joblog. -- Tom
    125,585 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