Focal Point
Then clause missinterpreted as a label

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

February 02, 2007, 01:57 PM
thebrettd
Then clause missinterpreted as a label
I am creating a define field TEST/i1 (A single integer either 0 or 1) to be used as the condition to test upon in an if statement later in the report.

It uses an IF THEN ELSE IF construct to set its value. However, webFOCUS is trying to interpret the THEN 1 as a label, and since there is no label 1 I get thet error code:
(FOC305) SPECIFIED LABEL NOT FOUND: 1 .

If I change the type to A1 and 'Y' or 'N' flags, it still complains that there is no 'Y' label.


TST1/I1 = IF (POSITON_CODE EQ '4222' AND STUDENT_CLASSIFICATION EQ 'GP' OR 'UP') THEN 1
- ELSE IF (POSITON_CODE GE '4479' AND POSITON_CODE LE '4482' AND STUDENT_CLASSIFICATION EQ 'UP') THEN 1
- ELSE IF (POSITON_CODE EQ '4009' OR '4222' OR '4475' OR '4495' OR
- '4479' OR '4480' OR '4481' OR '4482' OR
- '0070' OR '0074' OR '0075' OR '0076' OR
- '0077' OR '0078' OR '0079' OR '0090' OR '0095') THEN 0
- ELSE IF SHRT EQ '1' THEN 0 ELSE 1;

Is there something wrong with my IF THEN ELSE?


Dev: WF 5.2.1
Production: WF 5.2.1
Testing: WF 7.1.3
February 02, 2007, 02:11 PM
smiths
Remove the dashes at the beginning of the line. You are not in Dialog Manager mode.


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
February 02, 2007, 02:27 PM
thebrettd
Thanks.

I guess I was confused because I DO have to use the - when I am building an IF THEN ELSE outside of a define (when I am using SET e.g)


Dev: WF 5.2.1
Production: WF 5.2.1
Testing: WF 7.1.3
February 02, 2007, 02:45 PM
smiths
That's correct.

The syntax differs between DM and DEFINE FILE.

Regards,
Sean


------------------------------------------------------------------------
PROD: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode
TEST: WebFOCUS 7.6.2 on Unix AIX/Tomcat/Servlet Mode