RPG concept rich displays not used command SBMJOB to QBATCH

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
iclassic
New User
Posts: 16
Joined: Thu Dec 07, 2017 10:13 pm
First Name: chatchawan
Last Name: phuttha
Company Name: AYCAL
City: bangkok
Country: Thailand
Contact:

RPG concept rich displays not used command SBMJOB to QBATCH

Post by iclassic »

Error used command SBMJOB to qbatch
Attachments
RPG back end not Command SBMJOB call pgm.pdf
(225.7 KiB) Downloaded 150 times
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: RPG concept rich displays not used command SBMJOB to QBATCH

Post by Scott Klement »

You haven't provided much information, here... and your question doesn't appear to have anything to do with Rich Displays. (The SBMJOB command is an IBM command, it is not part of Profound UI.)

View the job log, it'll tell you what is causing the error.
DanD
Profound User
Posts: 42
Joined: Wed Jun 14, 2017 12:06 pm
First Name: Dan
Last Name: Devoe
Company Name: Boston Warehouse Trading
State / Province: Massachusetts
Zip / Postal Code: 02062
Country: United States
Contact:

Re: RPG concept rich displays not used command SBMJOB to QBATCH

Post by DanD »

FWIW - I have a few programs that submit jobs, albeit not to QBATCH.

I have a service program which contains procedure "sbmjob". I'm simply returning if there was an error when issuing the command - you can go much further & look @ the PSSR

When submitting, from the Rich Display program RPG source, my code looks similar to this (note that "Button_OK" is a procedure inside a service program that displays a rich display window):
RPG CODE
if sbmjob('cmd(call pgm(myprogram) parm(''' + %trim(Parameter1) + ''' ''' + %trim(Parameter2) + ''')) +
         job(myjob) jobq(qusrnomax)');
   Button_OK('Error submitting My Program');
else;
   Button_OK('My Program submitted');
endif;

RPG CODE
//***********************************************************************
dcl-proc sbmjob export;                    // sbmjob

dcl-pi *n ind;
   qcmd  char(5120) options(*varsize) const;
end-pi;

monitor;
   qcmdexc('sbmjob ' + qcmd: %len(qcmd));
on-error;
   return *on;
endmon;

return *off;

end-proc;
As Scott alluded to, please post your job log - or a code snippet.
iclassic
New User
Posts: 16
Joined: Thu Dec 07, 2017 10:13 pm
First Name: chatchawan
Last Name: phuttha
Company Name: AYCAL
City: bangkok
Country: Thailand
Contact:

Re: RPG concept rich displays not used command SBMJOB to QBATCH

Post by iclassic »

Successful, thank you for your support.
iclassic
New User
Posts: 16
Joined: Thu Dec 07, 2017 10:13 pm
First Name: chatchawan
Last Name: phuttha
Company Name: AYCAL
City: bangkok
Country: Thailand
Contact:

Re: RPG concept rich displays not used command SBMJOB to QBATCH

Post by iclassic »

Scott Klement wrote:You haven't provided much information, here... and your question doesn't appear to have anything to do with Rich Displays. (The SBMJOB command is an IBM command, it is not part of Profound UI.)

View the job log, it'll tell you what is causing the error.

Successful, thank you Scott for your support.
DanD
Profound User
Posts: 42
Joined: Wed Jun 14, 2017 12:06 pm
First Name: Dan
Last Name: Devoe
Company Name: Boston Warehouse Trading
State / Province: Massachusetts
Zip / Postal Code: 02062
Country: United States
Contact:

Re: RPG concept rich displays not used command SBMJOB to QBATCH

Post by DanD »

I'm glad that you got this to work.

I noticed a flaw in the logic that I was using (it worked, but I'm unsure how). The command length wasn't taking into consideration the "sbmjob ' prefix.

Code has been modified as follows:
RPG CODE
//***********************************************************************
dcl-proc sbmjob export;                    // sbmjob

dcl-pi *n ind;
   qcmd  char(5120) options(*varsize) const;
end-pi;

dcl-s sbm_qcmd like(qcmd);

sbm_qcmd = 'sbmjob ' + qcmd;
monitor;
   qcmdexc(sbm_qcmd: %len(sbm_qcmd));
on-error;
   return *on;
endmon;

return *off;

end-proc;
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest