|
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
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.