Wednesday, December 24, 2008

WebFOCUS Server Symbolic Variables

Within the WebFOCUS Reporting Server's profile logic, you can set symbolic variables that user programs can interrogate. For example, you could set a flag so that WebFOCUS programs know where they are running. This "where am I?" feature is useful when your test, development, production QA, and production environments may be slightly different and the programs must take into consideration some nuances.

Let's image putting the following statement in the WebFOCUS Reporting Server's profile (the edasprof.prf file):

-SET &&SYS_SERVER = 'DEV';

Any program running on the server can now check this global variable to see what value the server has put there. In the example above, the programs could look at &&SYS_SERVER and know that they are on the development server.

Here is an example -- common code that programs could call to find the names and locations of company logo images:


-DEFAULT &&SYS_SERVER = 'PROD';
-SET &IMAGE = IF &&SYS_SERVER IS 'LOCALHOST' AND

- &WFFMT IS 'HTML' THEN
- 'http://localhost/approot/baseapp/co_logo.jpg' ELSE
- IF &&SYS_SERVER IS 'LOCALHOST' AND &WFFMT IS 'PDF' THEN

- 'http://localhost/approot/baseapp/co_logo_small.jpg' ELSE
- IF &&SYS_SERVER IS 'DEV' AND &WFFMT IS 'HTML' THEN

- '/reports/images/co_logo.jpg' ELSE
- IF &&SYS_SERVER IS 'DEV' AND &WFFMT IS 'PDF' THEN

- 'co_logo_small.jpg' ELSE
- IF &WFFMT IS 'HTML' THEN '/prod/images/co_logo.jpg' ELSE
- IF &WFFMT IS 'PDF' THEN 'co_logo_small.jpg' ELSE ' ';



By default, this common logic assumes reports run on the production server. If this is not the case, the server lets the program know that is on (in this example, anyway) the development server or on an developer's machine (using the default LOCALHOST name).

Here is another good idea for symbolics on the server.  Developers like to include debugging comments in their programs and often forget to remove them when promoting to production.  Using a WebFOCUS server symbolic, we can dynamically turn on and off debug commands depending upon which server is being used.  When running on the test server, turn on debugging.  When running production, however, turn those commands off.

On the production server, put this command in its profile:

-SET &&DEFECHO = 'OFF';

On the test server, change it slightly to be this:

-SET &&DEFECHO = 'ALL';


Inside all of your WebFOCUS programs, you can always have this command:

-SET &ECHO = &&DEFECHO ;


When running production, debug echos are turned off; in the test environment, they are turned on.

If you have any questions about WebFOCUS symbolic variables, let me know.

No comments:

About Me

My photo

I am a project-based software consultant, specializing in automating transitions from legacy reporting applications into modern BI/Analytics to leverage Social, Cloud, Mobile, Big Data, Visualizations, and Predictive Analytics using Information Builders' WebFOCUS. Based on scores of successful engagements, I have assembled proven Best Practice methodologies, software tools, and templates.

I have been blessed to work with innovators from firms such as: Ford, FedEx, Procter & Gamble, Nationwide, The Wendy's Company, The Kroger Co., JPMorgan Chase, MasterCard, Bank of America Merrill Lynch, Siemens, American Express, and others.

I was educated at Valparaiso University and the University of Cincinnati, where I graduated summa cum laude. In 1990, I joined Information Builders and for over a dozen years served in regional pre- and post-sales technical leadership roles. Also, for several years I led the US technical services teams within Cincom Systems' ERP software product group and the Midwest custom software services arm of Xerox.

Since 2007, I have provided enterprise BI services such as: strategic advice; architecture, design, and software application development of intelligence systems (interactive dashboards and mobile); data warehousing; and automated modernization of legacy reporting. My experience with BI products include WebFOCUS (vendor certified expert), R, SAP Business Objects (WebI, Crystal Reports), Tableau, and others.