× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Building a CL command in a RPG Program (Help!)
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Mon, 7 May 2001 19:28:35 -0700

Hi Mike,

It looks like you're using double quotes in your eval, so the resulting
command string would be

SBMJOB CMD(CALL PGM(PGMNAME) PARM("PARM1" "PARM2" "PARM3" "PARM4"))
JOB(JOBNAME)

which the command processor would not like. The quickest way to fix it would
be to use SEU to change all occurrences of " to ''.  A better way might be
to define a constant called Quote:

d Quote    c            x'34'     or
d Quote    c            ''''

then change your eval to

EVAL CMD = 'SBMJOB CMD(CALL PGM(PGMNAME) PARM(' +
            Quote + Parm1 + Quote + ' ' +
            Quote + Parm2 + Quote + ' ' +
            Quote + Parm3 + Quote + ' ' +
            Quote + Parm4 + Quote + '))' +
            ' JOB(JOBNAME)'

hth,
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


----- Original Message -----
From: "Wills, Mike N. (TC)" <MNWills@taylorcorp.com>
To: <RPG400-L@midrange.com>
Sent: Monday, May 07, 2001 12:17 PM
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.