Presentation is loading. Please wait.

Presentation is loading. Please wait.

Things You Can Use on Monday

Similar presentations


Presentation on theme: "Things You Can Use on Monday"— Presentation transcript:

1 Things You Can Use on Monday
Rob Palmer Solution Director

2 Things You Can Use on Monday
Agenda SET Parameters Dialogue Manager Reporting Functions Missing Data App Commands Troubleshooting

3 SET Parameters

4 SET Parameters A few of my favourite SET parameters CENT-ZERO CURRSYMB
COUNTWIDTH DIRECTHOLD DUPLICATECOL BYDISPLAY DMPRECISION TARGETFRAME ACROSSPRT ASNAMES HOLDLIST HOLDATTR

5 SET Parameters – CENT-ZERO
Controls the display of the 0 to the left of the decimal Options: ON, OFF Default: OFF SET CENT-ZERO = OFF SET CENT-ZERO = ON

6 SET Parameters – CURRSYMB
Controls the currency symbol printed with M and N formats Options: character, USD, GBP, JPY, EUR, NIS Default: $ SET CURRSYMB = $ SET CURRSYMB = GBP SET CURRSYMB = EUR

7 SET Parameters – COUNTWIDTH
Controls the format size of COUNT columns Options: ON (9), OFF (5) Default: OFF SET COUNTWIDTH = OFF SET COUNTWIDTH = ON

8 SET Parameters – DIRECTHOLD
Controls how HOLD FORMAT FOCUS files are loaded Options: ON (directly), OFF (hold file and Modify) Default: ON SET DIRECTHOLD = OFF READS = 108 SET DIRECTHOLD = ON READS = 54

9 SET Parameters – DUPLICATECOL
Controls how outer verb totals are displayed Options: ON (show as separate column OFF (show in same column) Default: ON SUM SALES SUM SALES BY COUNTRY SET DUPLICATECOL = ON SET DUPLICATECOL = OFF

10 SET Parameters – BYDISPLAY
Controls how BY fields are printed Options: ON, OFF Default: OFF SET BYDISPLAY = OFF SET BYDISPLAY= ON

11 SET Parameters – BYDISPLAY
Controls how BY fields are printed Options: ON, OFF Default: OFF SET BYDISPLAY = OFF SET BYDISPLAY= ON Excel rows

12 SET Parameters – DMPRECISION
Controls decimal precision of & variables Options: OFF, n Default: OFF If OFF, everything is an integer Otherwise, you decide -SET &TEST = ; -TYPE TEST = &TEST SET DMPRECISION = OFF TEST = &TEST = 128 SET DMPRECISION = 1 &TEST = 128.9 SET DMPRECISION = 2 &TEST =

13 SET Parameters – TARGETFRAME
Controls target frame for drilldown display Options: framename Default: current framename Explicit “TARGET=” in drilldown overrides this setting No Setting

14 SET Parameters – TARGETFRAME
Controls target frame for drilldown display Options: framename Default: current framename Explicit “TARGET=” in drilldown overrides this setting No Setting SET TARGETFRAME = _blank

15 SET Parameters – ACROSSPRT
Compress rows in report using PRINT and ACROSS Options: NORMAL, COMPRESS Default: NORMAL SET ACROSSPRT= NORMAL SET ACROSSPRT= COMPRESS

16 SET Parameters – ACROSSPRT (cont)
SET ACROSSPRT = NORMAL 4 rows SET ACROSSPRT = COMPRESS Compressed to 2 rows

17 SET Parameters – ASNAMES, HOLDLIST, HOLDATTR
Affect contents of hold files and MFDs ASNAMES (enables AS names to be used as column names) Options: ON, OFF, FOCUS Default: FOCUS HOLDLIST (keeps non-printed columns out of hold file) Options: ALL, PRINTONLY, ALLKEYS Default: ALL HOLDATTR (carries field attributes into the hold file) Options: ON, OFF Default: OFF

18 SET Parameters – ASNAMES etc. (cont)
All defaulted SET ASNAMES = ON – AS ‘UTILIZATION’ becomes fieldname SET HOLDLIST = PRINTONLY – non-printed columns excluded SET HOLDATTR = ON – TITLEs from original MFD carried forward

19 SET Parameters – ASNAMES and ACROSS
Affects fieldnames of ACROSS columns TABLE FILE CAR SUM SALES BY COUNTRY ACROSS BODYTYPE ON TABLE HOLD END SET ASNAMES = OFF SET ASNAMES = ON

20 SET Parameters We will look at a few other SET parameters but later in the context of how they are used XRETRIEVAL HOLDMISS HNODATA NODATA

21 Dialogue Manager

22 Dialogue Manager – ASIS
In a Dialogue Manager variable blank = 0 = ' 0' = ' 0000' Dialogue Manager variables have no format ASIS allows us to test the true value of the variable -SET &VAR1 = ' '; -SET &VAR2 = 0; &VAR1 EQ &VAR 2 = TRUE but ASIS(&VAR1) EQ ASIS(&VAR 2) = FALSE ASIS(&VAR1) EQ 0 = FALSE ASIS(&VAR2) EQ ‘ ’ = FALSE

23 Dialogue Manager – Some system variables
&FOCMODE Returns the operating system you are running in Enables you to take action based on where you are Values: WINNT, UNIX, etc. &APPROOT Returns the approot directory You can test on it You can also parse it apart &FOCFEXNAME Returns the name of the currently running Focexec You can pass this along and know who called “me”

24 Dialogue Manager – Subscripted & variables
& variables can be numerically subscripted If we have &TEST, no problem, we refer to &TEST But what if we want &TEST1, &TEST2 … &TESTn Maybe we are looping We can create and use &TEST.&n where n is an integer -REPEAT VAR_LOOP FOR &I FROM 1 TO 10 -SET &TEST.&I='This is variable ' | &I; -VAR_LOOP -? &

25 Reporting

26 Reporting TABLEF and RDBMS Conditional Joins Dynamic Formatting

27 Reporting – TABLEF and RDBMS
WebFOCUS can sort and RDBMS can sort Make sure one does and make sure both don’t Verify that RDBMS is sorting SQL TRACE ? STATS AGGREGATION DONE …

28 Reporting – TABLEF and RDBMS (cont)
If RDBMS sorts your request, change TABLE to TABLEF TABLEF No sorting done by WebFOCUS No Internal Matrix created Report written faster Some reporting commands require TABLE Watch for errors and warnings Use TABLEF whenever possible May improve performance dramatically Verify using traces and “? STAT”

29 Reporting – Conditional Joins
Joins do not have to be based on equality tests All relational tests are available JOIN … WHERE … NE JOIN … WHERE … GT JOIN … WHERE … LT etc.

30 Reporting – Conditional Joins (cont)
In JOIN tool select the JOIN and “Create/Edit Selection”

31 Reporting – Conditional Joins (cont)
You will be presented with a familiar panel The Where Expression Builder The expression will be EQ by default Amend as required I changed it to GT

32 Reporting – Conditional Joins (cont)
We now JOIN based on a GT test The WHERE clause will show up in your SQL JOIN FILE PORTFOLIO_BASE AT PORTFOLIO_BASE.PORTFOLIO.SIC_CODE TO MULTIPLE FILE INDUSTRY AT INDUSTRY.INDUSTRY.SIC_CODE TAG J0 AS J0 WHERE PORTFOLIO_BASE.PORTFOLIO.SIC_CODE GT J0.INDUSTRY.SIC_CODE; END

33 Reporting – Dynamic Formatting
By default every value in a column is formatted the same I5, D12.2, A10 … But what if the rows require different formats Some may be dollars, percents, units, etc. Format each row’s value differently Create a business rule to set each row’s format

34 Reporting – Dynamic Formatting (cont)
Calculate the format with a COMPUTE Reformat the measure referencing the computed column TABLE FILE METRICS SUM COMPUTE FLDFMT/A8 = DECODE METRIC ('Revenue' 'D12Mb 'Units' 'D12.2' 'Margin' 'D12.1%' 'Bonus' 'D12.2M'); NOPRINT VALUE/FLDFMT BY METRIC END

35 Reporting – Dynamic Formatting (cont)
Run the report Every row gets the appropriate format COMPUTE FLDFMT/A8 = DECODE METRIC ('Revenue' 'D12M' 'Units' 'D12.2' 'Margin' 'D12.1%' 'Bonus' 'D12.2M'); NOPRINT VALUE/FLDFMT

36 Functions

37 Functions A few of my favourite functions STRIP STRREP DB_LOOKUP
PUTDDREC

38 Functions - STRIP Removes a character from a string
STRIP(length, string, char, outfield) PHONE_DIGITS/A10 = STRIP(12, PHONE, '-', 'A10');

39 Functions - STRREP Replace all instances of a string with another string STRREP (inlength, instring, searchlength, searchstring, replength,   repstring, outlength, outstring) CITY_SHORT/A35 = STRREP (35, CITY, 13, 'United States', 2, 'US', 35, 'A35');

40 Functions – DB_LOOKUP Lookup a value in one data source while reading another No JOIN required Not a replacement for JOIN – use when appropriate DB_LOOKUP(look_mf, srcfld1, lookfld1, srcfld2, lookfld2, ..., returnfld) MANAGER/A10 = DB_LOOKUP (FINANCE, REGION, REGION, SALES_MANAGER);

41 Functions – PUTDDREC Write data to a flat file
Executed as part of a calculation PUTDDREC(ddname, dd_len, record_string, record_len, outfield) APP FI WRITEOUT DISK summit_work/writeout.txt TABLE FILE CAR SUM SALES COMPUTE TEXT/A52='Sales for ' | CAR | ' in ' | COUNTRY | ' were ' | EDIT(SALES); COMPUTE WRITE_TEXT/I1=PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT BY COUNTRY BY CAR END

42 Functions – PUTDDREC (cont)
COMPUTE WRITE_TEXT/I1=PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT

43 Functions – DB_LOOKUP and PUTDDREC
Both functions are executed as part of a calculation Can be conditionally execute based on IF–THEN–ELSE logic You decide exactly when and what is done Based on your test and your data at run time MANAGER/A10 = IF SALES LT THEN DB_LOOKUP(FINANCE, REGION, REGION, SALES_MANAGER) ELSE ' '; COMPUTE WRITE_TEXT/I1=IF REGION EQ 'HR' THEN PUTDDREC('Sales Data N/A', 8, TEXT, 52, 'I1') ELSE PUTDDREC('WRITEOUT', 8, TEXT, 52, 'I1'); NOPRINT

44 Missing Data

45 Missing Data Missing data in WebFOCUS can refer to:
Missing data values or nulls Missing data segments We will be looking at ways to handle missing values In calculations In HOLD files On report output

46 Missing Data – In calculations
Example: Sales in HR is missing but treated like 0 in the calculation Is this right? Results of calculations can be made “missing” based on availability of components PROFIT/D12 = SALES – COSTS; Department Sales Costs Profit East 100 90 10 HR . -90 West

47 Missing Data – In calculations (cont)
Supports a result of MISSING (MISSING ON) Demands that all components be present (NEEDS ALL) Now HR has profit of MISSING because SALES is MISSING NEEDS ALL could also be NEEDS SOME Supported in Dev Studio PROFIT/D12 MISSING ON NEEDS ALL = SALES – COSTS; Department Sales Costs Profit East 100 90 10 HR . West -90

48 Missing Data – In HOLD files
If source data contains nulls, nulls will move to HOLD files Common with RDBMS data What happens if MISSING data created by the report TABLE FILE CAR SUM SALES BY COUNTRY ACROSS BODYTYPE ON TABLE HOLD END

49 Missing Data – In HOLD files (cont)
HOLDMISS Enables created MISSING data to be held as missing Options: ON, OFF Default: OFF TABLE FILE CAR ACROSS BODYTYPE ON TABLE HOLD END SET HOLDMISS = ON

50 Missing Data – HNODATA vs. NODATA
Controls characters printed for missing values Options: character string Default: . HNODATA Controls characters held for missing alpha values Note: If set, numeric missing values held as blank

51 Missing Data – HNODATA vs. NODATA (cont)
SET NODATA = ‘N/A’ Report Hold File SET HNODATA = ‘N/A’

52 APP Commands

53 APP Commands APP commands enable us to work with the application namespace Control the use of files in the path Manipulate the path Interrogate the path Interrogate the application folders Operating System agnostic Works the same everywhere

54 APP Commands – Control and use files
APP HOLD appname Directs all hold files to a specific app directory APP HOLD summit_work All hold files and their MFDs go to summit_work APP HOLDMETA appname Directs only the hold file MFDs to a specific app directory APP HOLDMETA summit_work MFDs go to summit_work, data goes to temp APP HOLDDATA appname Directs only the hold data file to a specific app directory APP HOLDDATA summit_work Data goes to summit_work, MFDs go to temp

55 APP Commands – Control and use files (cont)
If the files exists, you may need to filedef it FILEDEF and DYNAM are operating system specific APP FI is operating system agnostic APP FI holdname DISK appname/filename.ext Works on all platforms Can also be used in Master Files to specify the data file DATASET=‘appname/filename.ext’ APP FI WRITEOUT DISK summit_work/writeout.txt FILE=GLACCOUNT ,SUFFIX=FIX ,DATASET='ibisamp/glaccount.ftm'

56 APP Commands – Manipulate the Path
Change the path on the fly APP PREPENDPATH adds your app to the front of the path APP APPENDPATH adds your app to the end of the path Applies to the current process only Allows you to bring app folders into the path temporarily summit_work is now the first app folder in the path summit_work is now the last app folder in the path APP PREPENDPATH summit_work APP APPENDPATH summit_work

57 APP Commands – Manipulate the Path (cont)
By default APP folders are subdirectories of APPROOT APP MAP allows you to assign a logical app name to any available physical directory Can be placed in the profiles or dynamic in a Focexec APP MAP appname physicalname Can be used like any other available APP folder Hold to it, put it in the path, etc. APP MAP share \\robpalmer\share APP MAP summit_temp c:\temp\summit_temp

58 APP Commands – Interrogate the Path
APP SHOW PATH Shows you the path Notice the two we just APP MAPped You see it, but you can’t act on it Let’s act on it

59 APP Commands – Interrogate the app folders
APP LIST [HOLD] Lists all real and mapped application folders HOLD option creates focappl APP LIST HOLD TABLE FILE focappl PRINT * END

60 APP Commands – Interrogate the app folders (cont)
APP QUERY appname [HOLD] Lists contents of selected application HOLD option creates focappq APP QUERY summit_work HOLD TABLE FILE focappq PRINT * END

61 Troubleshooting

62 Troubleshooting Leave a trail SQL Traces, XRETRIEVAL &ECHO, &STACK
WHENCE IB Tech Support as a Search Engine

63 Troubleshooting – Leave a trail
Hansel and Gretel When debugging, leave a trail Can find your changes later and remove them

64 Troubleshooting – SQL Traces
Have a Focexec handy to quickly turn on SQL traces -INCLUDE trace trace.fex SET TRACEOFF=ALL SET TRACEON=SQLAGGR//CLIENT SET TRACEON=STMTRACE//CLIENT SET TRACEUSER=CLIENT

65 Troubleshooting – XRETRIEVAL
Controls whether WebFOCUS communicates with the database Options: ON, OFF Default: ON SET XRETRIEVAL = ON -INCLUDE trace TABLE FILE PORTFOLIO SUM AUTHORIZED BY MONTH ON TABLE HOLD END SET XRETRIEVAL = OFF

66 Troubleshooting - &ECHO, &STACK
Traces WebFOCUS commands Options: ON, ALL, OFF Default: OFF &STACK Controls whether FOCSTACK is executed or not FOCSTACK is the command execution stack FOCSTACK does not contain Dialogue Manager commands Options: ON, OFF Default: ON

67 Troubleshooting - &ECHO, &STACK (cont)
Used together they provide a valuable technique Use &ECHO to see WebFOCUS traces Use &STACK to disable execution of the command stack Enables troubleshooting of: Dialogue manager logic Execution flow Variable resolution Does not incur cost of report execution Traces available in HTML source

68 Troubleshooting - &ECHO, &STACK (cont)
To trace the command stack only Show all WebFOCUS commands TABLE, GRAPH, MATCH, JOIN etc., Show the resolved values of all & variables Does not show any Dialogue Manager commands Does not execute the command stack -SET &ECHO = ON; -SET &STACK = OFF;

69 Troubleshooting - &ECHO, &STACK (cont)
To trace Dialogue Manager and the command stack Show all WebFOCUS commands TABLE, GRAPH, MATCH, JOIN etc., Show the resolved values of all & variables Shows all Dialogue Manager commands Shows navigation and process flow Does not execute the command stack -SET &ECHO = ALL; -SET &STACK = OFF;

70 Troubleshooting – WHENCE
Shows where a selected module is being pulled from Can search for Focexecs, Master Files and Access Files WHENCE focexec FOCEXEC WHENCE masterfile MASTER WHENCE accessfile ACCESS Returns physical location of the module Verify you are accessing and using the one you think you are WHENCE controlchart FOCEXEC WHENCE car MASTER WHENCE portfolio ACCESS

71 IB Tech Support as a Search Engine
Set up Tech Support as Search Engine for your browser In IE8, click Search Options dropdown (upper right) Select Find More Providers…

72 IB Tech Support as a Search Engine
Scroll to the bottom and select “Create your own Search Provider” You will be presented with the following form

73 IB Tech Support as a Search Engine
To find the required URL: Open a new browser window or tab Access the IB Enterprise Content Library Search for TEST (upper case) Copy the URL in the address bar Paste the URL into the form

74 IB Tech Support as a Search Engine
Press Install Search Provider Press Add on the confirmation panel

75 IB Tech Support as a Search Engine
Your all set Click on the Search Providers drop down IB Tech Support is now listed Select it and enter search criteria

76 IB Tech Support as a Search Engine
Your search results are presented using Magnify A maximum of 1000 results will be returned Category tree on the left enable further filtering Select Tabular View to see results as an Active Report

77 IB Tech Support as a Search Engine
Select Tabular View to see results as an Active Report

78 Come back next year for:
Thank You! Come back next year for: More Things You Can Use on Monday or Things You Can Use on Tuesday I haven’t decided yet!!


Download ppt "Things You Can Use on Monday"

Similar presentations


Ads by Google