Upload
bryan-austin
View
218
Download
0
Embed Size (px)
Citation preview
1Copyright 2007, Information Builders. Slide 1
Nat Poe
WebFOCUS Debugging Techniques
Copyright 2007, Information Builders. Slide 2
The strangest errors can have the simplest solutions.
Finding bugs is an acquired skill based on experience.
Introduction
“Anything that can go wrong will go wrong.”
-Murphy’s Law
Copyright 2007, Information Builders. Slide 3
Incorrect Output
No Report
Relational Database Considerations
Other Considerations
Contents
4Copyright 2007, Information Builders. Slide 4
Incorrect Output
Copyright 2007, Information Builders. Slide 5
Defined Field Problem
Issue 1: A defined field doesn’t seem to calculate the correct value. Only Non-Sales department employees are to receive a 1% bonus.
Except for Salesthe bonus is 1%
In Sales, thereshould be nobonus
Copyright 2007, Information Builders. Slide 6
Defined Field Problem (continued)
Remove sortingfor detail report
Bonus is thesame from therecord above theSALES records
Issue 1: A defined field doesn’t seem to calculate the correct value. Only Non-Sales department employees are to receive a 1% bonus.
Copyright 2007, Information Builders. Slide 7
Defined Field Problem Solution
Issue 1: A defined field doesn’t seem to calculate the correct value. Only Non-Sales department employees are to receive a 1% bonus.
Solution: Define needs an ELSE condition.
In Sales, bonusis now correct
Always code anELSE conditionin an IF statement
Copyright 2007, Information Builders. Slide 8
Aggregation Problem
Issue 2: Adding a new field to the report changes the results.
Aggregating Salaryby Division
Salary is different
Copyright 2007, Information Builders. Slide 9
Aggregation Problem (continued)
Target a group andrun detail reports
Some employees are missing
Issue 2: Adding a new field to the report changes the results.
Copyright 2007, Information Builders. Slide 10
Aggregation Problem (continued)
First report useddata from EMPINFO Second report used
data from TRNHIST
Issue 2: Adding a new field to the report changes the results.
Copyright 2007, Information Builders. Slide 11
Aggregation Problem (continued)
Unspecified defersto the “ALL” setting
Issue 2: Adding a new field to the report changes the results.
Copyright 2007, Information Builders. Slide 12
Aggregation Problem (continued)
To check the ALL setting
Issue 2: Adding a new field to the report changes the results.
Copyright 2007, Information Builders. Slide 13
Aggregation Problem (continued)
Salaries of employeesnot taking training
were excluded
Issue 2: Adding a new field to the report changes the results.
Copyright 2007, Information Builders. Slide 14
Aggregation Problem Solution
Issue 2: Adding a new field to the report changes the results.
Solution: Either set ALL to ON or declare a left outer JOIN.
Note: Inner and Left OuterJOINs override the ALL setting
Copyright 2007, Information Builders. Slide 15
MATCH FILE Problem
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Blank departments and names start the report
Copyright 2007, Information Builders. Slide 16
MATCH FILE Problem (continued)
Extracting all WEemployees and thematching courses
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Copyright 2007, Information Builders. Slide 17
MATCH FILE Problem (continued)
Department and namelisted for first course only
Create a report on CRSHOLD with no sort fields.
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Copyright 2007, Information Builders. Slide 18
MATCH FILE Problem (continued)
Old file New file
Note: When using PRINT for the old file and new file, MATCH assumes there are duplicate PIN values in the old and new files, so it will match the first employee 30 in the old file to the first employee 30 in the new file. It needs a second old file employee 30 to match it to the second new file employee 30 and so forth.
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Copyright 2007, Information Builders. Slide 19
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Solution:
MATCH FILE Problem Solution
SUM EMPINFO fields instead
MATCH now replicates the data
Use SUM for the old file.
Copyright 2007, Information Builders. Slide 20
MATCH FILE Problem Solution (continued)
Report is now correct
Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE.
Solution: Use SUM for the old file.
Copyright 2007, Information Builders. Slide 21
Incorrect average
Sort Group Calculation Problem
Correct average
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Copyright 2007, Information Builders. Slide 22
NOPRINT fields
Sort Group Calculation Problem (continued)
RECAP uses the sum of values for a sort group
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Copyright 2007, Information Builders. Slide 23
Sort Group Calculation Problem (continued)
Note: LET translates a word or phraseinto another word or phrase.
Use LET to“deactivate”
the NOPRINT
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Copyright 2007, Information Builders. Slide 24
Sort Group Calculation Problem (continued)
RECAP for CA is:10,730.00 / 10
NOPRINT fieldswill now display
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Copyright 2007, Information Builders. Slide 25
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Solution:
Sort Group Calculation Problem Solution
RECAP for CA is:10,730.00 / 4
CNTR should be set to 1 for each course.
Note: Delete LET whenfinished debugging!
Copyright 2007, Information Builders. Slide 26
Sort Group Calculation Problem Solution (continued)
Correct average
Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields.
Solution: CNTR should be set to 1 for each course.
Copyright 2007, Information Builders. Slide 27
Incorrect Ratio Problem
Should be between1.8% and 2.6%
Issue 5: Wrong ratio displayed at the end of the report.
Copyright 2007, Information Builders. Slide 28
Incorrect Ratio Problem (continued)
Percentageswere summed
Issue 5: Wrong ratio displayed at the end of the report.
Copyright 2007, Information Builders. Slide 29
Issue 5: Wrong ratio displayed at the end of the report.
Solution:
Incorrect Ratio Problem Solution
Recalculatedthe Compute
Use Summarize instead of Column totals.
Copyright 2007, Information Builders. Slide 30
Where is the other 2%?
Incorrect Column Total Problem
Issue 6: Percentages don’t add up to 100%.
Copyright 2007, Information Builders. Slide 31
Incorrect Column Total Problem (continued)
Format changed toD6.1% for PCT ofSTAFF_CNTR
Integer field
Issue 6: Percentages don’t add up to 100%.
Copyright 2007, Information Builders. Slide 32
Incorrect Total Problem (continued)
Note: The percent of total was calculated as an integer value, which truncates the decimal portion of a number. The result is then changed to the decimal format.
Issue 6: Percentages don’t add up to 100%.
Copyright 2007, Information Builders. Slide 33
Issue 6: Percentages don’t add up to 100%.
Solution:
Incorrect Total Problem Fixed
Counter changed to afloating decimal format
Change the format of the counter to a decimal number.
Copyright 2007, Information Builders. Slide 34
Isolate the Problem When aggregating data, look at some or all of the detail. Display data without sort fields. Check the temporary field expression syntax. Display NOPRINT fields. A different numeric format could change the results.
Common Remedies With IF…THEN…, always code an ELSE too. To control the handling of short path records, use:
The SET ALL command for an Unspecified JOIN. Declare Inner or Left Outer in the JOIN component.
In MATCH FILE use SUM for the Old file to replicate data in the New file. Use Summarize for column totals and Recompute for subtotals to
recalculate computed values in summary lines. Don’t use Integer fields when decimal results are needed in calculations.
Incorrect OutputReview
Copyright 2007, Information Builders. Slide 35
Helpful Debugging Commands
Incorrect OutputReview (continued)
To display a setting:
? SET setting
Note: Use ALL. to display the ALL setting.
To “disable” NOPRINT:
LET NOPRINT =
36Copyright 2007, Information Builders. Slide 36
No Report
Copyright 2007, Information Builders. Slide 37
Multi-path Problem
Issue 7: Path error message occurs when running a report.
Error number
Note: Report is sorted by SITE, FULLNAME, and COURSESTART.
Copyright 2007, Information Builders. Slide 38
Multi-path Problem (continued)
Issue 7: Path error message occurs when running a report.
Query the error
Detailedmessage
Add an Othercomponent
Copyright 2007, Information Builders. Slide 39
Multi-path Problem (continued)
Issue 7: Path error message occurs when running a report.
Note: With the double arrowheads (-->>), the Reporting Server assumes multiple sites exist for each employee with an independent number of course start dates for each employee.
Delete the Othercomponent
Copyright 2007, Information Builders. Slide 40
Multi-path Problem Solution
Issue 7: Path error message occurs when running a report.
Solution:
Changed to asingle path
Since Site is unique, specify a single path.
Copyright 2007, Information Builders. Slide 41
No Data Selected
No selection statements
Issue 8: No data appears in a report when a selection statement is added.
Some statesexceed 5,000
Copyright 2007, Information Builders. Slide 42
No Data Selected (continued)
Issue 8: No data appears in a report when a selection statement is added.
Selection statement added
Copyright 2007, Information Builders. Slide 43
No Data Selected Solution
Issue 8: No data appears in a report when a selection statement is added.
Solution: Screen for aggregated values.
Copyright 2007, Information Builders. Slide 44
Column Notation Problem
No data when theAvg Salary formats
were changed
Issue 9: Changing a field format loses all data for a report.
Copyright 2007, Information Builders. Slide 45
Column Notation Problem (continued)
Column notation to avoidduplicate field names
Issue 9: Changing a field format loses all data for a report.
Note: Report is OK.
Multi-set request
Copyright 2007, Information Builders. Slide 46
Column Notation Problem (continued)
Both average salaryformats were changedto whole numbers
Issue 9: Changing a field format loses all data for a report.
Copyright 2007, Information Builders. Slide 47
Column Notation Problem (continued)
C3 – Original FormatC4 – New FormatThere are now two columns:
C1 – Original FormatC2 – New Format
Issue 9: Changing a field format loses all data for a report.
Copyright 2007, Information Builders. Slide 48
Column Notation Problem Solution
Unique names for selection
Issue 9: Changing a field format loses all data for a report.
Solution: Define fields with the desired format and use them instead.
Copyright 2007, Information Builders. Slide 49
Column Notation Problem Solution (continued)
Issue 9: Changing a field format loses all data for a report.
Solution: Define fields with the desired format and use them instead.
Copyright 2007, Information Builders. Slide 50
Including a Non-MR Procedure
WebFOCUS Client can’t find the procedure
Web Server
WebFOCUS Client(Managed Reporting)
WebFOCUS Client(Managed Reporting)
Issue 10: A Standard Report in Managed Reporting is trying to include a procedure on the Report Server.
Copyright 2007, Information Builders. Slide 51
Web Server
WebFOCUS Client(Managed Reporting)
WebFOCUS Client(Managed Reporting)
Data Source
WebFOCUSReport Server
WebFOCUSReport Server
Including a Non-MR Procedure (continued)
debug_10 resideson the WebFOCUS
Client
debug_01s resideson the WebFOCUS
Report Server
Issue 10: A Standard Report in Managed Reporting is trying to include a procedure on the Report Server.
Copyright 2007, Information Builders. Slide 52
Issue 10: A Standard Report in Managed Reporting is trying to include a procedure on the Report Server.
Solution:
Including a Non-MR Procedure Solution
Use –MRNOEDIT to pass commands “as is” to the Report Server.
Copyright 2007, Information Builders. Slide 53
No ReportReview
Check to see if there are any error messages. Usually fixing the first one clears up subsequent
error messages. If there are no error messages, check your selection criteria.
Common Remedies Don’t use sort fields from independent paths. Use WHERE TOTAL to screen on aggregated data. Avoid column notation by creating “shadow” fields. For Managed Reporting, use –MRNOEDIT to pass commands
directly to the Report Server.
Copyright 2007, Information Builders. Slide 54
Helpful Commands:
No ReportReview (continued)
To display additional information for an error message
? error_nbr
To pass Managed Report commands to the Report Server
-MRNOEDIT BEGINcommand …-MRNOEDIT END
55Copyright 2007, Information Builders. Slide 55
Relational Database Considerations
Copyright 2007, Information Builders. Slide 56
RDBMS Response Time Problem
Sorted by length ofCategory description
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Copyright 2007, Information Builders. Slide 57
RDBMS Response Time Problem (continued)
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
WebFOCUSaggregated
the data
Copyright 2007, Information Builders. Slide 58
RDBMS Response Time Problem (continued)
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Text editor tocreate tracing
statements
Copyright 2007, Information Builders. Slide 59
Command Purpose
SET TRACEOFF=ALL Turn off all current traces.
SET TRACEON=SQLAGGR… Show if RDBMS will aggregate the data.
SET TRACEON=STMTRACE… Show SQL code generated.
SET TRACEUSER=CLIENT Display traces in a Web page.
SET XRERTIEVAL = OFF Do not execute the procedure.
RDBMS Response Time Problem (continued)
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Copyright 2007, Information Builders. Slide 60
RDBMS Response Time Problem (continued)
WebFOCUS will haveto aggregate the data
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Copyright 2007, Information Builders. Slide 61
RDBMS Response Time Problem (continued)
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
CATLEN is used as a sortfield and cannot be
converted to SQL code
Copyright 2007, Information Builders. Slide 62
RDBMS Response Time Problem Solution
Order report by column
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Solution: Compute CATLEN and use Order Report By (BY TOTAL)
Copyright 2007, Information Builders. Slide 63
RDBMS Response Time Problem Solution (continued)
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Solution: Compute CATLEN and use Order Report By (BY TOTAL)
RDBMS willaggregate the
data
Copyright 2007, Information Builders. Slide 64
RDBMS Response Time Problem Solution (continued)
RDBMS aggregatedthe data
Issue 11: A report is taking a long time to run. Data is retrieved from a relational database and aggregated into product categories.
Solution: Compute CATLEN and use Order Report By (BY TOTAL)
Copyright 2007, Information Builders. Slide 65
Relational Database ConsiderationsReview
When the RDBMS cannot aggregate the data: Individual rows are returned to the WebFOCUS
Report Server from the RDBMS. WebFOCUS Report Server will have to aggregate the data. Processing is slowed down.
Common Remedies Turn on traces to determine if the RDBMS is to aggregate
the data. Use SET XRETRIEVAL=OFF to not retrieve data when tracing. Avoid defining sort fields that will turn off aggregation; if possible,
compute them instead.
For more information, see:Course 402 – Reporting Concepts and Efficiencies for Relational Databases
66Copyright 2007, Information Builders. Slide 66
Other Considerations
Copyright 2007, Information Builders. Slide 67
Parameterized Reports
Question: How can I display the value of variables?
Answer A: Use &ECHO and SET XRETRIEVAL
Copyright 2007, Information Builders. Slide 68
Parameterized Reports (continued)
Question: How can I display the value of just the variables?
Answer B: Use -? and -EXIT
Copyright 2007, Information Builders. Slide 69
Parameterized Reports (continued)Review
To control the display of Dialogue Manager variables:
-SET &ECHO = OFF|ON|ALL;
To display of Dialogue Manager variables:
-? &[&]variable
To control creating a report or not:
SET XRETRIEVAL ON|OFF
To terminate a procedure:
-EXIT
Copyright 2007, Information Builders. Slide 70
Using -EXIT
Note: Except for debugging purposes, avoid using –EXIT: • ReportCaster may not work properly.• A procedure that is included with a –EXIT will terminate
the procedure invoking it.
Copyright 2007, Information Builders. Slide 71
Profiles
Profiles are files that contain commands. Can contain any valid report server core language command. Executed every time a procedure is run in WebFOCUS.
Three types of profiles: Global Group
Executed after the global profile Can override commands found in the global profile
User Executed after the group profile Can override commands in the group profile
Commands in a procedure override commands in a profile.
Question: Why does a procedure work for one user, but not another?
Answer A: Check for Profiles
Note: Never assume a setting; establish it in your procedure.
Copyright 2007, Information Builders. Slide 72
Application Namespace, commonly referred to as APP PATH, is the search sequence used to locate the metadata and procedures needed by the WebFOCUS Report Server.
Application Namespace
Question: Why does a procedure work for one user, but not another?
Answer B: Application Namespace
Copyright 2007, Information Builders. Slide 73
Application Namespace (continued)
Question: How can I display the APP path search order?
Answer: Use APP SHOWPATH
Copyright 2007, Information Builders. Slide 74
WHENCE Command
Question: How do I know from which application the metadata is being used?
Answer: Use the WHENCE command
EMPINFO.MAS in the DEBUG application willbe used
To display from which application a file will be utilized:
WHENCE filename FOCEXEC|MASTER|ACCESS|FOCSTYLE|FOCUS
Copyright 2007, Information Builders. Slide 75
Additional Help
Question: What can I do when all else fails?
Answer: WebFOCUS Development Center
http://www.informationbuilders.com/support/wf_dev_center.html
Focal Point is a free online Q&A
Bulletin Board
Copyright 2007, Information Builders. Slide 76
Debugging is not an exact science. Never assume anything. Try to isolate the problem and work from there. Sometimes the strangest errors have the simplest solutions. Look at what is and not what you are expecting.
Debugging is an acquired skill based on experience. Learn as much as possible about the product and tools. The more you know, the more quickly you will be able solve
problems.
Review