From a launch page the user selects which &RPTYPE (AGEGRP, COVGRP, ZIP) file is to be used to create a report.
In the ZIP.ftm there is a field named ZIP. Possible values for Zip are:
Allegany Anne Arundel N _Non_Residential Wicomico Worcester
In the AGEGRP.ftm there is a field named AGEGRP. Possible values for AGEGRP are: 0-<1 1-5 6-14 15-18
In the COVGRP.ftm there is a field named COVGRP Possible values for COVGRP are: Aged/Disabled Families and Children (FAC) Maryland Children's Health Program (MCHP) Other PAC
I am trying to write some (Dialogue Manager or Define) logic to look at which &RPTYPE the user selects on the launch page.
If the selection is ZIP, I need to be sure that the value of '_Non-Residential' is displayed as 'Non-Residential' in the report.
Thus far, I've come up with this,
quote:
DEFINE FILE &FNX RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0'; SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP; END
but it does not consider when the file is not ZIP.
I would appreciate any shove I could get with this.
Any ideas?
Thanks.This message has been edited. Last edited by: Tomsweb,
DEFINE FILE &FNX
-IF &RPTYP NE 'ZIP' GOTO :SKIPZIP;
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP;
-:SKIPZIP
-IF &RPTYP EQ 'ZIP' GOTO :SKIPTHIS;
... and then code an alternate RFLAG and SRNAME field here for other values of &RPTYP with another statement
-:SKIPTHIS
END
On first thoughts, perhaps some DM to select the defines lines needed.
DEFINE FILE &FNX
-IF &??? NE 'ZIP' THEN GOTO NO_ZIP ;
RFLAG/A1 = IF ZIP EQ '_Non-Residential' THEN '1' ELSE '0';
SRNAME/A60 = IF RFLAG EQ '1' THEN 'Non-Residential' ELSE ZIP;
-NO_ZIP
-IF &??? NE 'AGEGRP' THEN GOTO NO_AGEGRP ;
....
-NOAGEGRP
-IF &??? NE 'COVGRP' THEN GOTO NO_COVGRP ;
....
-NO_COVGRP
END
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 09, 2010, 05:51 PM
Tomsweb
Thanks guys, I get the idea. When I have it working, I'll post the solution.
I don't think Dialogue Manager should be necessary:
DEFINE FILE &FNX
SRNAME/A60 = IF &RPTTYPE EQ '_Non-Residential' THEN 'Non-Residential' ELSE &RPTTYPE ;
END
EDIT: The above code will cause an error if the maximum length of values in AGEGRP.ftm is less than 16. In that case, I would change the DEFINE to this, which has the added advantage of covering any other values beginning with '_' that might be added in the future:
DEFINE FILE &FNX
SRNAME/A60 = IF &RPTTYPE LIKE '_%' THEN EDIT(&RPTTYPE,'$9999999999999999999999999999999999999999999999999') ELSE &RPTTYPE ;
END
This message has been edited. Last edited by: Dan Satchell,