Focal Point
[CLOSED] Report Caster calling for a parameter when the report runs without?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2027071386

July 20, 2016, 03:39 PM
CAWarner
[CLOSED] Report Caster calling for a parameter when the report runs without?
Here's my code. If I run this by hand it calls for no parameters and outputs a report including several recent terms based on the current system date.

When I attempt to run it via report caster it instead gives an error:

BTP1020 (FOC295) A VALUE IS MISSING FOR: &TERM

I'm boggled, because I set a number of amper-variables in this code, but only &TERM is coming back empty. If I supply a parameter it overrides the code below and spits out a report based on that entry instead of the current-date.

Relevant Chunk of Code follows:
-----

-*---------------Automatic Term Updates--------------------
-SET &CDATE = &YYMD.EVAL;
-SET &CYEAR = EDIT (&CDATE, '9999');
-SET &CMON = EDIT (&CDATE, '$$$$99');
-SET &CMODY = EDIT (&CDATE, '$$$$9999');
-*------This parses out the current date and uses it to specify a starting term---------
-*------Terms take a format like this: 201620 201630 201680 etc....
-SET &TERM = '0';
-SET &TERM = IF &CMODY LE '0401' THEN &CYEAR||00 ELSE &TERM;
-SET &TERM = IF &CMODY GT '0401' THEN &CYEAR||30 ELSE &TERM;
-SET &TERM = IF &CMODY GT '0801' THEN &CYEAR||50 ELSE &TERM;
-SET &TERM = IF &CMODY GT '0815' THEN &CYEAR||70 ELSE &TERM;
-SET &TERM = IF &CMODY GT '1001' THEN &CYEAR||90 ELSE &TERM;
-*-------------End Automatic Term Updates------------------
MATCHES AND REPORT OUTPUT FOLLOW - CONFIRMED TO BE WORKING JUST FINE.

This message has been edited. Last edited by: CAWarner,


WebFOCUS 8202
Windows, All Outputs
July 20, 2016, 03:45 PM
CAWarner
For a counterexample, this code also demands a &TERM parameter when run in report caster, but when one is supplied the -SET commands correctly override it and produce a report based on the current date:

-*---------------GET-DATE-------------------
-SET &CYEAR = EDIT (&YYMD.EVAL, '9999');
-SET &PYEAR = &CYEAR - 1;
-SET &CMONTH = EDIT (&YYMD.EVAL, '$$$$99$$');
---*----------------------Cal Mo-------Year Term-
-SET &TERM = 201600;
-SET &TERM = IF &CMONTH EQ '01' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '02' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '03' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '04' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '05' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '06' THEN &PYEAR||60 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '07' THEN &CYEAR||20 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '08' THEN &CYEAR||20 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '09' THEN &CYEAR||20 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '10' THEN &CYEAR||20 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '11' THEN &CYEAR||20 ELSE &TERM;
-SET &TERM = IF &CMONTH EQ '12' THEN &CYEAR||20 ELSE &TERM;
-*------------------------------------------------

I still have no idea why it's only coming asking for &TERM other than that &TERM is used in a WHERE statement further down to sort out data by term.


WebFOCUS 8202
Windows, All Outputs
July 20, 2016, 04:49 PM
CAWarner
Report Caster is somehow running a cached version of the report that is not reflecting my changes! There is no connection between the problem and the code I've posted here.

When I've run out of ideas trying to solve that problem I'll come back with a more useful question!


WebFOCUS 8202
Windows, All Outputs
July 20, 2016, 04:54 PM
RSquared
Try changing the code
-SET &TERM = '0'; to

-SET &TERM = '000000
';


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit