Within a SQL member on the iseries, I need to submit a job using a call to the QCMDEXC object. Nothing I have tried has been successful. The Option 1 code snippet I have attach produces an error that says string not delimited. I know this command will not work from an iseries command line. If I change the call to Option 2, which does work from a command line, I get Token QCMDEXC and Token PARM not valid. What am I doing wrong?

I believe that you need two parameters to this call, a string and a float.

Put a comma after the string terminator and before the 0000000103.00000.

Good Luck,
Kent

0

DebeGProgrammerAuthor Commented: 2008-06-12

Kent, I have tried this command with the comma, and did just try again to confirm, but I still get the string constant not delimited error. I can also tell you that if I change the command to the Option 3 code snippet, that the code works fine. I need to add the other variables to the call though. I have tried just adding one additional variable to the call and it is back to the issue with not being delimited.
Thanks for the suggestion though.

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Hi
it is not easy to call qcmsexc from with-in SQL. The easiest way to do what you want is to create a cl program, you can call it
CNSHPPUCB in library T_SESLIBWL.
this will simply hold your command
pgm
SBMJOB CMD(CALL PGM(T_SESLIBWL/CNSHPPUC))
endpgm

then in you source file you can simply use
CALL T_SESLIBWL/CNSHPPUCB.

Ths will call the new program that will inturn submit the job.
Failing that you will have to regsiter qcmdexc as a stored procedre - not hard

Dave

0

DebeGProgrammerAuthor Commented: 2008-06-13

Dave

I had already created the procedure using the following command:
CREATE PROCEDURE QSYS/QCMDEXC(IN :CMDSTR VARCHAR(1024),IN :CMDLENGTH DECIMAL(15,5)) EXTERNAL NAME QSYS/QCMDEXC LANGUAGE C GENERAL

I actually created the QSQLSRC source file as 240 because I thought the problem I had might have something to do with scanning across multiple lines. That didn't help. When I qualify the QCMDEXC with QSYS/QCMDEXC, I get Qualified object name QCMDEXC not valid, and I still get the position 19 string constant beginning 'SBMJOB P' not delimited.