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     [CLOSED] Application Name Inside a FEX file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Application Name Inside a FEX file
 Login/Join
 
Guru
posted
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, 2009Report This Post
Platinum Member
posted Hide Post
Hi,

Here is one way of doing it..
-SET &LENX=&FOCFOCEXEC.LENGTH-1;

-SET &FEX1=TRIMV('L',&FOCFOCEXEC,&FOCFOCEXEC.LENGTH,'_',1,'A&LENX.EVAL');
-SET &LEN=&FEX1.LENGTH;
-SET &LEN1=&LEN-4;
-SET &FEX= GETTOK(&FEX1, &LEN, 1, '.', &LEN1,'A&LEN1.EVAL');

WHENCE &FEX FOCEXEC

-EXIT

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
 
Posts: 103 | Registered: June 12, 2009Report This Post
Expert
posted Hide Post
The problem with using the WHENCE command in this manner is that the result is not in an amper variable.


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
Sashanka/Francis, Thanks for the timely replies.

I just need the name of the application alone eg. baseapp - that too in an amper variable. Is there a specific way to do this ?

Thanks, Ram.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Expert
posted Hide Post
The answer may be here: Is it possible?


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
Virtuoso
posted Hide Post
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, 2007Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
@ 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, 2007Report This Post
Expert
posted Hide Post
Absolutely agree, but your solution took less lines than mine, so...


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
Virtuoso
posted Hide Post
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, 2007Report This Post
Guru
posted Hide Post
I think &IBIAPP_app only works if you are passing it in the WebFocus Client -> Custom Settings.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Expert
posted Hide Post
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
EMGSRV appears to capture error messages only. Since standard output from WHENCE is not an error, it is not captured by EMGSRV.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
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.

I think SYSFILES may be the best solution.


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 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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
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:

WebFOCUS Security and Administration > Manipulating WebFOCUS Variables > HTTP Header Variables Available for Script Processing


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 for all the information. I will try both EMGSRV and Whence... IBIAPP_app is not working as required...


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Expert
posted Hide Post
-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, 2003Report 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     [CLOSED] Application Name Inside a FEX file

Copyright © 1996-2020 Information Builders