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     Using Amper Variable in an Find In statement [SOLVED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using Amper Variable in an Find In statement [SOLVED]
 Login/Join
 
Guru
posted
Hi Guys,
firstly i apologise if ive asked this before- ive searched the forum for a post i may have already made about this but couldn't find anything.

What im trying to do is use a

 FIND FILENAME IN  


statement but use an amper variable as the data source.

Knowing that there is a certain order to how DM is processed ive actually populated the variable in the preceding report.

basically it wont accept the use of a variable, if i enter the string content of the variable it works but as that content will change depending parameters selecting in the preceding fex i need to use a variable rather than static string....

SO THIS:
 FIND FILENAME IN &SOURCE 


INSTEAD OF THIS:

 FIND FILENAME IN FLATFILE


i would expect it to fail if the variable was being assembled in the same fex as it would probably build the &dummy statements first (?)

but i expected it to work when the variable alreday exists...

ive tried putting the variable in single quotes- other than that i can't think of anything else to try

anyone know why this isn't possible?

This message has been edited. Last edited by: nubi,


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Expert
posted Hide Post
You may simply be missing a -RUN after the END statement of the TABLE FILE statement. It is required if you're using Dialogue Manager to alter the WebFOCUS code.

FILEDEF TEST1 DISK TEST1.TXT
-RUN

-WRITE TEST1 ENGLAND
-WRITE TEST1 FRANCE

FILEDEF TEST2 DISK TEST2.TXT
-RUN

-WRITE TEST2 ITALY
-WRITE TEST2 JAPAN

-SET &SOURCE = IF EDIT(&TOD,'$$$$$$99') GT 30 THEN 'TEST2' ELSE 'TEST1';

TABLE FILE CAR
PRINT
*
HEADING
"&TOD"
WHERE COUNTRY IN FILE &SOURCE
END
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Hi Francis

thanks for the reply

sorry i wasn't clear in my code examples in my atgtempt to keep my post short...

the FIND statement is actually part of a 'SET &DUMMY' statement

Such as:

 
-SET &DUMMY = &COUNTRY.(FIND COUNTRY IN CAR).Enter Table 1.;

TABLE FILE CAR
PRINT *
WHERE COUNTRY EQ '&COUNTRY'
END

 



inbstead what im trying to do is this:

 
-SET &DUMMY = &TABLE1.(FIND TABLE IN &VARIABLE).Enter Table 1.;

TABLE FILE &TABLE1
PRINT *
END


where &VARIABLE is a list of tables, as i sya it works when the source is not an amper variable....which is no good for my needs.

i have eneterd a -RUN after everything as suggested but there has been no change.

im not even sure its possible but given the flexibility of WF it's just as likely that it is possible but involves syntax im unaware of...

cheers


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Expert
posted Hide Post
Nubi,

I guess that you are using Amper Autoprompting? In which case the variable won't be avaiable at the point during which the dynamic combo box is built for &COUNTRY in your example.

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
Please try adding .EVAL.

quote:
The .EVAL operator enables you to evaluate a variable's value immediately, making it possible to change a procedure dynamically. The .EVAL operator is particularly useful in modifying code at run time


We don't use this prompting method, so my sample code does not run on our server, but I think the syntax is correct.

-SET &VARIABLE = 'CAR';

-SET &DUMMY = &TABLE1.(FIND TABLE IN &VARIABLE.EVAL).ENTER TABLE 1.;

TABLE FILE &TABLE1
PRINT *
END
-RUN


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Tony's answer renders mine moot.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
thanks Francis and Tony,

that makes sense, a new fex will render any auto-prompt variables before recognising those which already have a value...

good to know, ill try a different method

thanks


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report 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     Using Amper Variable in an Find In statement [SOLVED]

Copyright © 1996-2020 Information Builders