|
I think your problem is in your statement My program gets a data decimal error because on some of the parameters, it picks up the double quotes as part of the parameter If you are sending a numeric parameter (that is, the CL is expecting it to be numeric), you don't need the " characters around the variable. So, if (for example) your third parameter is numeric, you should build your string as EVAL CMD = 'SBMJOB CMD(CALL PGM(PGMNAME) ' + 'PARM("' + Parm1 + '" ' + '"' + Parm2 + '" ' + + Parm3 + ' ' + '"' + Parm4 + '"))' + ' JOB(JOBNAME)' Alternately, you can send all your parameters as characters, then changethose in the CL that need to be numeric. "Wills, Mike N. (TC)" <MNWills@taylorcorp.com> on 08/05/2001 05:17:15 Please respond to RPG400-L@midrange.com To: "'RPG400-L@midrange.com'" <RPG400-L@midrange.com> cc: (bcc: STEVEN J RYAN/DIAU) Subject: Building a CL command in a RPG Program (Help!) I am trying to build a CL call command within a RPG program with four parameters. I cannot get the command to work. I am modifying a program and for some reason unable to debug it to verify the command is right. What is the proper syntax for putting quotes around parameters? This is the command I want to call: SBMJOB CMD(CALL PGM(PGMNAME) PARM('PARM1' 'PARM2' 'PARM3' 'PARM4')) JOB(JOBNAME) This is the code I have to build it: EVAL CMD = 'SBMJOB CMD(CALL PGM(PGMNAME) ' + 'PARM("' + Parm1 + '" ' + '"' + Parm2 + '" ' + '"' + Parm3 + '" ' + '"' + Parm4 + '"))' + ' JOB(JOBNAME)' The command is being passed to a CL where is then uses QCMDEXC to execute the command. My program gets a data decimal error because on some of the parameters, it picks up the double quotes as part of the parameter (ex. A date field would look like "0501200). Thanks for any help! Mike +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.