760 likes | 1.01k Views
WebFOCUS Debugging Techniques. Nat Poe. Introduction. “Anything that can go wrong will go wrong.” -Murphy’s Law. The strangest errors can have the simplest solutions. Finding bugs is an acquired skill based on experience. Contents. Incorrect Output No Report
E N D
WebFOCUS Debugging Techniques Nat Poe
Introduction “Anything that can go wrong will go wrong.” -Murphy’s Law • The strangest errors can have the simplest solutions. • Finding bugs is an acquired skill based on experience.
Contents • Incorrect Output • No Report • Relational Database Considerations • Other Considerations
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
Defined Field Problem (continued) Issue 1: A defined field doesn’t seem to calculate the correct value. Only Non-Sales department employees are to receive a 1% bonus. Remove sortingfor detail report Bonus is thesame from therecord above theSALES records
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. Always code anELSE conditionin an IF statement In Sales, bonusis now correct
Aggregation Problem Issue 2: Adding a new field to the report changes the results. Aggregating Salaryby Division Salary is different
Aggregation Problem (continued) Issue 2: Adding a new field to the report changes the results. Target a group andrun detail reports Some employees are missing
Aggregation Problem (continued) Issue 2: Adding a new field to the report changes the results. First report useddata from EMPINFO Second report used data from TRNHIST
Aggregation Problem (continued) Issue 2: Adding a new field to the report changes the results. Unspecified defersto the “ALL” setting
Aggregation Problem (continued) Issue 2: Adding a new field to the report changes the results. To check the ALL setting
Aggregation Problem (continued) Issue 2: Adding a new field to the report changes the results. Salaries of employeesnot taking trainingwere excluded
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
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
MATCH FILE Problem (continued) Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE. Extracting all WEemployees and thematching courses
MATCH FILE Problem (continued) Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH FILE. Create a report on CRSHOLD with no sort fields. Department and namelisted for first course only
MATCH FILE Problem (continued) Issue 3: Data is appearing with blank values when there should be values. The procedure is using MATCH 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. Old file New file
MATCH FILE Problem Solution 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. SUMEMPINFO fields instead MATCH now replicates the data
MATCH FILE Problem Solution (continued) 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. Report is now correct
Sort Group Calculation Problem Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields. Incorrect average Correct average
Sort Group Calculation Problem (continued) Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields. NOPRINT fields RECAP uses the sum of values for a sort group
Sort Group Calculation Problem (continued) Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields. Use LET to“deactivate”the NOPRINT Note: LET translates a word or phraseinto another word or phrase.
Sort Group Calculation Problem (continued) Issue 4: Calculation for a subfoot is incorrect for some of the groups. The report is using a RECAP with invisible fields. NOPRINT fields will now display RECAP for CA is: 10,730.00 / 10
Sort Group Calculation Problem Solution 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. Note: Delete LET whenfinished debugging! RECAP for CA is: 10,730.00 / 4
Sort Group Calculation Problem Solution (continued) 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. Correct average
Incorrect Ratio Problem Issue 5: Wrong ratio displayed at the end of the report. Should be between1.8% and 2.6%
Incorrect Ratio Problem (continued) Issue 5: Wrong ratio displayed at the end of the report. Percentages were summed
Incorrect Ratio Problem Solution Issue 5: Wrong ratio displayed at the end of the report. Solution: Use Summarize instead of Column totals. Recalculated the Compute
Incorrect Column Total Problem Issue 6: Percentages don’t add up to 100%. Where is the other 2%?
Incorrect Column Total Problem (continued) Issue 6: Percentages don’t add up to 100%. Integer field Format changed toD6.1% for PCT ofSTAFF_CNTR
Incorrect Total Problem (continued) Issue 6: Percentages don’t add up to 100%. 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.
Incorrect Total Problem Fixed Issue 6: Percentages don’t add up to 100%. Solution: Change the format of the counter to a decimal number. Counter changed to afloating decimal format
Incorrect OutputReview • 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 UnspecifiedJOIN. • 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 (continued) • Helpful Debugging Commands
Multi-path Problem Issue 7:Path error message occurs when running a report. Note: Report is sorted by SITE, FULLNAME, and COURSESTART. Error number
Multi-path Problem (continued) Issue 7:Path error message occurs when running a report. Add an Othercomponent Query the error Detailedmessage
Multi-path Problem (continued) Issue 7:Path error message occurs when running a report. Delete the Othercomponent 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.
Multi-path Problem Solution Issue 7:Path error message occurs when running a report. Solution: Since Site is unique, specify a single path. Changed to asingle path
No Data Selected Issue 8: No data appears in a report when a selection statement is added. No selection statements Some statesexceed 5,000
No Data Selected (continued) Issue 8: No data appears in a report when a selection statement is added. Selection statement added
No Data Selected Solution Issue 8: No data appears in a report when a selection statement is added. Solution: Screen for aggregated values.
Column Notation Problem Issue 9: Changing a field format loses all data for a report. No data when theAvg Salary formatswere changed
Column Notation Problem (continued) Issue 9: Changing a field format loses all data for a report. Multi-set request Column notation to avoid duplicate field names Note: Report is OK.
Column Notation Problem (continued) Issue 9: Changing a field format loses all data for a report. Both average salaryformats were changedto whole numbers
Column Notation Problem (continued) Issue 9: Changing a field format loses all data for a report. C3 – Original FormatC4 – New Format There are now two columns: C1 – Original FormatC2 – New Format
Column Notation Problem Solution Issue 9: Changing a field format loses all data for a report. Solution: Define fields with the desired format and use them instead. Unique names for selection
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.
Web Server WebFOCUS Client (Managed Reporting) Including a Non-MR Procedure Issue 10: A Standard Report in Managed Reporting is trying to include a procedure on the Report Server. WebFOCUS Client can’t find the procedure