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] Amper Variable not Storing Entire Content

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Amper Variable not Storing Entire Content
 Login/Join
 
Silver Member
posted
Hi,

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, 2016Report This Post
Expert
posted Hide Post
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, 2003Report This Post
Silver Member
posted Hide Post
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, 2016Report This Post
Expert
posted Hide Post
Initialize the variables:
-SET &FN2 = ;
-SET &FNOTE1 = ;

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 &FNOTE1=&FN2.EVAL;


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Silver Member
posted Hide Post
Tom,

It did not work. I still get prompted for the FN2 variable and also it does not get the value. Is this because now the value is being SET?


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, 2016Report This Post
Virtuoso
posted Hide Post
Sandeep:
Does this work?

-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, 2015Report This Post
Expert
posted Hide Post
If you are going to use .EVAL, you will need to make sure the string is enclosed in quotes.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
This is how:

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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
People are abusing EVAL far too often


This indicates a limited understanding of FOCUS and Dialog Manager.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
What about using ASNAMES

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

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 278 | Registered: October 10, 2006Report This Post
Expert
posted Hide Post
quote:
-DEFAULTH &FNOTE1=&FN2.EVAL;

This is why you are getting prompted.

To my knowledge (wait for the flood of responses here) you are not able to supply a variable to a -DEFAULT or -DEFAULTH.

I'll not bother to go into the reasons why this might be illogical to do anyway!

This has been discussed a few times before.

T



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, 2004Report This Post
Expert
posted Hide Post
Hi Tony,

With the .EVAL is does work.

But only with the .EVAL


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Hi Waz,

When did that happen? I thought that this was one of those "if only we could" things that we dream of!

Well, you're never too old to learn something new Smiler

T



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, 2004Report This Post
Expert
posted Hide Post
Well, knock me down with a feather!

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 Razzer

-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, 2004Report This Post
Virtuoso
posted Hide Post
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, 2006Report This Post
Expert
posted Hide Post
quote:
semi-colon at the end of a -DEFAULT

That will teach me to copy'n'paste Wink

T



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, 2004Report This Post
Expert
posted Hide Post
And with .EVAL most dialog manager commands can be controlled.

I once set up a GOTO for -INCLUDES inside the calling fex.

Consider this simplified example.

Include:

-SET &RTN_CONTROL = IF &FOCERRNUM NE 0 THEN 'GOTO ERROR_CONTROL' ELSE '*' ;

Calling Fex:
.
.
-INCLUDE Fex

-&RTN_CONTROL.EVAL

-EXIT

-ERROR_CONTROL
.
.
.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 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] Amper Variable not Storing Entire Content

Copyright © 1996-2020 Information Builders