|
What are my options for modifying this program to return an additional 10 output parameters? At this point, let's say I already have a change management application that helps me promote my code changes from development to test/QA to production. Typically, this change management application simply overlays the old object with the new, right? Well, what happens if I need to be able to deploy multiple versions of this program throughout a development life cycle? How do I keep this old copy in a deployable state while also making changes and creating new versions of it over time?
For example:
if %parms >= 51;
eval PARM51 = DBFIELD51;
endif;
if %parms >= 52;
eval PARM52 = DBFIELD52;
endif;And so on...
P Price_calc b export
D Price_calc pi 1N
D ItemNo 5P 0 value
D CustAcct 4P 0 value
D Price 5P 2
/free
chain CustAcct PRICEZONE;
if not %found();
SetError(PRICE_ERROR_CUSTNF
:'Customer not found in Price Zone file');
return FAIL;
endif; chain (ItemNo: PrZone) PRICES;
if not %found();
SetError(PRICE_ERROR_ITEMNF
:'Item not found in PRICES file.');
return FAIL;
endif; price = prPrice;
return SUCCESS;
/end-free
P EYour binding source for the service program look slike this:
STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('PRICER4 V1.00 ')
EXPORT SYMBOL(Price_Calc)
... other exports here ...
ENDPGMEXPYou can now add a 2nd subprocedure that works the new way:
P Price_calc_v2 b export
D Price_calc_v2 pi 1N
D ItemNo 5P 0 value
D CustAcct 4P 0 value
D Price 7P 2
... code is the same as previous example, but Price
is now 7P 2...
P E P Price_calc b export
D Price_calc pi 1N
D ItemNo 5P 0 value
D CustAcct 4P 0 value
D Price 5P 2 D tempPrice s 7P 2
D RC s 1N
/free RC = Price_calc_V2(ItemNo: CustAcct: tempPrice);
if (RC = FAIL);
return FAIL;
endif; Price = *HIVAL;
if (tempPrice > Price);
SetError( PRICE_ERROR_TOOHIGH
: 'This routine can''t handle prices above '
+ %char(Price) + ' use V2 instead!');
return FAIL;
endif; Price = tempPrice;
return SUCCESS;
/end-free
P EThe new symbol must be added to the END of the binder language source:
STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('PRICER4 V1.00 ')
EXPORT SYMBOL(Price_Calc)
... other exports here ...
EXPORT SYMBOL(Price_Calc_V2)
ENDPGMEXPThen make your binding language look like this:
STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('PRICER4 V1.01 ')
EXPORT SYMBOL(Price_Calc_OldV1)
... other exports here ...
EXPORT SYMBOL(Price_Calc)
ENDPGMEXP
STRPGMEXP PGMLVL(*PRV) SIGNATURE('PRICER4 V1.00 ')
EXPORT SYMBOL(Price_Calc)
... other exports here ...
ENDPGMEXPHTH
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.