Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] A value is missing and using substr in an iff

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] A value is missing and using substr in an iff
 Login/Join
 
Gold member
posted
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;

In define:
DESCRIPTION_CUT/A50 = SUBSTR(50, DESCRIPTION, 1, 50, 50, 'A50');
COMMENTS_CUT/A50 = SUBSTR(50, COMMENTS, 1, 50, 50, 'A50');

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
 
Posts: 46 | Location: Austin TX | Registered: June 04, 2009Report This Post
Expert
posted Hide Post
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


What is &FORMAT set to when you get the error?


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
Both 'P' and 'E' (PDF & Excel respectively)


WebFOCUS 7.6.3 | Solaris 10 | Excel, PDF
 
Posts: 46 | Location: Austin TX | Registered: June 04, 2009Report This Post
Expert
posted Hide Post
After your two -SET statements add a -TYPE for all the variables, including &FORMAT. Follow that with a -EXIT. Let me know what you get.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Gold member
posted Hide Post
Odd, now it's working. Looks like there was an erroneous -type written at the end of my define statement that I missed.Thanks for the help, Ginny.


WebFOCUS 7.6.3 | Solaris 10 | Excel, PDF
 
Posts: 46 | Location: Austin TX | Registered: June 04, 2009Report This Post
Expert
posted Hide Post
That's another reason. Smiler I often forget the END statement after all of the defines, or the semicolon. It'll get you everytime.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] A value is missing and using substr in an iff

Copyright © 1996-2020 Information Builders