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



Actually you do not need a CL program.  You could easily do it with a 
display file in the program.  Or you could write a CMD object to run the 
program.  For example these few lines of code would generate a screen that 
would prompt a person for the screen and then pass that as a parameter to 
the RPG program
CMD        PROMPT('Prompt for warehouse') 
PARM       KWD(WAREHOUSE) TYPE(*CHAR) LEN(2) RSTD(*YES) +
             VALUES('01' '02') MIN(1) PROMPT(WAREHOUSE) 
Then you could do a CRTCMD against those lines of code. 

More detailed steps:
CRTSRCPF mylib/QCMDSRC     (if not already there)
WRKMBRPDM mylib/QCMDSRC
F6 to create  I suggest one of two things:  1 - name the command the same 
as the program (if the user doesn't have to remember the name because it's 
called from a menu or CL program), 2 - Give it a name that the users 
groove on.
Add those above lines.
Compile it.
Then, instead of calling your RPGLE program with the CALL command you type 
in the name of this new command, WITH NO CALL! and you now have a prompt 
screen with edit checking.
Rather crude for adding new warehouses, granted.  At that point you can 
either continue to use a command and add a "Prompt Override Program" or 
configure a display file in your RPG program and do it there.  You may 
decide to break up your RPG program into two programs.  One will do the 
prompting.  The second one will be as you already have written.  The 
benefit of that is that if you want to run it in batch you can bypass the 
first program that does the prompting.

Most people aren't used to using a CMD object to front end a RPG program 
directly.  Most people use them to run a CL program first.  And, there are 
some that never call a RPG program without wrapping it in a CL program. In 
fact, I've worked with CASE tools that insist on this.  However, I say, 
that if you are going to call a rpg program anyway, just call it without 
the CL.  RPG can execute commands just as easily.  It can also do many of 
the overrides using F spec keywords that many people often did in CL.

Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.