1 / 50

Dialogue Manager Internals

Dialogue Manager Internals. Sandra Steeves Information Builders. Agenda. What is Dialogue Manager? Dialogue Manager Processing Dialogue Manager Limits Dialogue Manager Variables User System Implicit PROMPT Navigating the Procedure Debugging Dialogue Manager Procedures.

ianna
Download Presentation

Dialogue Manager Internals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dialogue Manager Internals Sandra Steeves Information Builders

  2. Agenda • What is Dialogue Manager? • Dialogue Manager Processing • Dialogue Manager Limits • Dialogue Manager Variables • User • System • Implicit PROMPT • Navigating the Procedure • Debugging Dialogue Manager Procedures

  3. Conceptual View Stack FOCUS Command Processor SYSIN REPORT MODIFY MAINTAIN EXEC

  4. All System &Variables • All Local and Global Variables Dialogue ManagerProcessing • Dialogue Manager Uses: • DATREC for

  5. Dialogue ManagerProcessing • Dialogue Manager Uses: • LINREC for • All System, Local and Global Variable Values LINREC 4/1/00 20000401 000401 010400 040100 STEP1 STEVENS ‘STEVENS’ Alex Let’s Look at an Example

  6. Dialogue ManagerProcessing Remember !! • Dialogue Manager Executes First! • Line by Line -DEFAULT &GOTO=STEP1 -GOTO &GOTO -STEP1 -SET &NAM1 = IF &WHO EQ ’GB’ THEN ’’’’ | - ’SMYTH’ | ’’’’ ELSE ’’’’ | &NAME || ’’’’; TABLE FILE EMPLOYEE -INCLUDE HEADING SUM SALARY BY DEPARTMENT BY EMP_ID WHERE LAST_NAME CONTAINS &NAM1 END -RUN -STEP2

  7. Dialogue ManagerProcessing The FOCEXEC DATREC LINREC -DEFAULT &GOTO=STEP1&GOTOSTEP1 -GOTO STEP1 -STEP1 -SET &NAM1 = IF &WHO EQ ’GB’ THEN ’’’’ | &WHO ALEX - ’SMYTH’ | ’’’’ ELSE ’’’’ | &NAME || ’’’’; &NAME STEVENS &NAM1 ‘STEVENS’ TABLE FILE EMPLOYEE -INCLUDE HEADING SUM SALARY BY DEPARTMENT BY EMP_ID WHERE LAST_NAME CONTAINS ‘STEVENS’ END -RUN -STEP2 How did we get values for &WHO and &NAME? If Not Previously supplied, FOCUS Will Prompt for the Values

  8. Dialogue Manager LINREC 4/1/2000 20000401 000401 010400 040100 STEVENS ‘STEVENS’ Alex STEP1 FOCSTACK TABLE FILE EMPLOYEE HEADING CENTER “REPORT OF SALARIES “ SUM SALARY BY DEPARTMENT BY EMP_ID BY EMP_ID WHERE LAST_NAME CONTAINS ‘STEVENS’ END Where did the HEADING come from? It was –INCLUDE’d (-INCLUDE HEADING)

  9. Dialogue ManagerLIMITS • Dialogue Manager uses DATREC and LINREC • LINREC/DATREC Size Established at Install • Default is 16K • Can be Increased to 32K in 4K increments • FOCCTL.DATA Contains Two Members • LINREC and DATREC • Make changes to BOTH Members as Follows: • DA XL(16*1024) Default 16K • DA XL(32*1024) Max Size • Assemble and Link • See Installation Guide for Details

  10. Dialogue ManagerLIMITS • DATREC - 16K Default • Each Variable Name Takes 32 Bytes • 16384 / 32 = 512 Variables • ~40 Are Reserved by FOCUS • 472 Remain for Use • Each Additional 4K Increases the Available Variables by 128 • At the 32K Max 1024 Total Variables are available • 1024 – 40 =984 Remain For Use OR….

  11. Dialogue ManagerLIMITS • LINREC - 16K Default • Each Variable Value Can Be as Large as: • 16384 / (Number of Variables + 40 Reserved) = Max VariableSize (Never greater than 256 Bytes Each) • Each Additional 4K Increases the Available Variable Size • A 32K Max is allowed

  12. YMD DMY RECORDS… COUNTRY Dialogue Manager TABLE FILE CAR SUM RCOST BY COUNTRY IF COUNTRY EQ &COUNTRY END TABLE FILE CAR SUM DCOST BY CAR IF COUNTRY EQ &COUNTRY END EX PGM1 FOCSTACK.FTM PGM1.FEX TABLE FILE CAR SUM RCOST BY COUNTRY PLEASE SUPPLY ... COUNTRY = ENGLAND 020518 051802 0 ENGLAND

  13. Dialogue Manager Process • Line does NOT begin with - (dash) • Evaluate &variables • Write to FOCSTACK with substitution • FOCSTACK also contains focexec name and line number • Line begins with dash in column 1 • Evaluate (process ) immediately • -* Comment line

  14. Dialogue ManagerEnding the Process • -RUN • Execute the current FOCSTACK • Return to Procedure at next line • -EXIT • Execute the current FOCSTACK • Return to FOCUS command level (SYSIN) • -QUIT • Return to FOCUS command level (SYSIN) • Clear the current FOCSTACK • -QUIT FOCUS n • Return to system command level • Return code set to n

  15. Dialogue ManagerUser &variables • &variable • Local variables are identified by a single ampersand (&) preceding the name of the variable. They remain in effect throughout a single procedure. • &&variable • Global variables differ from local variables in that once a value is supplied, it remains current throughout the FOCUS session, unless set to another value with -SET or cleared by the LET CLEAR command.

  16. Dialogue ManagerUser &variables • &variable.LENGTH • &variable.EXIST • &variable.EVAL • &variable.TYPE

  17. Dialogue ManagerSystem Variables • &DATE • &DATEYYMD • &YMD &DMY &MDY • &YYMD &DMYY &MDYY • &TOD

  18. Dialogue ManagerValues for &variables • Implicit PROMPT • -DEFAULT • -PROMPT • -CRTFORM • -SET • -READ

  19. Dialogue ManagerImplicit PROMPT 1 TABLE FILE CAR =====> Write to FOCSTACK 2 SUM RCOST =====> . 3 BY COUNTRY =====> . 4 IF COUNTRY EQ =====> . 5 &COUNTRY =====> IMPLICIT PROMPT PLEASE SUPPLY VALUES REQUESTED: COUNTRY= DATREC CONTAINS: COUNTRY LINREC CONTAINS: ENGLAND =====> TO STACK: ENGLAND 6 END =====> TO STACK: END

  20. Dialogue ManagerImplicit PROMPT 8 TABLE FILE CAR =====> Write to FOCSTACK 9 SUM DCOST =====> . 10 BY CAR =====> . 11 IF COUNTRY EQ =====> . 12 &COUNTRY =====> VALUE AVAILABLE DATREC CONTAINS: COUNTRY LINREC CONTAINS: ENGLAND =====> TO STACK: ENGLAND 13 END =====> TO STACK: END

  21. Dialogue Manager-DEFAULT(S) Syntax: -DEFAULT variable=value -DEFAULT &COUNTRY=ENGLAND TABLE FILE CAR SUM RCOST BY COUNTRY IF COUNTRY EQ ‘&COUNTRY’ END EX PRC1 OR EX PRC1 COUNTRY = FRANCE

  22. Dialogue Manager-DEFAULT(S) • -DEFAULT &TST=‘ ‘ MODIFY FILE EMPLOYEE &TST ... EX PRC2 OR EX PRC2 TST=TRACE • -DEFAULT &1=ONLINE TABLE FILE VIDEOTRK ... ON TABLE SET PRINT &1 END EX PRC3 OR EX PRC3 OFFLINE

  23. Dialogue Manager-PROMPT SYNTAX: -PROMPT &var.format.message. -PROMPT &var.(value1,value2,).message. Examples: -PROMPT &COUNTRY.(ENGLAND,FRANCE).COUNTRY?. TABLE FILE CAR SUM RCOST BY COUNTRY IF COUNTRY EQ &COUNTRY END -PROMPT &COUNTRY.(FRANCE,ITALY).COUNTRY?. TABLE FILE CAR SUM DCOST BY CAR IF COUNTRY EQ ‘&COUNTRY’ END

  24. Dialogue Manager-CRTFORM SYNTAX: -CRTFORM -” text <&variable/length “ -” text <T.&variable> “ -” text <D.&variable> “ EXAMPLE: -CRTFORM - “ ENTER COUNTRY <&COUNTRY/10 “ TABLE FILE CAR SUM RCOST BY COUNTRY IF COUNTRY EQ ‘&COUNTRY’ END -CRTFORM “ COUNTRY - <T.&COUNTRY>“ ...

  25. Dialogue Manager-SET SYNTAX: -SET &variable=expression; EXAMPLES: -SET &COUNTRY= IF COUNTRY EQ ‘GERMANY’ - THEN ‘W GERMANY’ ELSE &COUNTRY; -SET &COUNTRY=‘------------’; -SET &COUNTRY=UPCASE(12,&COUNTRY,’A12’); -SET &INCREASE = (&PCT1 / 100) + 1 -SET &NAME = &LN || (‘, ‘ | &FN); -SET &WITHQUO = ‘‘‘‘ | &LN || ‘‘‘‘; -SET &DTX = (YMD ,MDY ,&YMD | ‘X’, ‘A17’);

  26. Dialogue Manager-READ Syntax: -READ ddname [NOCLOSE] &var1.len &var2.len -READ ddname [NOCLOSE] &var1, &var2 • ddname closed with -RUN • ddname closed with statistical variable

  27. Dialogue Manager-READ TABLE FILE CAR SUM COUNTRY BY COUNTRY ON TABLE SAVE END -RUN -READ SAVE &COUNTRY.A10. GRAPH FILE CAR SUM SALES ACROSS MODEL ON GRAPH SAVE AS &COUNTRY WHERE COUNTRY EQ ‘&COUNTRY’ END

  28. Dialogue Manager-TYPE -DEFAULT START=STEP1, END=STEP99 -GOTO &START -STEP1 -TYPE NOW ENTERING &START TABLE FILE ... -RUN -TYPE THE VALUE OF &|END IS &END

  29. Dialogue Manager-WRITE -PROMPT &EXTSORT.(ON,OFF).EXTERNAL SORT?. SET EXTSORT = &EXTSORT TABLE FILE BIGFILE PRINT * BY KEYFLD END -RUN -WRITE OUTFI WHEN EXTERNAL SORT IS &EXTSORT -WRITE OUTFI THE AMOUNT OF LINES IS &LINES -WRITE OUTFI THE BASEIO IS &BASEIO

  30. Navigating The Procedure

  31. Dialogue ManagerNavigating the Procedure • Labels: (-name) • -GOTO label • -IF expression THEN label1 ELSE ... ; • -REPEAT endlabel n TIMES • -INCLUDE focexec

  32. Dialogue Manager-GOTO -DEFAULT START=STEP1,END=STEP99 -GOTO &START -STEP1 TABLE FILE ... -RUN -IF &END EQ ‘STEP1’ GOTO STEP99; -STEP2 TABLE FILE HOLD ... END -RUN -IF &END EQ ‘STEP2’ GOTO STEP99; ... -STEP99 EXIT

  33. Dialogue Manager-IF and -GOTO TABLE FILE CAR SUM COUNTRY BY COUNTRY WHERE COUNTRY EQ ‘ENGLAND’ OR ‘JAPAN’ ON TABLE SAVE END -RUN -LP -READ SAVE &COUNTRY.A10. -IF &IORETURN NE 0 GOTO NOMORE; TABLE FILE CAR SUM RC BY COUNTRY WHERE COUNTRY EQ ‘&COUNTRY’ END -GOTO LP -NOMORE EXIT

  34. Dialogue Manager-IF and -GOTO TABLE FILE CAR SUM COUNTRY BY COUNTRY WHERE COUNTRY EQ ‘ENGLAND’ OR ‘JAPAN’ ON TABLE SAVE END -RUN > NUMBER OF RECORDS IN TABLE= 2 LINES= 2 EBCDIC RECORD NAMED SAVE FIELDNAME ALIAS FORMAT LENGTH COUNTRY COUNTRY A10 10 COUNTRY COUNTRY A10 10 TOTAL 20

  35. Dialogue Manager-IF and -GOTO -LP -READ SAVE &COUNTRY.A10. -IF 0 NE 0 GOTO NOMORE; TABLE FILE CAR SUM RC BY COUNTRY WHERE COUNTRY EQ ‘ENGLAND’ END -GOTO LP -LP -READ SAVE &COUNTRY.A10. -IF 0 NE 0 GOTO NOMORE; TABLE FILE CAR SUM RC BY COUNTRY WHERE COUNTRY EQ ‘JAPAN’ END -GOTO LP

  36. Dialogue Manager-IF and -GOTO -LP -READ SAVE &COUNTRY.A10. -IF 1 NE 0 GOTO NOMORE; -NOMORE EXIT > NUMBER OF RECORDS IN TABLE= 4 LINES= 1 PAUSE.. PLEASE ISSUE CARRIAGE RETURN WHEN READY PAGE 1 COUNTRY RETAIL_COST ------- ----------- ENGLAND 45,319

  37. Dialogue Manager-IF and -GOTO > NUMBER OF RECORDS IN TABLE= 2 LINES= 1 PAUSE.. PLEASE ISSUE CARRIAGE RETURN WHEN READY PAGE 1 COUNTRY RETAIL_COST ------- ----------- JAPAN 6,478

  38. Dialogue Manager-IF -STRT -PROMPT &COUNTRY.A10.ENTER COUNTRY. TABLE FILE CAR SUM RC BY COUNTRY WHERE COUNTRY EQ ‘&COUNTRY’ END -RUN -IF &LINES EQ 0 GOTO ERR; -EXIT -ERR -TYPE NO DATA FOUND FOUND FOR &COUNTRY -GOTO STRT

  39. Dialogue Manager-IF -DEFAULT &PERIOD = 'MONTH' TABLE FILE FINANCE SUM AMOUNT BY ACCOUNT BY CUSIP BY YEAR -IF &PERIOD EQ 'ANNUAL' GOTO NOMORE ELSE - IF &PERIOD EQ 'QUARTER' GOTO QTRLY; BY MONTH -GOTO NOMORE -QTRLY BY QUARTER -NOMORE END

  40. Dialogue Manager-IF -SET &CTR=1; -SET &CTR1=1; -STRT TABLE FILE FINANCE SUM AMOUNT BY ACCOUNT ACROSS MONTH COLUMNS -LP -IF &CTR GT 12 GOTO NOMORE; -SET &XYZ=IF &CTR1 EQ 1 THEN &CTR ELSE ‘AND ‘ | &CTR ; &XYZ -SET &CTR = &CTR + 1; -SET &CTR1 = &CTR1 + 1; -GOTO LP -NOMORE END -EXIT

  41. Dialogue Manager-IF -SET &CTR=7; -SET &CTR1=1; -STRT TABLE FILE FINANCE SUM AMOUNT BY ACCOUNT ACROSS MONTH COLUMNS -LP -IF 7 GT 12 GOTO NOMORE; -SET &XYZ=IF 1 EQ 1 THEN 7 ELSE 'AND ' | 7 ; 7 -SET &CTR = 7 + 1; -SET &CTR1 = 1 + 1; -GOTO LP Note: we changed the counter(CTR) to 7 to limit the length of the output

  42. Dialogue Manager-IF -LP -IF 8 GT 12 GOTO NOMORE; -SET &XYZ=IF 2 EQ 1 THEN 8 ELSE 'AND ' | 8 ; AND 8 -SET &CTR = 8 + 1; -SET &CTR1 = 2 + 1; -GOTO LP -LP -IF 9 GT 12 GOTO NOMORE; -SET &XYZ=IF 3 EQ 1 THEN 9 ELSE 'AND ' | 9 ; AND 9 -SET &CTR = 9 + 1; -SET &CTR1 = 3 + 1; -GOTO LP

  43. Dialogue Manager-IF -LP -IF 10 GT 12 GOTO NOMORE; -SET &XYZ=IF 4 EQ 1 THEN 10 ELSE 'AND ' | 10 ; AND 10 -SET &CTR = 10 + 1; -SET &CTR1 = 4 + 1; -GOTO LP -LP -IF 11 GT 12 GOTO NOMORE; -SET &XYZ=IF 5 EQ 1 THEN 11 ELSE 'AND ' | 11 ; AND 11 -SET &CTR = 11 + 1; -SET &CTR1 = 5 + 1; -GOTO LP

  44. Dialogue Manager-IF -LP -IF 12 GT 12 GOTO NOMORE; -SET &XYZ=IF 6 EQ 1 THEN 12 ELSE 'AND ' | 12 ; AND 12 -SET &CTR = 12 + 1; -SET &CTR1 = 6 + 1; -GOTO LP -LP -IF 13 GT 12 GOTO NOMORE; -NOMORE END -EXIT

  45. Dialogue Manager-IF NUMBER OF RECORDS IN TABLE= 6 LINES= 6 PAUSE.. PLEASE ISSUE CARRIAGE RETURN WHEN READY PAGE 1 MONTH 7 8 9 10 ACCOUNT ---------------------------------------------------------------------------------- 1000 . . . . 1010 . . . . 6500 45,643 . . . 6600 . 12,909 . . 6900 . . 1,743 . 7000 . . . 17,459

  46. Dialogue Manager-INCLUDE fexname TABLE FILE FILE1 -INCLUDE HDNG PRINT RCOST BY COUNTRY END -RUN TABLE FILE FILE2 -INCLUDE HDNG SUM DCOST BY COUNTRY END -INCLUDE PRC3

  47. Debugging

  48. Dialogue ManagerDebugging • EX procedure • Only output from procedure seen • EX procedure ECHO=ON • Output from procedure seen • Stack (after substitution) displayed • EX procedure ECHO=ALL • Output from procedure seen • Dialogue Manager commands echoed • Stack (after substitution) displayed • SET XRETRIEVAL=OFF

  49. Before You leave! Be Sure To Visit Our Problem Isolation Debugging Tool Site http://techsupport.informationbuilders.com/app/css_web_tool/default.htm

  50. QUESTIONS Thanks for Coming!

More Related