I have somewhat convoluted series of programs that is used to email
shipping documents and invoices to customers. Our billing process runs a
CL program that (naturally) calls RPG. In the RPG program I use QCMDEXE
to put together a long string of 7 parameters to call another CL program
which uses software called BLUESERIES to actually do the emailing (and
As I struggled to put this together, I had trouble getting RPG to string
the commands together with quotes and parentheses, etc. I don't remember
all the methods I tried.
I created a command to call the last CL program. RPG calls the CMD with
parameters, which runs the CL program and the documents get emailed.
Customers are happy, billing dept is happy, life is good.
Then one of our customers has an email address with a hyphen in it. The
CMD blows up.
"Message . . . . : Expression operator not allowed for parameter EMAIL.
Cause . . . . . : An expression operator was found immediately before or
after a character string with no intervening blanks on a parameter
not support expressions. Character string expressions are only allowed in
CHGVAR commands, IF commands, or a parameter defined with EXPR(*YES).
Arithmetic, relational, and logical expressions are only allowed on the
CHGVAR and IF commands. Recovery . . . : Remove the expression
or insert a blank between the operator and the character string. More
information on expression operators can be found in the CL Reference
Is there an easy way to edit the CMD parameters as part of the CMD? Or
if I edit in RPG and find a hyphen, what can I do to pass it correctly?
This whole thing took me a while to get working and for some reason, I
could not set up the QCMDEXE call correctly with the 7 parameters if I
had to "CALL MYCLPGM (parm1 parm2 parm etc). But I could with the CMD.
So to recap in reverse, the final step is a CL program that receives
parameter of email address, customer name, type of document to send. It
creates a path statement and runs BLUESERIES to send/fax the documents.
A CMD is used to fire off the CL program. If the email address has a
hyphen in it, the CMD bombs.
An RPG program calls the CMD