I started a report in report painter then went into it in edit as text mode and tried to implement some dialogue manager code (script?). The report is functioning properly when executed from text mode, but if I try to go into report painter I get the error:
"Error Parsing MASTER File filename ((FOC295)A VALUE IS MISSING FOR: Period (295))."
"Period" is the name of an &variable I am using in dialogue manager statements to get a user-entered time period. This time period then sets the value of another variable which is used to determine which field to use in the ACROSS statement of the report.
I played around with this quite a bit and found that I had to use EVAL to make the IF statement work correctly. So... I am guessing that since a value is only passed to Period at runtime and I am using this variable to programmatically code the TABLE FILE... it just won't let me into report painter with this code in place. I figure I can temporarily remark out the variable in the TABLE FILE section and hard code a field there in order to get back into painter. Is this the only/best option?
-SET '&ACROSSVAL' = IF &Period.EVAL EQ 'Week' THEN 'recweek AS ''week'''
-ELSE IF &Period.EVAL EQ 'Month' THEN 'recmonth AS ''Month'''
-ELSE 'recyear AS ''Year''';
Incidentally, I want the period variable set up with a list of options like &Period.(Week,Month,Year).EVAL. When I try this, I get the drop down with the options but the selection doesn't pass correctly. I get the error:
0 ERROR AT OR NEAR LINE 16 IN PROCEDURE _ADHOCRQFOCEXEC *
(FOC283) IMPROPER USE OF 'GOTO'
What's the story here? I'm not using a goto structure anywhere.
Any help will be much appreciated!!
I'm not sure I can be of much help other than to tell you that there is a known problem with toggling between text mode and report painter. What version of WF are you using? Supposedly this problem was fixed in version 5.2.4, but I have still encountered problems where I either can't get into Report Painter at all (I get the parsing error), or it let's me in, but blows away the code I typed manually! Very frustrating. I now have a rule where I will do everything I can first in Painter, then code the rest in Text mode.
As for your GOTO error, you can't always rely on Focus to give you accurate error messages, especially when you get into more complicated things like DM. It's just one of those minor quirks you have to get used to.
Maybe someone else has some better answers for you!
Thanks, Jen. I have version 523 so perhaps that's a place to start. I appreciate your suggestions!
I remembered that there was a way to specify a default value for the variable. I added this to my dialogue manager code, and now I can get into report painter!
-SET &ACROSSVAL = IF &PERIOD EQ 'Week'
-ELSE IF &PERIOD EQ 'Month' THEN 'Month'
first take the ' away from the &ACROSSVAL
then i'm not sure why you needed the evals.
and if you really wanted asphrases, you don't need quotes around single-word asphrases.
So you could have
-THEN 'RECMONTH AS MONTH' would work fine.
Thanks! I thought since there were spaces in the value being assigned to &ACROSSVAL, it needed to be in single quotes. You were also right that the EVALs weren't necessary after all. I had thought that I needed to save the AS phrase between pairs of single quotes to save the format of the AS phrase as it appeared when hard-coded in the report section. Again, apparently this wasn't necessary after all.
Finally, I solved my problem with wanting to include the variable options for &Period. I had failed to include a period after the close paren and this was apparently the problem.
Thanks again for your help!
|Powered by Social Strata|