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.
Is there a way I can get the Application name inside a FEX file.. Any amper vaiables? I tried to see all the & variables using -? & . But I am not seeing any amper variable with the name of the application in which the FEX is residing...
Is there a way to do this ?This message has been edited. Last edited by: Kerry,
Thanks,
Ramkumar. WebFOCUS/Tableau Webfocus 8 / 7.7.02 Unix, Windows HTML/PDF/EXCEL/AHTML/XML/HTML5
Posts: 394 | Location: Chennai | Registered: December 02, 2009
Very crude way I know... another option is to loop through all the folders in APP PATH using APP QUERY and filter the filename with the current fex file. Cant seem to think of any easy way ..
thanks Sashanka
WF 7.7.03/Windows/HTML,PDF,EXL POC/local Dev Studio 7.7.03 & 7.6.11
Here's one approach. FOCUS output can be captured in a file, which can then be -READ. In this case &LOCATION will contain the complete path, so you will need to parse the value to get just the APP folder name. The command SET EMPSRV=ON returns FOCUS output to the user's screen.
APP FILEDEF EMGFILE DISK EMGFILE.TXT
SET EMGSRV=FILE
WHENCE <fexname> FOCEXEC
-RUN
-*
-READ EMGFILE, &LOCATION
-TYPE &LOCATION
-*
SET EMGSRV=ON
-RUN
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Nice! Must look into EMGSRV. Thanks Dan. My solution was from 2007. so I'm glad we've made progress!This message has been edited. Last edited by: Francis Mariani,
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
@ Francis - not sure I would call it progress. I think new system variables (&FOCAPPNAME and &FOCAPPINCLUDE) containing the name(s) of the application folder(s), or a way to easily capture the output from the WHENCE command in a variable would be progress.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
In reality, I made no progress with my suggested solution. I discovered it is not working. The path displayed by my code is actually the output from the WHENCE command and not the contents of variable &LOCATION. Don't know what the problem is.
But this variable might be the solution!
&IBIAPP_app
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
As far as I can tell, &IBIAPP_app is used to tell WF where a fex is (particularly if it's not in the app path, but in some other app folder), but cannot use it to find out where a fex is.
Back to 2007.
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
EMGSRV notoriously will not capture this sort of thing, went through this process with APP SHOWPATH, and it gets nothing.
There is another possibility, that has been posted here before, and that uses tracing to capture the results of the commands like WHENCE.
e.g.
-*******************************************************************************
-* Set the trace file
-SET &TEMPPATH = TEMPPATH(80,'A80');
-SET &TSCOM = GETTOK(&TEMPPATH,80,-2,'/',8,'A8');
-SET &TRACEFL = &TEMPPATH || ('cmd_op.trc');
-*******************************************************************************
-* Set Commands To Set Tracing
SET TRACEOFF = ALL
SET TRACEON=R1H
SET TRACEUSER = ON
SET TRACEUSER = &TRACEFL
-RUN
WHENCE MyFex FOCEXEC
-RUN
-RUN
-* The previous two -RUN's must be there for this to work.
SET TRACEOFF = ALL
SET TRACEUSER = OFF
-RUN
-*******************************************************************************
-* Allocate The Trace File
FILEDEF TRACEFIL DISK &TRACEFL
-RUN
-*******************************************************************************
-* Write out a master to read the TRACEFIL list
EX -LINES 4 EDAPUT MASTER,TRACEFIL,CV,FILE
FILENAME=TRACEFIL, SUFFIX=FIX,$
SEGNAME=TRACEFIL, $
FIELD=LINE ,ALIAS= ,A500 ,A500 ,$
-RUN
-*******************************************************************************
-* Process the trace file to get the results of the command.
DEFINE FILE TRACEFIL
Item3/A20 = GETTOK(LINE,500,3,' ',20,'A20') ;
MSG_Item/A493 = SUBSTR(500,GETTOK(LINE,500,2,'"',500,'A500'),8,500,493,'A493') ;
CMD_Flag/A1 = IF EDIT(MSG_Item,'9') EQ ':' THEN 'Y' ELSE 'N' ;
END
TABLE FILE TRACEFIL
PRINT
MSG_Item
WHERE Item3 EQ 'NGtrEvnt:'
-* ON TABLE HOLD AS TMP_CHCK
END
-RUN
But you will end up with the same situation as using the SYSFILES technique.
This seems similar to the problem in determining which WebFOCUS client you're running your procedures on: Just as with the current application directory, there's no amper-variable containing the hostname of the client.
Interestingly enough, WebFOCUS adapter names can be determined using SYSFILES, SYSCOLUM and as many nested -REMOTE calls as you have servers chained after one another.
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 :
Wep, the Host Name is available in the HTTP Header variables that you can add in the Custom Settings via the Admin Console. Here's a page from the Security and Admin manual:
-TYPE &IBIMR_domain &IBIAPP_app If your fex is in a domain, then the &IBIAPP_app will return the app path that you've designated for that domain, it can contain several apps
Try this is 2 steps 1) get a list of all the apps 2) loop thru the apps one at a time listing all the fexes. stop when you find the fex you want, and grab the app.
APP LIST HOLD TABLE FILE FOCAPPL WHERE APPNAME NOT LIKE 'ibi%' WHERE APPNAME NOT LIKE '/%' PRINT * END... have a look at this, and hold the bits you want. eg: PRINT APPNAME BY APPNAME NOPRINT ON TABLE HOLD AS MYLIST1 FORMAT ALPHA then -READ MYLIST1 NOCLOSE &MYAPP.A64 and... APP QUERY &MYAPP HOLD TABLE FILE FOCAPPQ PRINT * ..some filter for whatever fex you'r elooking for ... experiment with these commands APP LIST, making its FOCAPPL file and APP QUERY, making its FOCAPPQ file and if you wanted masters, then TABLE FILE SYSTABLE
...this should do it.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003