× 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: Passing Parms to an RPG Program
  • From: "Bale, Dan" <DBale@xxxxxxxxxxxxxxxx>
  • Date: Thu, 23 Mar 2000 16:21:28 -0500

You are, of course, correct.  

However, in the typical course of my job, I may be testing something like
this that is a program to program call; it's already been coded, it's in
production, somebody finds a problem, the easiest way to test in this
particular situation is to call it from the command line.  For this, I am
not going to copy the source, change the *entry parameter to 15,5, recompile
in my test library, and run my test version from the command line.  I'm not
even sure that writing a temporary shell program to feed a numeric parameter
to pass to the intended program is worth the effort.  Just pass x'1234567F'.
Now, if this turns out to be something that I'll be using more than a few
times, then, yes, I'll write the CL shell, maybe even a command.

No user of mine will ever be expected to use hexadecimal, and I've already
stated that if there is a user function that they are allowed to call from
the command line, instead of a menu option, then it will always be a
command, not a "Call pgma parm(...)"

- Dan Bale

-----Original Message-----
From: bmorris@ca.ibm.com [mailto:bmorris@ca.ibm.com]
Sent: Thursday, March 23, 2000 2:44 PM
To: RPG400-L@midrange.com
Subject: Re: Passing Parms to an RPG Program


This is definitely a FAQ, but it sure doesn't have a
FGGA (frequently given good answer).

Why is it better to pass numeric parameters as character
and convert them within the program?  Is it easier to
code '9' or '0000000009' than 9?  Is it easier to parse
'-1.5    ' than code a packed(15,5) parameter to receive
-1.5 directly?

Knowing how to code the hexadecimal representation of a
numeric value is important, but surely not required for
a beginner who just wants to know how to call a program
successfully.

Does anyone actually have production programs that are
called with CALL from the command line?  Aren't programs
called from the command line only for testing?  And for
testing, it's surely easier to temporarily change parameters
to packed(15,5) and copy the values to the "real" parameters,
or possibly write another program to receive the packed(15,5)
and pass them on to the tested program.

Why not just accept the fact that numeric parms are passed
from the command line as packed(15,5) and when a simple
question is asked, give a simple answer: "define the parm
as packed(15,5) and copy it to the program variable".

Certainly don't give an answer that is either incomplete
(e.g. "put quotes around the number") or wrong (e.g. "define
the parameter as zoned").

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