[SOLVED] A value is missing and using substr in an iff
I have a report with two versions, excel and PDF. There are two columns in the report with long character lengths, description and comments, and I want to use substr on the PDF version to limit the character length of these two columns and no substr on the excel version.
I had set this up using two prints and a goto for excel, but am told I shouldn't do it this way and should use a variable instead.
This is the basic logic of my report -SET &COMMENTS = IF &FORMAT EQ 'P' THEN COMMENTS_CUT ELSE COMMENTS; -SET &DESCRIPY = IF &FORMAT EQ 'P' THEN DESCRIPTION_CUT ELSE DESCRIPTION;
Table file: PRINT CONTAINER_NAME AS 'Container,Name' &DESCRIPY AS 'Description' ROOM_NUMBER AS 'Room #' STATUS AS 'Status' STATUS_EFFECTIVE_DATE2 AS 'Status,Effective Date' &COMMENTS AS 'Comments' -GOTO RESUME
But when I run I get (FOC295) A VALUE IS MISSING FOR: &DESCRIPY. What is wrong with my IF statement?This message has been edited. Last edited by: BDAVIS,
WebFOCUS 7.6.3 | Solaris 10 | Excel, PDF
June 16, 2009, 04:22 PM
GinnyJakes
I don't know. This works:
-SET &ECHO=ALL;
-SET &FORMAT='P';
-SET &COMMENTS = IF &FORMAT EQ 'P' THEN COMMENTS_CUT ELSE COMMENTS;
-SET &DESCRIPY = IF &FORMAT EQ 'P' THEN DESCRIPTION_CUT ELSE DESCRIPTION;
-TYPE &COMMENTS &DESCRIPY
DEFINE FILE CAR
DESCRIPTION_CUT/A5 = SUBSTR(5, COUNTRY, 1, 5, 5, 'A5');
COMMENTS_CUT/A5 = SUBSTR(5, CAR, 1, 5, 5, 'A5');
END
TABLE FILE CAR
PRINT COUNTRY AS 'Container,Name'
&DESCRIPY AS 'Description'
&COMMENTS AS 'Comments'
END