× 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: "Wills, Mike N. (TC)" <MNWills@xxxxxxxxxxxxxx>
  • Date: Tue, 8 May 2001 08:22:28 -0500

All,

After I wrote in I realized that this is how I should have built it. (Man I
was tired) That part now works good. The reason for using a CL is because I
am modifying a program and I don't want to change how it works (so I don't
break anything). If I was writing the program from scratch I would have done
it differently.

Thanks for all the help!

Mike

-----Original Message-----
From: Peter Dow [mailto:pcdow@yahoo.com]
Sent: Monday, May 07, 2001 9:29 PM
To: RPG400-L@midrange.com
Subject: Re: Building a CL command in a RPG Program (Help!)


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
+---
+---
| 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 ...

Follow-Ups:

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.