WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

129
WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation

Transcript of WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

Page 1: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WebFOCUS Tips and Techniques The Next Generation

Page 2: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Joyce HalfordJohn Kutasz

Summit User Conference June 2008

Page 3: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Joyce Halford

Page 4: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 5: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 6: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 7: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 8: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 9: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 10: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 11: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Order Report By or BY TOTAL

Page 12: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHENCE

Page 13: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHENCE

How can you determine which MASTER is being used when MASTER files exist on multiple platforms for the same data source?

WHENCE filename MASTER

This is only an issue if the MASTER files are different.

An example of this problem can happen if MASTER files are created on a mainframe, copied to a local environment and at a later date, the MASTER files on the mainframe are updated but not copied to the local environment.

Page 14: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHENCE

WHENCE CAR MASTER

Page 15: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHENCE

FOCEXEC and FOCUS file locations can also be determined using WHENCE

WHENCE filename FOCEXEC

WHENCE filename FOCUS

Page 16: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 17: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

WHERE SALARY GT 56200

Page 18: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE SALARY GT 56200

WHERE TOTAL

Page 19: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Subset of Previous Page

Page 20: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 21: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 22: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 23: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 24: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 25: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 26: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE TOTAL

Page 27: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 28: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Report Caster Bursting is on the primary sort field

By concatenating multiple sort fields you can burst at a more detailed level.

Page 29: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 30: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 31: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 32: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 33: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 34: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 35: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Concatenate Fields for Sorting

Page 36: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 37: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 38: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 39: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box (Populated from a Table/File)

Page 40: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box (Populated from a Table/File)

Page 41: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 42: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box (Populated from Focexec Output)

Page 43: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 44: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 45: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 46: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 47: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 48: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 49: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 50: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 51: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 52: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 53: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

How to Build a Dynamic Dropdown Box

Page 54: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

Page 55: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

Conditional WHERE statements

–SET &parameter

to control display of WHERE statements

in a TABLE request

Another option is to use a

–GOTO label to jump around WHERE statements

This technique does not allow you to work in the GUI.

Page 56: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

Example of -GOTO

–IF &COUNTRY EQ ‘ALL COUNTRIES‘ GOTO SKIPWHR

WHERE COUNTRY EQ &COUNTRY

-SKIPWHR

Page 57: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

Page 58: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

Page 59: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

Page 60: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

Page 61: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

Page 62: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

Page 63: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• –SET &parameter

-* File DMANDWHR.fex-DEFAULT &COUNTRY = 'ENGLAND‘

-SET &SELWHR = IF &COUNTRY EQ 'ALL COUNTRIES' THEN ' '- ELSE 'WHERE COUNTRY EQ ' | '''' | &COUNTRY | '''' ;

TABLE FILE CARPRINT DEALER_COST RETAIL_COST &SELWHRBY COUNTRYBY CARBY MODELBY BODYTYPEHEADING"The following line displays the value of amperSELWHR""&SELWHR"" ""The value of amperCOUNTRY is &COUNTRY"" "FOOTING""...END

Page 64: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

• If you use the report layout tool,

an alternate coding technique is used.

Page 65: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

ALL SELECTED IN DROPDOWN BOX

TABLE FILE CAR

PRINT COUNTRY MPG

BY COUNTRY

WHERE MPG GE 20

WHERE CAR EQ 'FOC_NONE'

END

Page 66: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WHERE

AUDI SELECTED IN DROPDOWN BOX

TABLE FILE CAR

PRINT COUNTRY MPG

BY COUNTRY

WHERE MPG GE 20

WHERE CAR EQ ‘AUDI'

END

Page 67: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

Page 68: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

• If a parameter has a value of FOC_NONE,

any row of code containing it will be ignored

when the report runs.

• One use for this is the WHERE statement example that you have already seen.

Page 69: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

-SET &PARM1 = 'FIRST VALUE';-SET &PARM2 = 'SECOND VALUE';-SET &PARM3 = 'THIRD VALUE';

TABLE FILE CARPRINT CARBY COUNTRYHEADING"heading line 1 parm value is: <+0>&PARM1<+0> ""heading line 2 parm value is: <+0>&PARM2<+0> ""heading line 3 parm value is: <+0>&PARM3<+0> "END

Page 70: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

Page 71: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

-SET &PARM1 = 'FIRST VALUE';-SET &PARM2 = ‘FOC_NONE';-SET &PARM3 = 'THIRD VALUE';

TABLE FILE CARPRINT CARBY COUNTRYHEADING"heading line 1 parm value is: <+0>&PARM1<+0> ""heading line 2 parm value is: <+0>&PARM2<+0> ""heading line 3 parm value is: <+0>&PARM3<+0> "END

Page 72: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

Page 73: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Ignoring Code with FOC_NONE

Notes:

• The ONLY row ignored is the one containing the display or evaluation of the parameter.

• If you have a heading or a selection that wraps to more than one row, only part of it will be ignored, likely causing a syntax error.

The following is an example:

"heading line 2 parm value is: <+0>&PARM2<+0> "

Page 74: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

US Bank Panel

John Kutasz

Page 75: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

Page 76: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

If you want to give logos,

web pages, and reports

a matching look and feel,

Windows comes with something

you can use to identify a

specific color

– the ‘Paint’ tool.

Page 77: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

For Example, I may have a report that contains data for FedEx. If I call up their web site and press Cntl-PrintScreen, I can capture a picture of their page.

Page 78: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

From the Windows XP Desktop, choosing Start / All Programs / Accessories / Paint will bring you to the paint tool.

Page 79: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

Choose Edit / Paste or Cntl-V to paste the clipboard image into the Paint tool. Note that the image you pasted contains a picture of the tool bar from the browser – these controls do NOT work.

Page 80: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

Choose the ‘eyedropper’ tool from the Paint toolkit, and click it on a color you want to match.

You should notice a brief flash of color in the rectangle under the Paint toolkit, but then the screen will go back exactly the way it looked before taking the eyedropper sample.

Page 81: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

From the Paint Menu, choose Colors / Edit Colors / and then Define Custom Colors.

Page 82: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

The image below is zoomed in on the Custom Colors box. The color that was chosen with the eyedropper shows in the rectangle near the bottom, and the exact color settings RGB(102, 0, 153) appear at the bottom right.

Page 83: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

NOTE:

Some images on the web are not made up of solid colors. They may be nearby dots of different colors that blend together to appear as a single color. Sampling may only get you one pixel value.

Page 84: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Color Matching

NOTE:

Some monitors may not be set to display millions of colors. The ‘web safe’ palette contains 216 colors that all browser settings will show. Any combination of 0, 51, 102, 153, 204, and 255 should be visible on any color monitor.

Page 85: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

Page 86: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

• This technique uses a very simple report. We are printing:

– the first 8 fields of the CAR file

– with the default font,

– turning gridlines on

– displaying in PDF format.

Page 87: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell PaddingHow Much Will Fit on a PDF Page?

A very simple report built in the GUI tool

Page 88: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

The first 6 columns appear on Page 1

Page 89: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

The other 2 columns are on Page 2

Page 90: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

• Some possible changes:

– Use a smaller font

– Change the report to landscape mode

– Change to legal paper

– Abbreviate column titles to make them narrower.

Page 91: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

• This technique does none of those things. Instead, do the following:

– Choose Report / Format from the pulldown at the top of the page

– Go to the option called ‘Cell Padding’. By default, there is a value of ‘not set’. I put in a value of 0.08 for the left and right.

Page 92: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding The stylesheet settings are called LEFTGAP and RIGHTGAP

Page 93: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding You Get Extra Space in 2 Places in EVERY Column

All 8 columns now display on a single page.

Page 94: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Cell Padding How Much Will Fit on a PDF Page?

• You saw on the previous page that the font and the page size are the same, there is simply less room between the data and the gridlines.

• The benefit here is that a small amount of space is saved in 2 places in every column of the report. It is still surprising to see how much additional room it adds up to.

Page 95: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 96: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

•Universal Concatenation - the MORE command - physically appends multiple files

•The sources can have different formats (Focus, DB2, etc), and some can have more fields than others.

•But, any specific fields being combined need to have the same names, and the same formats.

Page 97: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

•I have always found Excel to be a handy tool for data entry.

•The new Upload Data File option makes it much, much easier to use an Excel file as a data source.

Page 98: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Step 1 – hold existing data to Excel format

Page 99: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Step 2 – Using the spreadsheet as a template,

input new data

Page 100: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

New Option – Master Files / New / Upload Data File

Page 101: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 102: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 103: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Previous Page, Notes:

– Check the master file of the original table (CAR, in this example) and set field formats to match

– Click ‘Apply’ for each field as the format is changed, then move to next field

Page 104: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Previous Page, Notes, continued:

– Choose your application from the bottom dropdown box.

– If the leftmost column runs off the edge of the page, change to a non-maximized view of the inner window.

Page 105: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

All Fields, All DataTABLE FILE CAR

PRINT COUNTRY CAR MODEL RETAIL_COST DEALER_COST SALES …

ON TABLE HOLD AS ALLCAR

MORE

FILE CARFILENEWDATA

END

TABLE FILE ALLCAR

PRINT COUNTRY CAR MODEL RETAIL_COST DEALER_COST SALES …

BY COUNTRY NOPRINT BY CAR NOPRINT

END

Page 106: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 107: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Only Selected Fields, Selected Countries

TABLE FILE CARPRINT COUNTRY CAR MODEL WHERE COUNTRY CONTAINS 'GERMANY'ON TABLE HOLD AS ALLCARMOREFILE CARFILENEWDATAWHERE COUNTRY CONTAINS 'GERMANY'ENDTABLE FILE ALLCARPRINT COUNTRY CAR MODELBY COUNTRY NOPRINT BY CAR NOPRINTEND

Page 108: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 109: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

If there is a field in some source files that is not in all of them (for example, a new category for newer cars), a DEFINE can be used to add a blank (or zero) value into the request from tables where it does not exist.

Page 110: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

DEFINE FILE CAR

HYBRID/A50 = ' ';

END

TABLE FILE CAR

PRINT COUNTRY CAR MODEL HYBRID

ON TABLE HOLD AS ALLCAR

MORE

FILE CARFILENEWDATA

END

TABLE FILE ALLCAR

PRINT COUNTRY CAR MODEL HYBRID

BY COUNTRY NOPRINT BY CAR NOPRINT

END

Page 111: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Page 112: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

Combining Data

Unlike using a JOIN, there is no need for any fields in the source files to have the same value.

Also, since the result is a simple, single segment file, it tends to be very easy to use for reporting (no ‘testing in independent sets of data’).

Page 113: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Page 114: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

• The ASNAMES function allows you to assign the names of fields when you put them into HOLD files.

Page 115: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Page 116: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Page 117: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Page 118: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Page 119: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

A problem arises when you take the identical request and store the results in a hold file. The column title information is not saved into the hold master, and you have 2 fields called SALES.

An additional complication in reporting from a HOLD file is that even if you refer to SALES multiple times, you will always get the values from the first column with that name.

Page 120: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES – the Solution

Page 121: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES – the Solution

Page 122: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES – the Solution

And the values used for the column titles get passed to the HOLD file

Page 123: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

A potential complication: you use a common method of making column titles look better:

Page 124: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

The comma used for line wrapping causes only the first part of the name to be captured.

Page 125: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

Some things to be aware of when holding to FOCUS format files:

TABLE FILE CARSUM SALES AS 'COUNTRYSALES'BY COUNTRYSUM SALES AS 'MODELSALES'BY COUNTRYBY MODELON TABLE HOLD AS HOLDA FORMAT FOCUS INDEX SALES

Page 126: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

The default value for ASNAMES is ‘FOCUS’, not ‘OFF’. So if you hold to a FOCUS file, ASNAMES will work automatically.

If you are indexing a field (or fields) the instruction on which field(s) to index refers to the originating fieldname, NOT to the value that ASNAMES will assign

If you are indexing a field, the maximum length of an indexed field is 12 characters – so you need to limit the length of these fieldnames.

Page 127: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

ASNAMES

And finally: whenever I am putting an item into a hold file, I try never to use a name for a field that is the same as a ‘real’ fieldname that exists in any of the source master files. This holds true for fields I create with either DEFINE or COMPUTE, as well as for fields being renamed using ASNAMES. Assigning the same name to something that does not represent the original data field can only lead to confusion and misery (if not for you, then for someone trying to use your code in the future).

Page 128: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WebFOCUS Tips and Techniques

• Questions

Page 129: WebFOCUS Tips and Techniques WebFOCUS Tips and Techniques The Next Generation.

WebFOCUS Tips and Techniques

WebFOCUS Tips and Techniques

Thank you for attending