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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SBMJOB in free-format

Status
Not open for further replies.

George221

MIS
Dec 2, 2005
50
US
Would anybody have an example of sbmitting a job through QCMDEXC in free format? Dealing with the parm list and quote issue?
Thanks.
 
Here is an RPG IV prototype for the QCMDEXC API:

Code:
      ** Prototype definition for QCMDEXC                         
     D Runcmd          PR                  EXTPGM('QCMDEXC')      
     D  Cmdstr                     3000A   CONST OPTIONS(*VARSIZE)
     D  Cmdlen                       15P 5 CONST                  
     D  Cmddbcs                       3A   CONST OPTIONS(*NOPASS)

You should define the command string as Varying, like this:

Code:
     D Command_String  S           3000A   Varying

To get around the quote issue, I define a quote as a named constant:
Code:
     D Quote           C                   ''''

In free format, you would do something like this:

Code:
       Command_String = 'SBMJOB CMD(CALL PGM(MYPGM) PARM(' + 
       Quote + parm1 + quote + '))';      
       Runcmd(Command_String : %LEN(%TRIMR (Command_String)));

Solum potestis prohibere ignes silvarum.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top