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] Executing Procedures in WebFOCUS and FOCUS

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Executing Procedures in WebFOCUS and FOCUS
 Login/Join
 
Member
posted
Background. Our application of WebFOCUS allows users to execute reports online. We also execute the same reports in FOCUS overnight via a scheduled batch process. (Note: We do not use ReportCaster.) The overnight reports are placed in an external repository for archival purposes.

Problem. Need to identify when a procedure is executed via WebFOCUS or when it is executed via FOCUS. The reason for requirement is that not all WebFOCUS code executes in FOCUS.

Question. Is there a variable (or something) that may be examined which will identify the environment (WebFOCUS versus FOCUS) where the procedure is executing? I want to keep the solution simple if possible.

Thoughts and suggestions appreciated.
Grazie.

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


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Virtuoso
posted Hide Post
You may be able to use system variables &FOCMODE and/or &FOCREL to differentiate between the two environments.


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Master
posted Hide Post
Is it possible to 'detect' the difference by checking &IBI_user, &IBIMR_domain, &IBIMR_user or &REM_UID ?

Assuming the 'overnight batch process' is executed under a different username than the "WebFOCUS users" at daytime?

If not... ...you might consider making a special useraccount for the night processing.


Just a thought...


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Member
posted Hide Post
Thank you for your input.

Results. &FOCMODE and &FOCREL result with the same values in WebFOCUS and FOCUS. &IBI_user, &IBIMR_domain, &IBIMR_user are WebFOCUS variables and will not work in FOCUS. &REM_UID is not a system variable. WebFOCUS and FOCUS prompt for its value at execution time.

Any other ideas would be appreciated.
Grazie.


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Virtuoso
posted Hide Post
The command below will display a list of variables, system and otherwise. If you run it in both environments, perhaps you can find something different between the two.

-? &


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Are you truly running FOCUS or are you running a standalone tscom, i.e. edastart script, for your batch processing? A thought is that the batch process could start with a standard or preprocessing procedure that overrides or resets a global variable that is also set in the WebFOCUS global profile. That would give you the most control, I think.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Platinum Member
posted Hide Post
I second Dan's suggestion. We had a similar situation when the same program was to be executed Ad-hoc and also from ReportCaster, but with slight variations.

Doing the (-? &) on both sides showed me that environment variable &FOCFOCEXEC has a special value of 'RCASTER' when run from RC. We trapped this value right at the top of the program to determine further execution modes.

Did you also consider checking the executing User-ID? All your batch executions may be under one system-ID and when run ad-hoc, there would be different user-ids. You could use this trap if it works in your situation.

Hope that helps.
Sandeep Mamidenna


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Again, thank you for your input.

Results.
Dan. -? & produces subtle differences between the two environments. For example, &FOCFEXNAME in WebFOCUS does not have an extension whereas in FOCUS it does.
WebFOCUS &FOCFEXNAME = paydates
FOCUS &FOCFEXNAME = paydates.fex
Although it is possible to use the difference for the purpose I require, I would not feel confident that this doesn't change in a future release of WebFOCUS/FOCUS.

Ginny. FOCUS is running as a stand-alone tscom via an edastart script. As suggested, it is possible to add a preprocess to the FOCUS script to set a variable that could be used to identify FOCUS execution. I have considered this approach and to some extent have already included this functionality in some of the procedures.

Blue. I did -? & on both sides - WebFOCUS and FOCUS. The common variable have the same values (exception noted above). Variables that are not common to both sides fail resulting in an error. The error is not usable. I have checked the User ID. Although it should be different, WebFOCUS/FOCUS displays the same ID. I will give this more consideration.

Again, I thank you for your input. I was hoping for a variable that would make this simple and therefore easy to maintain by other developers.


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Expert
posted Hide Post
On the Mainframe, modify profile.prf and add:
-SET &&ENV = 'TSO'; or
-SET &&ENV = 'MSO'; whichever it is

On Windows, modify edasprof.prf and add:
-SET &&ENV = 'WINDOWS';

Now, when you do -? &, the &&ENV should show the appropriate environment...

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Platinum Member
posted Hide Post
If the non-existance of a specific field is guaranteed on one of the sides, then you could also use the .EXISTS check for determining your execution mode.

However Tom's suggestion sure looks fool-proof.


-------------------------------------------------------------------------------------------------
Blue Cross & Blue Shield of MS
WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL
MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !! Music
 
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Results.
Tom. Mainframe FOCUS is not involved. FOCUS is running as a stand-alone tscom via and edastart script.

Solution.
Blue. Your suggestion using USERID was excellent. The GETUSER function works for the purpose required. The value for WebFOCUS versus FOCUS is different. Will add Dialogue Manager statement to the procedure
-SET &XUSER = GETUSER(USERID);
and use the variable value to identify the environment (WebFOCUS versus FOCUS) where the procedure is executing.

My sincere thanks to everyone.
Molto grazie.


WF 7.6.10 Unix Oracle
 
Posts: 22 | Location: Milano, Italy | Registered: September 16, 2005Report This Post
Virtuoso
posted Hide Post
quote:
However Tom's suggestion sure looks fool-proof.


I second that! What Tom suggests not only gives you more control over the variables and values you can set to identify each of your environments but also shelters you from potential issues derived from future [Web]FOCUS releases; if you set your logic based on a variable that is guaranteed not to exist today in one of your environments but later down the road IBI decides that such a variable should become available for all platforms in a new release ... well, you know what will happen.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Expert
posted Hide Post
FOCUS - always calls profile.prf during execution
WebFOCUS - always calls edasprof.prf during execution

You have found a solution, that is a good thing! Smiler


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 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] Executing Procedures in WebFOCUS and FOCUS

Copyright © 1996-2020 Information Builders