Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2007, Information Builders. Slide 1 Walter Brengel & Cesare Petrizio Unintended Consequences or…. Why Did FOCUS Do THAT!

Similar presentations


Presentation on theme: "Copyright 2007, Information Builders. Slide 1 Walter Brengel & Cesare Petrizio Unintended Consequences or…. Why Did FOCUS Do THAT!"— Presentation transcript:

1 Copyright 2007, Information Builders. Slide 1 Walter Brengel & Cesare Petrizio Unintended Consequences or…. Why Did FOCUS Do THAT!

2 Copyright 2007, Information Builders. Slide 2 Agenda n -SET &ECHO=ALL; n Dialogue Manager Vs Non Dialogue Manager n CHECK FILE HOLD n -READ n -TYPE n FILEDEF n -GOTO Processing n &ECHO On Steroids n STYLING n SQL TRACES

3 Copyright 2007, Information Builders. Slide 3 Execution Control The Report: Salaries greater than DEPT LASTNAME FIRSTNAME SALARY ACCOUNTING SANCHEZ EVELYN $83, SOPENA BEN $79, WANG JOHN $62, CUSTOMER SUPPORT WHITE VERONICA $62, HIRSCHMAN ROSE $62, FERNSTEIN ERWIN $54, MARKETING VALINO DANIEL $55, BELLA MICHAEL $62, ADAMS RUTH $62, PATEL DORINA $55, CVEK MARCUS $62, GOTLIEB CHRIS $58, PERSONNEL NOZAWA JIM $80, SALES CASSANOVA LOIS $70, ADDAMS PETER $54, LASTRA KAREN $115, This Is The Report We Would Like.

4 Copyright 2007, Information Builders. Slide 4 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -READ MYSAVE &SKIP.A16. &SALARY.D9. TABLE FILE EMPDATA "Salaries greater than &SALARY

5 Copyright 2007, Information Builders. Slide 5 Execution Control The Report: MYSAVE &SKIP.A16. &SALARY.D9. ERROR AT OR NEAR LINE 14 IN PROCEDURE setupforsummit (FOC339) DIALOGUE MANAGER -READ FAILED: CHECK FILEDEF OR ALLOCATION FOR: -READ MYSAVE &SKIP.A16. &SALARY.D9. Why Do We Get An Error ? TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -READ MYSAVE &SKIP.A16. &SALARY.D9. How Do We Fix It ? Add A –RUN Before The –READ TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. &SALARY.D9.

6 Copyright 2007, Information Builders. Slide 6 Execution Control The Report: -READ MYSAVE &SKIP.A16. &SALARY.D9. ERROR AT OR NEAR LINE 33 IN PROCEDURE setupforsummit (FOC299) UNRECOGNIZED FORMAT OF AMPER VARIABLE IN -READ: -READ MYSAVE &SKIP.A16. &SALARY.D9. Why Do We Get This Error ? How Do We Debug It ? TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. &SALARY.D9. First Let’s See What We Are Getting -SET &ECHO=ALL: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 -READ MYSAVE &SKIP.A16. &SALARY.D9. 0 ERROR AT OR NEAR LINE 33 IN PROCEDURE Setupforsummit (FOC299) UNRECOGNIZED FORMAT OF AMPER VARIABLE IN -READ: -READ MYSAVE &SKIP.A16. &SALARY.D9.

7 Copyright 2007, Information Builders. Slide 7 Execution Control The Report: -READ MYSAVE &SKIP.A16. &SALARY.D9. ERROR AT OR NEAR LINE 33 IN PROCEDURE setupforsummit (FOC299) UNRECOGNIZED FORMAT OF AMPER VARIABLE IN -READ: -READ MYSAVE &SKIP.A16. &SALARY.D9. How Do We Find It ? Do We Get The Error? No – Not That Format Yes – It Is That Format TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. &SALARY.D9. TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. -EXIT -* &|SALARY.A9. 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 -READ MYSAVE &SKIP.A16. -*&|SALARY.D9. Extra Credit!! Why &|SALARY???

8 Copyright 2007, Information Builders. Slide 8 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. &SALARY.D9.  Looks Like The Problem Is With The SALARY!  &SALARY.D9 ????? D9??  Only Allowed Formats Are: A & I  And I Is Read As A  Lets Change It To A9 -* ECHO OUTPUT TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN 0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1 -READ MYSAVE &SKIP.A16. &SALARY.A9. TABLE FILE EMPDATA "Salaries greater than PETER

9 Copyright 2007, Information Builders. Slide 9 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A16. &SALARY.A9. TABLE FILE EMPDATA "Salaries greater than &SALARY

10 Copyright 2007, Information Builders. Slide 10 Execution Control The Report:  What’s Wrong With This Picture?  Why Two Firstnames & Two Salaries  How Do We Correct This?  Correct &Skip  What Is The Length Of &Skip  HOLDLIST=PRINTONLY SET HOLDLIST=PRINTONLY The Output: PAGE 1 FIELDNAME ALIAS FORMAT ACTUAL LASTNAME E01 A15 A016 FIRSTNAME E02 A1 A004 SALARY E03 D9 D008 SET HOLDLIST=ALL (Default) The Output: PAGE 1 FIELDNAME ALIAS FORMAT ACTUAL LASTNAME E01 A15 A016 FIRSTNAME E02 A10 A012 FIRSTNAME E03 A1 A004 SALARY E04 D12.2M D008 SALARY E05 D9 D008 TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE END -RUN -READ MYSAVE &SKIP.A40. &SALARY.A8. TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE ON TABLE SET HOLDLIST PRINTONLY END -RUN -READ MYSAVE &SKIP.A20. &SALARY.A8.

11 Copyright 2007, Information Builders. Slide 11 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE ON TABLE SET HOLDLIST PRINTONLY END -RUN -READ MYSAVE &SKIP.A20. &SALARY.A8. TABLE FILE EMPDATA "Salaries greater than &SALARY

12 Copyright 2007, Information Builders. Slide 12 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE ON TABLE SET HOLDLIST PRINTONLY END -RUN -READ MYSAVE &SKIP.A20. &SALARY.A8. -TYPE THE VALUE FOR SKIP IS:&SKIP -TYPE THE VALUE FOR SALARY IS: &SALARY -EXIT TABLE FILE EMPDATA "Salaries greater than &SALARY

13 Copyright 2007, Information Builders. Slide 13 Execution Control The Report: ON TABLE SAVEON TABLE HOLD FORMAT ALPHA TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE HOLD AS MYSAVE FORMAT ALPHA ON TABLE SET HOLDLIST PRINTONLY END -INCLUDE CHKMAST -EXIT PAGE 1 FIELDNAME ALIAS FORMAT ACTUAL LASTNAME E01 A15 A015 FIRSTNAME E02 A1 A001 SALARY E03 D9 A009 TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE SAVE AS MYSAVE ON TABLE SET HOLDLIST PRINTONLY END -EXIT ALPHANUMERIC RECORD NAMED MYSAVE FIELDNAME ALIAS FORMAT LENGTH LASTNAME LN A15 15 FIRSTNAME A1 1 SALARY D9 9 TOTAL 25

14 Copyright 2007, Information Builders. Slide 14 Execution Control The Report: TABLE FILE EMPDATA PRINT FIRSTNAME/A1 SALARY/D9 BY LASTNAME IF LN EQ 'ADDAMS' ON TABLE SAVE AS MYSAVE ON TABLE SET HOLDLIST PRINTONLY END Salaries greater than DEPT LASTNAME FIRSTNAME SALARY ACCOUNTING SANCHEZ EVELYN $83, SOPENA BEN $79, WANG JOHN $62, CUSTOMER SUPPORT WHITE VERONICA $62, HIRSCHMAN ROSE $62, FERNSTEIN ERWIN $54, MARKETING VALINO DANIEL $55, BELLA MICHAEL $62, ADAMS RUTH $62, PATEL DORINA $55, CVEK MARCUS $62, GOTLIEB CHRIS $58, PERSONNEL NOZAWA JIM $80, SALES CASSANOVA LOIS $70, ADDAMS PETER $54, LASTRA KAREN $115, RUN -READ MYSAVE &SKIP.A16. &SALARY.A9. TABLE FILE EMPDATA "Salaries greater than &SALARY

15 Copyright 2007, Information Builders. Slide 15 Execution Control FILEDEF Verification &ECHO Output: FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGGING\ALLCRS.FTM TABLE FILE ALLCRS PRINT * END -RUN NUMBER OF RECORDS IN TABLE= 0 LINES= 0 -SET &ECHO=ALL; FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGGING\ALLCRS.FTM TABLE FILE ALLCRS PRINT * END  Somethings wrong!  Let’s see if we can –READ the file

16 Copyright 2007, Information Builders. Slide 16 Execution Control FILEDEF Verification -SET &ECHO=ALL; FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGGING\ALLCRS.FTM -RUN -READ ALLCRS &LINE.A1. -TYPE &LINE -EXIT TABLE FILE ALLCRS PRINT * END -RUN TABLE FILE ALLCRS PRINT * END -READ ALLCRS &LINE.A10. 0 ERROR AT OR NEAR LINE 5 IN PROCEDURE FILEDEF FOCEXEC * 0 ERROR AT OR NEAR LINE 8 IN PROCEDURE FILEDEF FOCEXEC * (FOC295) A VALUE IS MISSING FOR: &LINE.  Let’s Look At The FILEDEF Oops!! Somebody Can’t Type! C:\IBI\APPS\DEBUGGGING\ALLCRS.FTM

17 Copyright 2007, Information Builders. Slide 17 Execution Control FILEDEF Verification -SET &ECHO=ALL; FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGING\ALLCRS.FTM -RUN -READ ALLCRS &LINE.A10. -TYPE &LINE -EXIT FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGING\ALLCRS.FTM -RUN -READ ALLCRS &LINE.A10. -TYPE EXIT  Well Did It Work?? -SET &ECHO=ALL; FILEDEF ALLCRS DISK C:\IBI\APPS\DEBUGGING\ALLCRS.FTM -RUN TABLE FILE ALLCRS PRINT * END PAGE 1 IPIN COURSESTART COURSECODE EXPENSES /02/11 EDP690 3, /06/05 UNI780 3, /06/01 UMI710 2, /11/05 EDP690 3, /09/28 SSI220 1, /07/10 MC90 1, Ah! Success…..

18 Copyright 2007, Information Builders. Slide 18 Execution Control Using -GOTO  Use –GOTO For:  Transfer Of Control To A Specified Label.  If Dialogue Manager Finds The Label,processing Continues With The Line Following It.  If Dialogue Manager Does Not Find The Label, Processing Ends And An Error Message Is Displayed.  ‑ Goto Label  ‑ Label  Label - Is A User ‑ defined Name Of Up To 12 Characters That Specifies The Target Of The ‑ GOTO Action.  Do Not Use  Embedded Blanks  The Name Of Any Other Dialogue Manager Command Except ‑ Quit Or ‑ Exit.  Words That Can Be Confused With Functions, Arithmetic And Logical Operations,

19 Copyright 2007, Information Builders. Slide 19 Execution Control The Report: -*GOTO RPT2 TABLE FILE CAR "THIS IS RPT1" PRINT CAR END -*EXIT -RPT2 TABLE FILE EMPDATA "THIS IS RPT2" PRINT LN END -*EXIT -RPT3 TABLE FILE CAR "THIS IS RPT3" PRINT COUNTRY END -*EXIT -RPT4 TABLE FILE EMPDATA "THIS IS RP41" PRINT FN END -GOTO RPT2 TABLE FILE CAR "THIS IS RPT1" PRINT CAR END -*EXIT -RPT2 TABLE FILE EMPDATA "THIS IS RPT2" PRINT LN END -EXIT -RPT3 TABLE FILE CAR "THIS IS RPT3" PRINT COUNTRY END -*EXIT -RPT4 TABLE FILE EMPDATA "THIS IS RP41" PRINT FN END PAGE 1 THIS IS RPT2 LASTNAME VALINO BELLA CASSANOVA ADAMS

20 Copyright 2007, Information Builders. Slide 20 Execution Control &ECHO On Steroids -SET DEFECHO=ON; SET DEFECHO = {OFF|ON|ALL} where: OFF - Establishes OFF as the default value for &ECHO. OFF is the default value. ON - Establishes ON as the default value for &ECHO. ALL - Establishes ALL as the default value for &ECHO.  SET DEFECHO Command Enables You To Specify A Default Value For &ECHO That Spans All Procedures Executed In An Application.  Any FOCEXEC Executed That Does Not Explicitly Establish A Value For &ECHO Uses The Default Value Established By The SET DEFECHO Command.  You Can Explicitly Control The Value Of &ECHO For An Individual Procedure By Either:  Passing A Value On The EX Command  Issuing A -SET Command For &ECHO  Issuing A -DEFAULT Command For &ECHO.

21 Copyright 2007, Information Builders. Slide 21 Execution Control READLIMIT and RECORDLIMIT  READLIMIT Is Synonymous With RECORDLIMIT Except As Follows:  Oracle Data Adapter Passes Readlimit To The Oracle As;  SQL WHERE ROWNUM <=N Clauses.  Rownum Is A Pseudo Column Allowing Oracle To Limit The Number Of Rows Retrieved And Returned.  DB2, Readlimit Appends A “Fetch First N Rows Only” To The Generated SQL.  See Ibm DB2 SQL Reference Manual.  Readlimit And Recordlimit Reduce Communication Traffic, Terminal And Disk I/Os.  Search Limit Tests Are Helpful When:  Testing A New Master File.

22 Copyright 2007, Information Builders. Slide 22 Execution Control Styling DEFINE FILE CAR BLANK/A1=' '; END TABLE FILE CAR SUM COMPUTE PROFIT/D6=RETAIL_COST - DEALER_COST; BLANK AS '' RETAIL_COST DEALER_COST BY COUNTRY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,COLUMN=RETAIL_COST,COLOR=BLUE,$ ENDSTYLE END PAGE 1 COUNTRY PROFIT RETAIL_COST DEALER_COST ENGLAND 7,466 45,319 37,853 FRANCE 979 5,610 4,631 ITALY 9,830 51,065 41,235 JAPAN 966 6,478 5,512 W GERMANY 10,169 64,732 54,563

23 Copyright 2007, Information Builders. Slide 23 Execution Control Styling DEFINE FILE CAR BLANK/A1=' '; END TABLE FILE CAR SUM COMPUTE PROFIT/D6=RETAIL_COST - DEALER_COST; BLANK AS '' RETAIL_COST DEALER_COST BY COUNTRY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,COLUMN=N3,COLOR=BLUE,$ ENDSTYLE END PAGE 1 COUNTRY PROFIT RETAIL_COST DEALER_COST ENGLAND 7,466 45,319 37,853 FRANCE 979 5,610 4,631 ITALY 9,830 51,065 41,235 JAPAN 966 6,478 5,512 W GERMANY 10,169 64,732 54,563 BACKCOLOR=RED

24 Copyright 2007, Information Builders. Slide 24 Execution Control Styling DEFINE FILE CAR BLANK/A1=' '; END TABLE FILE CAR SUM COMPUTE PROFIT/D6=RETAIL_COST - DEALER_COST; BLANK AS '' RETAIL_COST DEALER_COST BY COUNTRY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,COLUMN=N3,COLOR=BLUE,BACKCOLOR=RED,$ ENDSTYLE END PAGE 1 COUNTRY PROFIT RETAIL_COST DEALER_COST ENGLAND 7,466 45,319 37,853 FRANCE 979 5,610 4,631 ITALY 9,830 51,065 41,235 JAPAN 966 6,478 5,512 W GERMANY 10,169 64,732 54,563

25 Copyright 2007, Information Builders. Slide 25 Execution Control Styling DEFINE FILE CAR BLANK/A1=' '; END TABLE FILE CAR SUM COMPUTE PROFIT/D6=RETAIL_COST - DEALER_COST; BLANK AS '' RETAIL_COST DEALER_COST BY COUNTRY ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=REPORT,COLUMN=N4, COLOR=BLUE,$ ENDSTYLE END PAGE 1 COUNTRY PROFIT RETAIL_COST DEALER_COST ENGLAND 7,466 45,319 37,853 FRANCE 979 5,610 4,631 ITALY 9,830 51,065 41,235 JAPAN 966 6,478 5,512 W GERMANY 10,169 64,732 54,563

26 Copyright 2007, Information Builders. Slide 26 Execution Control SQL Traces  SQLDI -  Records SQL statements.  RDBMS return codes.  COMMIT and ROLLBACK commands.  SQL cursor operations such as PREPARE, OPEN, FETCH, and CLOSE.  Used with all FOCUS report requests, and native SQL commands.  Formerly FSTRACE.  SQLAGGR  Displays data adapter ‑ to ‑ RDBMS aggregation and join analysis.  Used only for FOCUS reporting operations such as TABLE, GRAPH, and MATCH FILE.  If the data adapter is able to pass all join, sort, and aggregation operations, the SQLAGGR trace is not populated. The message "AGGREGATION DONE..." appears.  Formerly FSTRACE3.

27 Copyright 2007, Information Builders. Slide 27 Execution Control SQL Traces  STMTRACE  Records SQL SELECT statements generated by the data adapter for FOCUS report requests.  MODIFY procedures, or Direct SQL Passthru SELECT requests. It also records the SQL Data.  Definition Language (DDL) statements generated by the CREATE FILE command.  Display the trace information online.  Store it in a file or sequential data set.  The data adapter terminates its generated SQL SELECT statements with a semicolon.  You can submit them to the RDBMS for processing, interactively or in batch.  Use STMTRACE for:  Debugging.  Performance tuning.  Capturing SQL Data Definition and Data Manipulation statements to reuse.  Formerly FSTRACE4.  SQLCALL  Traces commands and data exchange between the physical and the logical layers of the data adapter.  You can activate all or any combination of these traces during your FOCUS session or in batch.  You can display the results online or store them in a file or sequential data set.

28 Copyright 2007, Information Builders. Slide 28 Execution Control SQL Traces  SET TRACEOFF = ALL  SET TRACEON =SQLAGGR//CLIENT  SET TRACEON =STMTRACE//CLIENT  SET TRACEUSER= ON AGGREGATION DONE AE SELECT T1."OrderID", SUM(T1."Freight"), SUM(T1."Freight") FROM AE Northwind.dbo.Orders T1 GROUP BY T1."OrderID" ORDER BY AE T1."OrderID"; AGGREGATION DONE... SELECT T1."OrderID", SUM(T1."Freight"), SUM(T1."Freight") FROM Northwind.dbo.Orders T1 GROUP BY T1."OrderID" ORDER BY T1."OrderID";  SET TRACEOFF = ALL  SET TRACEON = SQLAGGR//CLIENT  SET TRACEON = STMTRACE//CLIENT  SET TRACESTAMP= OFF  SET TRACEUSER= ON

29 Copyright 2007, Information Builders. Slide 29 Execution Control Review n -SET &ECHO=ALL; n Dialogue Manager Vs Non Dialogue Manager n CHECK FILE HOLD n -READ n -TYPE n FILEDEF n -GOTO Processing n &ECHO On Steroids n STYLING n SQL TRACES

30 Copyright 2007, Information Builders. Slide 30 Questions Thanks for Coming


Download ppt "Copyright 2007, Information Builders. Slide 1 Walter Brengel & Cesare Petrizio Unintended Consequences or…. Why Did FOCUS Do THAT!"

Similar presentations


Ads by Google