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



Hi all,

I have an RPGLE program with the prototype and interface coded as

d SB0010 pr
d 8a const options(*nopass)
d 3p 0 const options(*nopass)

d SB0010 pi
d dateToProcess 8a const options(*nopass)
d storeToProcess...
d 3p 0 const options(*nopass)

I created a command wrapper

CMD PROMPT('SBT Workflow driver')
PARM KWD(DATE) TYPE(*CHAR) LEN(8) MIN(0) +
PROMPT('Date to process +
(YYYYMMDD)')
PARM KWD(STORE) TYPE(*DEC) LEN(3) MIN(0) +
PROMPT('Store')

So I want to be able to call the program from the command in one of three ways.

1. SB0010CMD (no parameters)
2. SB0010CMD DATE('20141015')
3. SB0010CMD DATE('20141015') STORE(25)

In the RPG program I have

Select;
When %Parms = 0;
fromStore = 1;
toStore = 999;
currentDate = %Date();
When %Parms = 1;
fromStore = 1;
toStore = 999;
currentDate = %Date(dateToProcess: *iso0);
When %Parms = 2;
fromStore = storeToProcess;
toStore = storeToProcess;
currentDate = %Date(dateToProcess: *iso0);
Other;
Return;
Endsl;

When I test this in debug no matter how I call it %Parms is always zero. But I have noted that the first parameter (in debug) does have the correct value although this may be a fluke.

I have a feeling that the issue is that the operational descriptor is not being passed (I'm assuming this from what I've been able to find on the internet). I didn't think this was going to be so difficult.

Am I over looking something very simple? If not, does anyone have another simple solution?

Thanks,

Rob



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.