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.
I am using the below code to get a long string value (1000 characters) and store it in amper variable &FNOTE1. The problem is when I use the variable I only get part of the string, not the entire string. If I use variable &FN2, it shows entire string but when I run the report, it prompts for variable &FN2, which I do not want. Can you please suggest how to get the entire string in the variable &FNOTE1 without it prompting for the variable when run? Thanks in advance!
SQL
SELECT LISTAGG(FOOTNOTE, ', ') WITHIN GROUP (ORDER BY FOOTNOTE) FN2
FROM (SELECT DISTINCT FOOTNOTE FROM COMP_DATA
WHERE COMPONENT_ID >= 111
AND COMPONENT_ID <= 228
AND INCLUDE_IN_REPORTS ='Y');
TABLE
ON TABLE HOLD AS TEMPHLD1
END
-RUN
TABLE FILE TEMPHLD1
SUM FN2
ON TABLE HOLD AS CIS
END
-RUN
-READFILE CIS
-DEFAULTH &FNOTE1=&FN2.EVAL;
This message has been edited. Last edited by: FP Mod Chuck,
WebFocus 8.1 Service Pack 0.5 Build Version branch8105 Build/GEN Number 119
OS/Platform: Apache Tomcat/8.0.21
Posts: 46 | Location: Baltimore | Registered: October 27, 2016
first, try validating that your READFILE actually got you something, by following the READFILE command with a -? &F which would show you the &vars starting with the letter F that you have in your workspace.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
The variable FN2 does get the entire string. That I believe means READFILE gave the value to FN2 variable. But if I use this variable in the FOOTER and run the report, it prompts for FN2.
WebFocus 8.1 Service Pack 0.5 Build Version branch8105 Build/GEN Number 119
OS/Platform: Apache Tomcat/8.0.21
Posts: 46 | Location: Baltimore | Registered: October 27, 2016
SQL SELECT LISTAGG(FOOTNOTE, ', ') WITHIN GROUP (ORDER BY FOOTNOTE) FN2 FROM (SELECT DISTINCT FOOTNOTE FROM COMP_DATA WHERE COMPONENT_ID >= 111 AND COMPONENT_ID <= 228 AND INCLUDE_IN_REPORTS ='Y'); TABLE ON TABLE HOLD AS TEMPHLD1 END -RUN
TABLE FILE TEMPHLD1 SUM FN2 ON TABLE HOLD AS CIS END -RUN -READFILE CIS
-SET &RETAIL_COST=;
-RUN
TABLE FILE CAR
SUM RETAIL_COST
ON TABLE HOLD AS CIS
END
-RUN
-READFILE CIS
-SET &FNOTE1=&RETAIL_COST.EVAL;
-TYPE VALUE OF RETAIL_COSTIS &RETAIL_COST
-TYPE VALUE OF FNOTE1 IS &FNOTE1
WebFOCUS 8206, Unix, Windows
Posts: 1853 | Location: New York City | Registered: December 30, 2015
TABLE FILE TEMPHLD1
SUM FN2
ON TABLE HOLD AS CIS
END
-RUN
-READFILE CIS
-DEFAULTH &FN2='';
-TYPE FN2 : &FN2
People are abusing EVAL far too often. If you don't need to have the contents of your (Dialog Manager) amper-variable re-parsed by Dialog Manager, you don't need EVAL.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
SET ASNAMES=ON
SQL
SELECT LISTAGG(FOOTNOTE, ', ') WITHIN GROUP (ORDER BY FOOTNOTE) FN2
FROM (SELECT DISTINCT FOOTNOTE FROM COMP_DATA
WHERE COMPONENT_ID >= 111
AND COMPONENT_ID <= 228
AND INCLUDE_IN_REPORTS ='Y');
TABLE
ON TABLE HOLD AS TEMPHLD1
END
-RUN
TABLE FILE TEMPHLD1
SUM FN2 AS 'FNOTE1'
ON TABLE HOLD AS CIS
END
-RUN
-READFILE CIS
This way you do not need FN2 as variable it reads it directly into FNOTE1
using the following (i.e. -DEFAULTHing &FN2) works OK, but for me I'd rather use the suggestion by Fernando unless there's a really good reason that you need &FN2 elsewhere within your code
T
Edited to change DEFAULTH statement after being corrected by Danny
-DEFAULTH &FN2 = ''
TABLE FILE CAR
BY MODEL AS FN2
WHERE CAR EQ 'JAGUAR'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS TEMPHLD1
END
-RUN
TABLE FILE TEMPHLD1
SUM FN2
ON TABLE HOLD AS CIS
END
-RUN
-READFILE CIS
-DEFAULTH &FNOTE1=&FN2.EVAL
-TYPE &FNOTE1
-TYPE &FN2
This message has been edited. Last edited by: Tony A,
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
It stands to logic that you can assign a variable to another with -DEFAULT using .EVAL &FN2.EVAL is replaced by its value before assignment, hence it behaves as a constant and not a variable. What I am fearful about is the semi-colon. I know that many users put a semi-colon at the end of a -DEFAULT as some also put a semi-colon at the end of a -GOTO command. It seems innocuous but then one day the code will be tightened and then...
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006