The Basics of FOCUS Reporting Syntax

Slides:



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

XP New Perspectives on Microsoft Access 2002 Tutorial 61 Microsoft Access 2002 Tutorial 6 – Creating Custom Reports.
Microsoft Access 2013 ®® Tutorial 7 Creating Custom Reports.
INSERT BOOK COVER 1Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
Copyright 2007, Information Builders. Slide 1 Accumulation Techniques for Reporting with WebFOCUS Kyle Hachey Systems Engineer.
1 Copyright 2007, Information Builders. Slide 1 Nat Poe WebFOCUS Debugging Techniques.
Copyright 2007, Information Builders. Slide 1 Tips and Techniques From the FOCWIZARDs Art Greenhaus & Noreen Redden FOCWIZARDS Tech Summit, 2008.
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
Developing Effective Reports
Introduction to Query Part 2. Query Topics Joining Files Defining Result Fields Complex Record Selection Formatting Output Creating Reports Using Multiple.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
1 JOIN: Rules, Roles, and Conventions Floria Foote June 2008.
Copyright 2007, Information Builders. Slide 1 FOR and the FML Syntax Noreen Redden Information Builders FOCUS Users of New England.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 3 Analyzing Data and Creating Reports.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
1 Lesson 18 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Copyright 2007, Information Builders. Slide 1 Tips and Techniques From the FOCWIZARDs Noreen Redden Technical Director, Advanced Technical Support August.
1 Reports. 2 Objectives  Use concatenation in a query  Change column headings and formats  Add a title to a report  Group data in a report  Include.
XP. Objectives Sort data and filter data Summarize an Excel table Insert subtotals into a range of data Outline buttons to show or hide details Create.
Copyright 2007, Information Builders. Slide 1 FOCUS Internals: Part 2 Update for 7.6.x Renee Teatro FUN Conference August 2008 Internals of Output Processing.
Chapter 5 Working with Multiple Worksheets and Workbooks
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
1.  Introduction  The Benefits of the Report Writer Module ◦ For Detail and Summary Printing ◦ For Control Break Processing ◦ For Printing Headings.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T3: Problem Solving Using Excel 2007.
COBOL for the 21 st Century Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout (Emeritus)
Printing Reports. Creating Reports  Reports are the best way to put information from database onto paper, PDF files, and other formats.  In a report,
1 Copyright © Oracle Corporation, All rights reserved. Writing Basic SQL SELECT Statements.
GET 236: E NTERPRISE DATA ANALYSIS : TOOLS AND TECHNIQUES W EEK 03: I MPORT AND V ALIDATE DATA.
Copyright 2007, Information Builders. Slide 1 TABLE FILE: The Basics Noreen Redden FOCWizard June, 2008.
Chapter 4 Crystal Report Presenter: PEN PHIROM (MscIT) Phone:
MICROSOFT ACCESS – CHAPTER 5 MICROSOFT ACCESS – CHAPTER 6 MICROSOFT ACCESS – CHAPTER 7 Sravanthi Lakkimsety Mar 14,2016.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Problem Solving Using Excel
Microsoft Office Access 2010 Lab 1
Retrieving Data Using the SQL SELECT Statement
Microsoft Office Access 2010 Lab 3
Working in the Forms Developer Environment
Analyzing Data Module 4.
Writing Basic SQL SELECT Statements
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Microsoft Office Access 2010 Lab 2
Practical Office 2007 Chapter 10
Creating LOVs and Editors
Introduction to Microsoft Access
Inside Module 10 Editing TurboIMAGE Datasets Page
GO! with Microsoft Access 2016
Using the Set Operators
Creating, Sorting, and Querying a List
Intro to PHP & Variables
Agenda: 10/05/2011 and 10/10/2011 Review Access tables, queries, and forms. Review sample forms. Define 5-8 guidelines each about effective form and report.
Microsoft Office Access 2003
Database Applications – Microsoft Access
Instructor: Raul Cruz-Cano
Designing and Debugging Batch and Interactive COBOL Programs
Chapter 3 The DATA DIVISION.
CIS16 Application Programming with Visual Basic
An Introduction to Structured Program Design in COBOL
Structured COBOL Programming
Chapter 14 Sorting and Merging.
Microsoft Official Academic Course, Access 2016
Creating your first C program
Introduction to Customizing Reports in SAP
Navya Thum January 30, 2013 Day 5: MICROSOFT EXCEL Navya Thum January 30, 2013.
ORACLE.
CHAPTER 17 The Report Writer Module
From and Report.
Exploring Microsoft Office Access 2010
Using the Set Operators
Presentation transcript:

The Basics of FOCUS Reporting Syntax Report Debugging Techniques The Basics of FOCUS Reporting Syntax Nat Poe Information Builders

Report Debugging Techniques Overview This session is designed for developers who have been creating reports in WebFOCUS and would like to learn the underlying language generated by WebFOCUS. We will review some FOCUS basics, build a report in Report Painter and then take it apart in the Text Editor. Emphasis on what happens when will be stressed.

FOCUS Basic Reporting - Overview What is FOCUS? Reporting and database management tool from Information Builders Accesses a wide variety of files and databases (SQL, VSAM, etc.) Consistent, regardless of computer platform (TSO, UNIX, etc.) Utilizes simple words and phrases (4th generation language)

What is Needed to Create a Report? FOCUS Basic Reporting - Overview What is Needed to Create a Report? Data Raw material for reports 000000410910211EDP690 03100.00. MA 000000380910605UNI780 03350.00. IA 000000370910601UMI710 02050.00. MI 000000360901105EDP690 03000.00. NJ 000000350900928SSI220 01850.00. TX 000000350890710MC90 01730.00. NY 000000350890508UMI720 03350.00. MI 000000340910117SSI670 03300.00. MO

What Else is Needed to Create a Report? FOCUS Basic Reporting - Overview What Else is Needed to Create a Report? Data File Description FILENAME=TRAINING, SUFFIX=FOC SEGNAME=TRAINING, SEGTYPE=SH3 FIELDNAME=PIN, ALIAS=ID, FORMAT=A9, INDEX=I, $ FIELDNAME=COURSESTART, ALIAS=CSTART, FORMAT=YMD, $ FIELDNAME=COURSECODE, ALIAS=CCOD, FORMAT=A7, $ FIELDNAME=EXPENSES, ALIAS=COST, FORMAT=D8.2, $ FIELDNAME=GRADE, ALIAS=GRA, FORMAT=A2, $ FIELNAMED=LOCATION, ALIAS=LOC, FORMAT=A6, $ A template to describe the data

What Else is Needed to Create a Report? FOCUS Basic Reporting - Overview What Else is Needed to Create a Report? Data File Description FOCUS Commands Report Request TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END

FOCUS Basic Reporting - Overview FOCUS Commands Common words and phrases say what is in a report, not how to create it Each FOCEXEC is identified with a name, like MYRPT TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END Refers to field names found in the file description A file with FOCUS commands is called a FOCEXEC

FOCUS Basic Reporting - Overview FOCUS Report Examples This is the MYRPT FOCEXEC PAGE 1 PIN EXPENSES COURSESTART --- -------- ----------- 000000010 2,300.00 09/18/1989 000000030 2,600.00 03/13/1991 2,300.00 05/30/1990 000000040 3,400.00 05/13/1990 000000050 3,300.00 05/22/1989 000000080 3,200.00 06/19/1991 3,350.00 02/14/1991 000000100 3,100.00 06/25/1990 000000110 1,800.00 04/29/1991 2,500.00 11/22/1990 2,400.00 05/14/1990 000000120 2,200.00 07/16/1990 000000140 3,600.00 10/02/1989 TABLE FILE TRAINING PRINT EXPENSES COURSESTART/MDYY BY PIN END

FOCUS Basic Reporting - Overview A FOCUS Report - Detail PAGE 1 PIN EXPENSES COURSESTART --- -------- ----------- 000000010 2,300.00 09/18/1989 000000030 2,600.00 03/13/1991 2,300.00 05/30/1990 000000040 3,400.00 05/13/1990 000000050 3,300.00 05/22/1989 000000080 3,200.00 06/19/1991 3,350.00 02/14/1991 000000100 3,100.00 06/25/1990 000000110 1,800.00 04/29/1991 2,500.00 11/22/1990 2,400.00 05/14/1990 000000120 2,200.00 07/16/1990 000000140 3,600.00 10/02/1989 A detail report displays each individual data record Suppose you only need to display the total expenses for each employee

A FOCUS Report - Summary FOCUS Basic Reporting - Overview A FOCUS Report - Summary PAGE 1 COURSESTART PIN EXPENSES COUNT --- -------- ----------- 000000010 2,300.00 1 000000030 4,900.00 2 000000040 3,400.00 1 000000050 3,300.00 1 000000080 6,550.00 2 000000100 3,100.00 1 000000110 6,700.00 3 000000120 2,200.00 1 000000140 3,600.00 1 A summary report combines data records for totals Show how many records went into the total Suppose you need both detail and summary information in the same report

A FOCUS Report - Detail and Summary FOCUS Basic Reporting - Overview A FOCUS Report - Detail and Summary PAGE 1 LOCATION PIN EXPENSES -------- --- -------- CA 000000080 3,350.00 000000140 3,600.00 000000270 1,730.00 000000280 2,050.00 *TOTAL LOCATION CA 10,730.00 CO 000000260 1,150.00 *TOTAL LOCATION CO 1,150.00 CT 000000010 2,300.00 000000110 2,500.00 000000310 2,450.00 This is the detail This is the summary Suppose you want to create your own field

A FOCUS Report - Defined Fields FOCUS Basic Reporting - Overview A FOCUS Report - Defined Fields This field was defined by the report writer PAGE 1 LOCATION PIN EXPENSES REBATE -------- --- -------- ------ CA 000000080 3,350.00 67.00 000000140 3,600.00 72.00 000000270 1,730.00 0.00 000000280 2,050.00 41.00 *TOTAL LOCATION CA 10,730.00 180.00 CO 000000260 1,150.00 .00 *TOTAL LOCATION CO 1,150.00 .00 CT 000000010 2,300.00 46.00 000000110 2,500.00 50.00 000000310 2,450.00 49.00 Suppose you have to send a report to management

A FOCUS Report - Custom Formatting FOCUS Basic Reporting - Overview A FOCUS Report - Custom Formatting Format Changed PAGE 1 CORPORATE DIVISION COURSE EXPENSES COURSE DEPARTMENT NAME COST ---------- ---- ------ ACCOUNTING ANDERSON $ 3,100 WANG 2,050 MARKETING DONATELLO 2,700 VALINO 2,300 TOTAL CORPORATE DIVISION COURSE COSTS ARE: 10,150 Heading Column Titles Subfoot

Data From Multiple Files in One Report FOCUS Basic Reporting - Overview Data From Multiple Files in One Report Where did this data come from? PAGE 1 CORPORATE DIVISION COURSE EXPENSES COURSE DEPARTMENT NAME COST ---------- ---- ------ ACCOUNTING ANDERSON $ 3,100 WANG 2,050 MARKETING DONATELLO 2,700 VALINO 2,300 TOTAL CORPORATE DIVISION COURSE COSTS ARE: 10,150 Data from EMPDATA File Data from TRAINING File

FOCUS Basic Reporting – Detail Reports FOCUS Report Request Basic rules to write a report

FOCUS Report Request Components FOCUS Basic Reporting – Detail Reports FOCUS Report Request Components TABLE FILE EMPDATA Display a list of employees and their annual salary PRINT PIN LASTNAME SALARY Create a Report END Display Each Record Fields to Display No More Commands

FOCUS Basic Reporting – Detail Reports Command Placement PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA Display a list of employees and their annual salary Need at least one space between each word END is always on its own line

FOCUS Basic Reporting – Detail Reports The PRINT Verb PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA Display a list of employees and their annual salary Never use the PRINT verb more than once

FOCUS Basic Reporting – Detail Reports Display employees and their annual salary PRINT PIN LASTNAME SALARY END TABLE FILE EMPDATA What determines the order of the fields? PAGE 1 PIN LASTNAME SALARY --- -------- ------ 000000010 VALINO $55,500.00 000000020 BELLA $62,500.00 000000030 CASSANOVA $70,000.00 000000040 ADAMS $62,500.00 000000050 ADDAMS $54,100.00 000000060 PATEL $55,500.00 000000070 SANCHEZ $83,000.00 000000080 SO $43,400.00 000000090 PULASKI $33,000.00 000000100 ANDERSON $32,400.00

FOCUS Basic Reporting – Detail Reports Field Order TABLE FILE EMPDATA PRINT LASTNAME PIN SALARY END Show the last name first, PIN second, and salary last Fields in the report are in the order requested PAGE 1 LASTNAME PIN SALARY -------- --- ------ VALINO 000000010 $55,500.00 BELLA 000000020 $62,500.00 CASSANOVA 000000030 $70,000.00 ADAMS 000000040 $62,500.00 ADDAMS 000000050 $54,100.00 PATEL 000000060 $55,500.00 SANCHEZ 000000070 $83,000.00 SO 000000080 $43,400.00 PULASKI 000000090 $33,000.00 ANDERSON 000000100 $32,400.00

FOCUS Report Request: Review FOCUS Basic Reporting – Detail Reports FOCUS Report Request: Review To create a report, you start with: TABLE FILE filename To display fields from a file in a report, use: PRINT fieldname fieldname … To tell FOCUS there are no more commands, use: END 2a

FOCUS Basic Reporting – Detail Reports Order of Data Controlling the sequence of information

Order of Data: Introduction FOCUS Basic Reporting – Detail Reports Order of Data: Introduction TABLE FILE EMPDATA PRINT LASTNAME SALARY END Show employee names and their salaries PAGE 1 LASTNAME SALARY -------- ------ VALINO $55,500.00 BELLA $62,500.00 CASSANOVA $70,000.00 ADAMS $62,500.00 ADDAMS $54,100.00 PATEL $55,500.00 SANCHEZ $83,000.00 SO $43,400.00 PULASKI $33,000.00 ANDERSON $32,400.00 What is the order of the data?

FOCUS Basic Reporting – Detail Reports Sort Field TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME END Show salaries in order by last name PAGE 1 LASTNAME LASTNAME SALARY -------- -------- ------ ADAMS ADAMS $62,500.00 ADDAMS ADDAMS $54,100.00 ANDERSON ANDERSON $32,400.00 BELLA BELLA $62,500.00 CASSANOVA CASSANOVA $70,000.00 CASTALANETTA CASTALANETTA $42,900.00 CHISOLM CHISOLM $43,000.00 CONRAD CONRAD $25,000.00 CONTI CONTI $32,300.00 Sort Field Sort field in the report

How a Report is Created - 1: Build a Table FOCUS Basic Reporting – Detail Reports How a Report is Created - 1: Build a Table TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME WHERE RECORDLIMIT EQ 3 END 000000010 VALINO DANIEL A CORP … 000000020 BELLA MICHAEL D SE ... 000000030 CASSANOVA LOIS E WE Table to hold the data First three records in EMPDATA Note! Table built in order of BY field Data to be moved to the final report

How a Report is Created - 2: Build a Report FOCUS Basic Reporting – Detail Reports How a Report is Created - 2: Build a Report TABLE FILE EMPDATA PRINT LASTNAME SALARY BY LASTNAME WHERE RECORDLIMIT EQ 3 END Is this field needed for the report? A) Yes B) No PAGE 1 LASTNAME LASTNAME SALARY -------- -------- ------ BELLA BELLA $62,500.00 CASSANOVA CASSANOVA $70,000.00 VALINO VALINO $55,500.00

Location of BY Statement FOCUS Basic Reporting – Detail Reports Location of BY Statement TABLE FILE EMPDATA PRINT SALARY BY LASTNAME END Show salaries in order by last name LASTNAME removed as a PRINT field PAGE 1 LASTNAME SALARY -------- ------ ADAMS $62,500.00 ADDAMS $54,100.00 ANDERSON $32,400.00 BELLA $62,500.00 CASSANOVA $70,000.00 CASTALANETTA $42,900.00 CHISOLM $43,000.00 CONRAD $25,000.00 CONTI $32,300.00 Sort field is placed after the PRINT fields Sort field is listed first

Sorting on More Than One Field FOCUS Basic Reporting – Detail Reports Sorting on More Than One Field Print salaries in order by division and last name TABLE FILE EMPDATA PRINT SALARY BY DIV BY LASTNAME END DIV is the primary sort field LASTNAME is the secondary sort field BY is needed for every sort field

Displaying Duplicate BY Field Values FOCUS Basic Reporting – Detail Reports Displaying Duplicate BY Field Values Print salaries in order by division and last name TABLE FILE EMPDATA PRINT SALARY BY DIV BY LASTNAME END PAGE 1 DIV LASTNAME SALARY --- -------- ------ CE ADAMS $62,500.00 ADDAMS $54,100.00 CHISOLM $43,000.00 CONRAD $25,000.00 GORDON $25,400.00 GRAFF $45,000.00 KASHMAN $33,300.00 LASTRA $115,000.00 PUMA $40,900.00 ROSENTHAL $49,500.00 CORP ANDERSON $32,400.00 CVEK $62,500.00 Only the first of duplicate sort field values is listed What happens if two people have the same last name in a division? A) Duplicate name appears B) Duplicate name is blank

Sorting Numeric Fields FOCUS Basic Reporting – Detail Reports Sorting Numeric Fields Show employees in order by salary TABLE FILE EMPDATA PRINT LASTNAME BY SALARY END PAGE 1 SALARY LASTNAME ------ -------- $19,300.00 RUSSO $25,000.00 CONRAD $25,400.00 GORDON $26,400.00 LOPEZ $30,500.00 OLSON $30,800.00 MORAN $32,300.00 CONTI $32,400.00 ANDERSON $33,000.00 PULASKI $33,300.00 KASHMAN $35,200.00 DONATELLO $35,900.00 ELLNER Always need at least one verb object Where is the smallest salary listed?

FOCUS Basic Reporting – Detail Reports Sorting High to Low List the highest salary first TABLE FILE EMPDATA PRINT LASTNAME BY HIGHEST SALARY END PAGE 1 SALARY LASTNAME ------ -------- $115,000.00 LASTRA $83,000.00 SANCHEZ $80,500.00 NOZAWA $79,000.00 SOPENA $70,000.00 CASSANOVA $62,500.00 BELLA ADAMS CVEK WHITE HIRSCHMAN WANG $58,800.00 GOTLIEB HIGHEST is between BY and SALARY Why are some salaries missing?

FOCUS Basic Reporting – Detail Reports Order of Data: Review To control the order of data, use: BY fieldname BY HIGHEST fieldname BY is repeated for every sort field. The BY statements are placed after your PRINT fields. The BY fields appear first in the report. If there are duplicate sort field values, the duplicates are blank. 2a 2b

FOCUS Basic Reporting – Detail Reports Invisible Sort Fields Sorting with a field that is not displayed in the report

Invisible Sort Fields: Introduction FOCUS Basic Reporting – Detail Reports Invisible Sort Fields: Introduction TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY END Print all salaries after the name and sort by highest salary PAGE 1 SALARY LASTNAME SALARY ------ -------- ------ $115,000.00 LASTRA $115,000.00 $83,000.00 SANCHEZ $83,000.00 $80,500.00 NOZAWA $80,500.00 $79,000.00 SOPENA $79,000.00 $70,000.00 CASSANOVA $70,000.00 $62,500.00 BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 $58,800.00 GOTLIEB $58,800.00 The PRINT field value appears for all employees What happens if we remove BY HIGHEST SALARY?

Not Printing a Sort Field FOCUS Basic Reporting – Detail Reports Not Printing a Sort Field Sort by salary, but don’t show it, because we are printing it too TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT END PAGE 1 LASTNAME SALARY -------- ------ LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 GOTLIEB $58,800.00 Still sorting by SALARY, but it will not be displayed

FOCUS Basic Reporting – Detail Reports How NOPRINT Works TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT WHERE RECORDLIMIT EQ 3 END 000000010 VALINO … 55500.00 ... 000000020 BELLA 62500.00 000000030 CASSANOVA 70000.00 PAGE 1 LASTNAME SALARY -------- ------ CASSANOVA $70,000.00 BELLA $62,500.00 VALINO $55,500.00 Sort field is not moved to the report

Order of Duplicate Field Values FOCUS Basic Reporting – Detail Reports Order of Duplicate Field Values Sort by salary, but don’t show it, because we are printing it too TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT END PAGE 1 LASTNAME SALARY -------- ------ LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 BELLA $62,500.00 ADAMS $62,500.00 CVEK $62,500.00 WHITE $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 GOTLIEB $58,800.00 To see every field value in order, make it a verb object and use NOPRINT on the BY field What is the order of the names with the same salary?

Multiple Invisible Sort Fields FOCUS Basic Reporting – Detail Reports Multiple Invisible Sort Fields TABLE FILE EMPDATA PRINT LASTNAME SALARY BY HIGHEST SALARY NOPRINT BY LASTNAME NOPRINT END Employees with the same salary must be in name order PAGE 1 LASTNAME SALARY -------- ------ LASTRA $115,000.00 SANCHEZ $83,000.00 NOZAWA $80,500.00 SOPENA $79,000.00 CASSANOVA $70,000.00 ADAMS $62,500.00 BELLA $62,500.00 CVEK $62,500.00 HIRSCHMAN $62,500.00 WANG $62,500.00 WHITE $62,500.00 GOTLIEB $58,800.00 Since last name is printed, we only need to sort it. What happens if two people have the same last name and make the same salary? A) Duplicate name appears B) Duplicate name is blank

Invisible Sort Fields: Review FOCUS Basic Reporting – Detail Reports Invisible Sort Fields: Review To see every field value in order, use: TABLE FILE filename PRINT field ... BY field NOPRINT … END To see every field value in high to low order, use: BY HIGHEST field NOPRINT Notes: NOPRINT with a sort field still controls the order of data in a report. Optional: Assign Exercises 2a, 2b, and 2c now. There are links for the exercises at the bottom of the screen. Next: Command Syntax Review 2a 2b 2c

FOCUS Basic Reporting – Detail Reports Command Syntax Review Limit: 1024 fields (As of Rel 7.7) TABLE FILE filename PRINT fieldname … BY [HIGHEST] fieldname [NOPRINT] END Optional Optional Limit: 32 Sort Fields

FOCUS Basic Reporting – Detail Reports Summary To create a report, you start with: TABLE FILE filename To display fields from a file in a report, use: PRINT fieldname fieldname … To control the order of data, use: BY fieldname BY HIGHEST fieldname To sort on a field, but not show it in a report, use: BY fieldname NOPRINT BY HIGHEST fieldname NOPRINT To tell FOCUS there are no more commands, use: END Next: Simple Formatting

FOCUS Basic Reporting – Simple Formatting Column Titles Controlling Column Titles

Column Titles: Introduction FOCUS Basic Reporting – Simple Formatting Column Titles: Introduction TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME END Show the salary and hire date by name Field names are the column titles PAGE 1 LASTNAME SALARY HIREDATE -------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07 CONRAD $25,000.00 90/03/30 Notes: Starting with a basic report request. By default, the fieldname becomes the column title. This is FOCEXEC: M3Aa.FEX Next: Changing the Column Title

Customized Column Title FOCUS Basic Reporting – Simple Formatting Customized Column Title TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME AS ‘LAST NAME’ END Show the LASTNAME field as: LAST NAME in the report Use single quotes (apostrophes) How would you show this field as: ANNUAL SALARY? PAGE 1 LAST NAME SALARY HIREDATE --------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07 CONRAD $25,000.00 90/03/30

Column Titles: Multiple Lines FOCUS Basic Reporting – Simple Formatting Column Titles: Multiple Lines TABLE FILE EMPDATA PRINT SALARY AS ‘ANNUAL,SALARY’ HIREDATE BY LASTNAME AS ‘LAST NAME’ END Show SALARY column title as: ANNUAL SALARY on two lines Can have up to five lines Use a comma to start a new line Why is this column title left-justified? Why is this column title right-justified? PAGE 1 ANNUAL LAST NAME SALARY HIREDATE --------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07 CONRAD $25,000.00 90/03/30

FOCUS Basic Reporting – Simple Formatting Column Titles: Review To change the column title, use: fieldname AS ‘text’ To create up to five lines of column titles, use: fieldname AS ‘text,text, …’ 3a

FOCUS Basic Reporting – Simple Formatting Headings Messages at the top of each page

FOCUS Basic Reporting – Simple Formatting One Line Heading TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” PRINT SALARY HIREDATE BY LASTNAME END Create an employee information message at the top of each page Place HEADING on its own line The text line is set off by double quotes (“…”) PAGE 1 EMPLOYEE INFORMATION LASTNAME SALARY HIREDATE -------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07 Message will be at the top of each page

Multiple Line Headings FOCUS Basic Reporting – Simple Formatting Multiple Line Headings TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS” PRINT SALARY HIREDATE BY LASTNAME END Add a second line of text to the heading stating it is for all divisions For additional heading lines, place each new line of text within double quotes PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE -------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07

Skipping Lines in a Heading FOCUS Basic Reporting – Simple Formatting Skipping Lines in a Heading TABLE FILE EMPDATA HEADING “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS </1” PRINT SALARY HIREDATE BY LASTNAME END Place a blank line between the heading and column title </n - Skip n lines Can only be used inside “…” text lines PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE -------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07

Centering Lines in a Heading FOCUS Basic Reporting – Simple Formatting Centering Lines in a Heading TABLE FILE EMPDATA HEADING CENTER “EMPLOYEE INFORMATION” “FOR ALL DIVISIONS </1” PRINT SALARY HIREDATE BY LASTNAME END Put the heading in the center of each page Centered on the width of report PAGE 1 EMPLOYEE INFORMATION FOR ALL DIVISIONS LASTNAME SALARY HIREDATE -------- ------ -------- ADAMS $62,500.00 90/05/01 ADDAMS $54,100.00 89/03/15 ANDERSON $32,400.00 90/05/14 BELLA $62,500.00 90/07/18 CASSANOVA $70,000.00 90/04/11 CASTALANETTA $42,900.00 91/01/09 CHISOLM $43,000.00 90/02/07

FOCUS Basic Reporting – Simple Formatting Headings: Review To create a message at the top of each page, use: HEADING “text” To create a centered heading message, use: HEADING CENTER To skip lines within heading text, use: “</n text </n” n is the number of lines to skip before or after the text. 3a 3b

FOCUS Basic Reporting – Simple Formatting Footings A message at the end of each page Notes: We will see how to put a message at the end of each page. Next: FOOTING Statement

FOCUS Basic Reporting – Simple Formatting Simple Footing TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME FOOTING “CONFIDENTIAL” END Create a confidential message at the end of each page ... WANG $49,500.00 90/04/02 $62,500.00 91/05/08 WHITE $62,500.00 89/05/10 $40,900.00 89/04/19 CONFIDENTIAL Automatically skips one line

Footing at the Bottom of the Page FOCUS Basic Reporting – Simple Formatting Footing at the Bottom of the Page TABLE FILE EMPDATA PRINT SALARY HIREDATE BY LASTNAME FOOTING BOTTOM “CONFIDENTIAL” END Create a confidential message at the bottom of each page ... WANG $49,500.00 90/04/02 $62,500.00 91/05/08 WHITE $62,500.00 89/05/10 $40,900.00 89/04/19 CONFIDENTIAL

FOCUS Basic Reporting – Simple Formatting Centering a Footing TABLE FILE EMPDATA PRINT SALARY TITLE BY LASTNAME FOOTING BOTTOM CENTER “CONFIDENTIAL” END Put the footing in the center of the page Place before or after BOTTOM ... WANG $49,500.00 90/04/02 $62,500.00 91/05/08 WHITE $62,500.00 89/05/10 $40,900.00 89/04/19 CONFIDENTIAL

FOCUS Basic Reporting – Simple Formatting Footings: Review To create a message at the end of each page, use: FOOTING “text” To create a footing message at the page bottom, use: FOOTING BOTTOM To create a centered footing message, use: FOOTING CENTER BOTTOM can be placed before or after CENTER 3a 3b 3c

FOCUS Basic Reporting – Simple Formatting Separating Sections Controlling the spacing of sort fields

Separating Sections: Introduction FOCUS Basic Reporting – Simple Formatting Separating Sections: Introduction TABLE FILE EMPDATA PRINT HIREDATE BY DIV BY DEPT BY LASTNAME END Show employee hire dates grouped by division and department PAGE 1 DIV DEPT LASTNAME HIREDATE --- ---- -------- -------- CE ADMIN SERVICES GORDON 90/12/05 MARKETING ADAMS 90/05/01 PERSONNEL CONRAD 90/03/30 GRAFF 90/07/11 KASHMAN 90/03/14 PROGRAMMING & DVLPMT PUMA 91/03/20 ROSENTHAL 90/05/01 SALES ADDAMS 89/03/15 CHISOLM 90/02/07 LASTRA 89/04/03 CORP ACCOUNTING ANDERSON 90/05/14 LOPEZ 90/11/07 SANCHEZ 90/03/05

FOCUS Basic Reporting – Simple Formatting Skipping Lines TABLE FILE EMPDATA PRINT HIREDATE BY DIV BY DEPT SKIP-LINE BY LASTNAME END Place a blank line between each department Can only be used with sort fields PAGE 1 DIV DEPT LASTNAME HIREDATE --- ---- -------- -------- CE ADMIN SERVICES GORDON 90/12/05 MARKETING ADAMS 90/05/01 PERSONNEL CONRAD 90/03/30 GRAFF 90/07/11 KASHMAN 90/03/14 PROGRAMMING & DVLPMT PUMA 91/03/20 ROSENTHAL 90/05/01 SALES ADDAMS 89/03/15

FOCUS Basic Reporting – Simple Formatting Underlines TABLE FILE EMPDATA PRINT HIREDATE BY DIV UNDER-LINE BY DEPT SKIP-LINE BY LASTNAME END Place an underline between each division Note: Northeast Marketing has two other employees on the prior page PAGE 3 DIV DEPT LASTNAME HIREDATE --- ---- -------- -------- NE MARKETING PATEL 89/03/01 SALES DUBOIS 91/01/07 MEDINA 90/10/10 ----------------------------------------------------- SE CONSULTING ELLNER 91/05/13 WANG 90/04/02 CUSTOMER SUPPORT HIRSCHMAN 90/09/12 MARKETING BELLA 90/07/18

Page Breaks: Conditional FOCUS Basic Reporting – Simple Formatting Page Breaks: Conditional TABLE FILE EMPDATA PRINT HIREDATE BY DIV UNDER-LINE BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END If all employees in a department can’t fit on the current page, move them to a new page Note! All Northeast Marketing employees now start on this page PAGE 3 DIV DEPT LASTNAME HIREDATE --- ---- -------- -------- NE MARKETING CONTI 90/04/02 LIEBER 90/03/21 PATEL 89/03/01 SALES DUBOIS 91/01/07 MEDINA 90/10/10 ----------------------------------------------------- SE CONSULTING ELLNER 91/05/13 WANG 90/04/02 How many divisions are on this page?

Page Breaks: Unconditional FOCUS Basic Reporting – Simple Formatting Page Breaks: Unconditional TABLE FILE EMPDATA PRINT HIREDATE BY DIV PAGE-BREAK BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END Start each new division on its own page Note! What page does the SE division start on? PAGE 3 DIV DEPT LASTNAME HIREDATE --- -- NE CU MA SA PAGE 4 --- ---- -------- -------- SE CONSULTING ELLNER 91/05/13 WANG 90/04/02 CUSTOMER SUPPORT HIRSCHMAN 90/09/12 MARKETING BELLA 90/07/18 LEWIS 91/03/13

Resetting the Page Number FOCUS Basic Reporting – Simple Formatting Resetting the Page Number Used with a PAGE-BREAK TABLE FILE EMPDATA PRINT HIREDATE BY DIV PAGE-BREAK REPAGE BY DEPT SKIP-LINE NOSPLIT BY LASTNAME END Have each new division start with Page 1 PAGE 1 DIV DEPT LASTNAME HIREDATE --- -- NE CU MA SA --- ---- -------- -------- SE CONSULTING ELLNER 91/05/13 WANG 90/04/02 CUSTOMER SUPPORT HIRSCHMAN 90/09/12 MARKETING BELLA 90/07/18 LEWIS 91/03/13

Separating Sections: Review FOCUS Basic Reporting – Simple Formatting Separating Sections: Review Can only be used with sort fields 3a 3b 3c 3d

FOCUS Basic Reporting – Simple Formatting Command Syntax Review Message at the top of each page TABLE FILE filename HEADING [CENTER] “text…” PRINT field[/align] [AS ‘text’] … BY [HIGHEST] field[/align] [NOPRINT or AS ‘text’] FOOTING [CENTER] [BOTTOM] END Use: </n to skip n lines /L - Left Justify Title /C - Center Title /R - Right Justify Title Use: , to start on a new line Message at the end of each page

FOCUS Basic Reporting – Simple Formatting Summary To change the column title, use: fieldname AS ‘text’ To create a message at the top of each page, use: HEADING [CENTER] “text” To create a message at the end of each page, use: FOOTING [CENTER] [BOTTOM] To change the spacing between sort fields, use: SKIP-LINE UNDER-LINE NOSPLIT PAGE-BREAK [REPAGE]

WebFOCUS Processing Sequence Open an existing application Create a comprehensive procedure Explore the WebFOCUS Code and Processing Sequence for a Procedure: Phase 1 – Analyze and Parse the Request Phase 2 – Build the Internal Table Phase 3 – Process the Internal Table Phase 4 – Produce the Report

A Management Request Management would like a report that displays the total compensation (current salary and benefits) and training expenses in 1991 for Century Corporation employees sorted by region and by department. The report should include: - A new BENEFITS field calculated as 22% of current salary (SALARY). - Employees with BENEFITS greater than or equal to $5,000. - Departments with total compensation greater than or equal to $40,000. The entire report should be sorted by the total current salaries in descending order.

A Management Request

The Procedure’s Required Components Report Feature WebFOCUS Command Description Combine two tables JOIN Combine EMPDATA and TRAINING as a non-unique JOIN. Aggregate data SUM Aggregate PIN as 'No. of,Emps' Virtual column at data source level DEFINE Create the BENEFITS field (format- D9M) equal to SALARY times 22 percent. Virtual column at report level COMPUTE Create the COMP field (format - D9M) equal to SALARY plus BENEFITS. Sort entire report BY TOTAL Sort by aggregated SALARY (hidden) in descending order. Sort on real data source values BY Sort by DIV AS ‘Region’ and by DEPT.

The Procedure’s Required Components Report Feature WebFOCUS Command Description Selection on real data source values WHERE Select training courses attended by employees during 1991. Selection on virtual column values (DEFINE) Select BENEFITS greater than or equal to 5000. Selection on accumulated report values WHERE TOTAL Select aggregated values of COMP greater than or equal to 40000. Accumulate report totals COLUMN-TOTAL Add up all column values Page heading and footing HEADING and FOOTING Create a page heading and a page footing Report styling STYLE Use the PROBLUE StyleSheet

The WebFOCUS Processing Sequence Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

The WebFOCUS Processing Sequence Phase 1 Analyze and Parse the Request The process begins when you run a procedure. Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

FOCUS Command Processor Phase One: Analyze and Parse the Request The FOCUS Command Processor reads each line of the procedure. Phase 1 Analyze and Parse the Request FOCUS Command Processor

Analyze and Parse the Request Phase One: Analyze and Parse the Request Phase 1 Analyze and Parse the Request The syntax is validated according to the rules of the command invoked: JOIN DEFINE TABLE MATCH MAINTAIN MODIFY

Analyze and Parse the Request Phase One: Analyze and Parse the Request If a syntax error is detected, WebFOCUS sends an error message to the application and processing stops. Phase 1 Analyze and Parse the Request

Analyze and Parse the Request Phase One: Analyze and Parse the Request WebFOCUS evaluates the instructions to create a report. Phase 1 Analyze and Parse the Request

Analyze and Parse the Request Phase One: Analyze and Parse the Request WebFOCUS locates and reads the Data Source Description. Phase 1 Analyze and Parse the Request

Analyze and Parse the Request Phase One: Analyze and Parse the Request WebFOCUS constructs several tables in memory to assist the process: Phase 1 Analyze and Parse the Request

Build the Internal Table Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table

Build the Internal Table Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS reads the original table and performs the following operations: Select on real data source values (IF and WHERE). Construct virtual fields (DEFINE). Select on virtual fields (IF and WHERE on DEFINE fields). Phase 2 Build the Internal Table

Build the Internal Table Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request Sort (and aggregate) source data to build the Internal Table. Phase 2 Build the Internal Table

Build the Internal Table Phase Two: Build the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS generates report statistics (&RECORDS and &LINES) and closes the data sources. Phase 2 Build the Internal Table

Process the Internal Table Phase Three: Process the Internal Table Phase 1 Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table

Process the Internal Table Phase Three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table: Construct virtual columns (COMPUTE) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

Process the Internal Table Phase three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table (continued): Select on Internal Table records (WHERE TOTAL) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

Process the Internal Table Phase three: Process the Internal Table Phase 1 Analyze and Parse the Request WebFOCUS performs the following operations on the Internal Table (continued): Re-sort the records in the Internal Table (BY TOTAL) Phase 2 Build the Internal Table Phase 3 Process the Internal Table

Phase four: Process the Internal Table Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

Phase four: Process the Internal Table Analyze and Parse the Request Phase 2 Build the Internal Table Phase 3 Process the Internal Table Generate totals and subtotals. Phase 4 Produce the Report

Phase four: Process the Internal Table Analyze and Parse the Request Perform RECAP on subtotals. Format the report Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

Phase four: Process the Internal Table Analyze and Parse the Request Apply styling and display output. Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

Review: The WebFOCUS Processing Sequence Phase 1 Analyze and Parse the Request Evaluate source code Load command module (TABLE) Select on real fields Construct and select on DEFINEs Sort and aggregate data Construct and select on COMPUTEs Re-sort Internal Table records Generate totals and subtotals Format, style and display output Phase 2 Build the Internal Table Phase 3 Process the Internal Table Phase 4 Produce the Report

Report Debugging Techniques Thanks for attending!