Focal Point
[SOLVED] Order of Operations

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4057028196

October 16, 2019, 02:40 PM
jltz83od
[SOLVED] Order of Operations
Is there any documentation dedicated to explaining the order of operations in WebFOCUS? We are familiar with the differences between DEFINE and COMPUTE and WHERE and WHERE TOTAL; but, we would like to know more about how our requests are processed and how these statements may interact with and/or be affected by sorting and other selection criteria.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.2.06, Windows
October 16, 2019, 02:45 PM
BabakNYC
What DBMS are you using? A whole bunch of this information depends on that.


WebFOCUS 8206, Unix, Windows
October 16, 2019, 05:15 PM
jltz83od
I'm not 100% fluent in describing our system. I'm primarily a report developer not a system administrator. Is there a place where I can look for information about our DBMS? I think our tables are stored on an AS 400 mainframe.


WebFOCUS 8.2.06, Windows
October 16, 2019, 06:14 PM
Doug
quote:
the differences between DEFINE and COMPUTE and WHERE and WHERE TOTAL
... can be found by looking up the commands in the WebFOCUS Help Utility.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 16, 2019, 06:20 PM
Hallway
I'm pretty sure that it follows PEMDAS:


Wink

[I know that's not what the OP meant, but I couldn't resist]


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
October 17, 2019, 08:31 AM
BabakNYC
If you're on AS400, most likely your tables are DB2. The best way to find out is to look at the .mas files on your ibi\apps directory and see what SUFFIX= value is.

Order of operation is pretty much what you learned in high school Algebra. Report Optimization (forcing WebFOCUS to generate the most efficient SQL to talk to your DBMS) is fully documented in the Adapter manual. Search the doc for Optimization and you'll get plenty of content to read. Here's the adapter manual. Go to DB2 and search for Optimization.
https://webfocusinfocenter.inf...adapteradmin7710.pdf


WebFOCUS 8206, Unix, Windows
October 17, 2019, 08:52 AM
jgelona
A long time ago, IBI taught classes on this. They may still so you may want some training.

You might try this topic. It is a little old but gives general overview. This isn't exactly right but it is close. Things have changed a little since 2011.

http://forums.informationbuild...1057331/m/7637047106

As BabakNYC said, a lot depends on the database and the SQL that WebFOCUS generates. One thing to be aware of as IBI makes improvements in the SQL it generates, things that work, may stop working or return different results in future release. For example, as a long time FOCUS language code, I would COMPUTE switch values with a Boolean statement, i.e.
COMPUTE KEEPREC/I1=CHILD_SW EQ 'Y' AND NONPARTSW EQ 'N';


This had never generated as SQL but when we went to release 8, in some cases it would and the SQL returned results that were not intended. I had to change the statement to this to get the desired results:
COMPUTE KEEPREC/I1=IF CHILD_SW EQ 'Y' AND NONPARTSW EQ 'N' THEN 1 ELSE 0;



In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
October 17, 2019, 01:51 PM
Doug
I asked My Dear Aunt Sally about PEMDAS, and that's good for the mathematical hierarchy. But, DEFINEs and COMPUTEs are DEFINEs first, on the source, then COMPUTEs on the matrix.

There's so much more to this, and as JGelona said "They may still so you may want some training."
October 20, 2019, 01:31 PM
David Briars
quote:
...we would like to know more about how our requests are processed...

Sounds like you are interested in TABLE (WebFOCUS Reporting) internals.

If so, point your browser to IB's Webinar 'FOCUS: TABLE Internals':
https://www.informationbuilder...ialogue-manager-flow

The 'Two Walters' do a great job discussing TABLE internals. Their examples and supplementary materials are top notch.

I think it is great that you want to go beyond knowing the syntax and want to understand 'how/when FOCUS does what'.

For sure this type of knowledge has made me a better developer and enjoy the product even more.

Enjoy!




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
October 21, 2019, 09:32 AM
csswalt
Thanks for the Kudos David!

Walter Brengel

FOCUS Virtual User Group
Please join us and other FOCUS/WebFOCUS coders for the next FOCUS Virtual User Group meeting.

FOCUS Virtual User Group - for the latest schedule and to sign up.
https://www.informationbuilder...wledgeshare-webinars

Virtual User Group Archives – for past sessions.
https://www.informationbuilder...ledge-share-webinars