focus for sis beginning report writing focus for sis beginning report writing
TRANSCRIPT
FOCUS for SIS
Beginning Report Writing
FOCUS for SIS Beginning Report Writing
Cheri Harwell
(775) 784-4357(help)
•Create Detail Reports against SIS data.
•Basic Calculations in Reports.
•Generate Summary Reports.
Name and Institution,
Experience with FOCUS,
SIS/Job Submittal,
Expectations
FOCUS for SIS Beginning Report Writing
Agenda1. Overview
2. Write a Report
3. Formatting
4. Data Selection
5. New Fields
Agenda
FOCUS for SIS Beginning Report Writing
6) Summary Reports
7) More Summary Reports
8) Multiples
9) Bonus
1. OverviewA. What is Focus
B. Databases, Tables and Fields
C. Master File Descriptions – MFD
D. Getting in to FOCUS
E. TED
1. Overview
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
Reporting Tool
Information Builders Product
www.informationbuilders.com
Information Builders provides all of the software and services to develop complete state-of-the-art information systems for turning data into useful business intelligence for real-time management of business. We call our solutions "i-business": the ability to get to any data in the enterprise, turn it into information, and deliver it so that people can use it to make their businesses more intelligent.
1.A. What is Focus
1.A.
FOCUS for SIS Beginning Report Writing
NAMETOOK
ADDR
CLAS
Table/File
Fields
PID
TERM
CLASS
GRADE
1.B. Databases, Tables and Fields
1.B.1
FOCUS for SIS Beginning Report Writing
1.B. Databases, Tables and Fields
PERSON
ID NAME
__________ ___________
L000007774 SIMPSON, BARTHOLOMEW L II
L000007772 MAYBELL, MARTHA
L000007773 LIZARD, LARRY
What is a
record?
1.B.2
FOCUS for SIS Beginning Report Writing
FILENAME=NAME,SUFFIX=PRIVATE,$
SEGMENT=ROOT,$
GROUP=NAMEKEY , ALIAS=KEY, USAGE=A010 , ACTUAL=A010,$
FIELD=NAMEPID , ALIAS=NAMEPID , USAGE=A010 , ACTUAL=A010,
TITLE='PERSON,ID' ,$
FIELD=NAMELTNM , ALIAS=NAMELTNM , USAGE=A025 , ACTUAL=A025,
TITLE='LAST,NAME' ,$
FIELD=NAMEFRSTNM , ALIAS=NAMEFRSTNM , USAGE=A015 , ACTUAL=A015,
TITLE='FIRST,NAME' ,$
FILE=NAME
FIELD USAGE USAGE ACTUAL
NAME FORMAT LENGTH FORMAT TITLE
NAMEKEY ALPHA 10 A010
NAMEPID ALPHA 10 A010 'PERSON,ID'
NAMELTNM ALPHA 25 A025 'LAST,NAME'
NAMEFRSTNM ALPHA 15 A015 'FIRST,NAME'
FOCUS MFDType: TED MASTER(filename)
FOCUS MFDType: TED MASTER(filename)
X/NET ReportX/NET Report
1.C. Master File Descriptions - MFD
1.C.1
FOCUS for SIS Beginning Report Writing
1.C. Master File Descriptions - MFD
1.C.2
Formats A-Alphanumeric N-Numeric I-Integer
Actual P-Packed to conserve space
Formats A-Alphanumeric N-Numeric I-Integer
Actual P-Packed to conserve space
FOCUS for SIS Beginning Report Writing
1.C. Master File Descriptions - MFD
1.C.3
Key LengthKey Length
FOCUS for SIS Beginning Report Writing
1.C. Master File Descriptions - MFD
1.C.4
SIS Screens
vs.
FOCUS Tables
SIS Screens
vs.
FOCUS Tables
FOCUS for SIS Beginning Report Writing
1.D. Getting in to FOCUS
1.D.1
1 Logon Mainframe
2 Select TSOSIS
3 F;S;region
1 Logon Mainframe
2 Select TSOSIS
3 F;S;region
FOCUS for SIS Beginning Report Writing
1.D. Getting in to FOCUS
1.D.2
FOCUS for SIS Beginning Report Writing
1.D. Getting in to FOCUS
1.D.3
TED FOCEXEC(pgmname)
Open a FOCEXEC
Create a new FOCEXEC
Run a FOCEXEC
Open a FOCEXEC
Create a new FOCEXEC
Run a FOCEXEC
FIN to Exit FOCUSFIN to Exit FOCUS
FOCUS for SIS Beginning Report Writing
TED is the FOCUS text editor that is used to create and change your procedures called FOCEXECs.
1.E. TED – Text Editor Commands
1.E.1
Primary Command Line
Lin
e C
omm
an
ds
FOCUS for SIS Beginning Report Writing
1.E. TED – Text Editor Commands
Primary Command Line
GET FOCEXEC(pgmname)
SAVE or FILE
TOP or BOTTOM
F7 (back) F8 (forward)
F1 (help)
LOCATE/
TED MASTER(file)
RUN (please use caution)
QUIT or F3
QQUIT (changes are cancelled)
Line Commands (Prefix Area)
I / I# Insert
D/DD/D# Delete/Block Delete
C/CC/C# Copy/Block Copy
M/MM Move/Block Move
P Preceding
F Following
” Repeat Line
1.E.2
FOCUS for SIS Beginning Report Writing
1.E. TED – Text Editor Commands
1.E.3
1. ReviewFOCUS is a reporting tool.
Data is stored in tables and fields which are defined by MFD’s.
Format of field can be Alphanumeric, Numeric, Integer or Date.
Key defines the unique identifier of a table.
Start FOCUS.
TED is the text editor for FOCUS.
Primary and Line Commands of TED.
Exit FOCUS using FIN command.
1. Review
FOCUS for SIS Beginning Report Writing
2. Write a Report
A. Basic Rules
B. Print
C. Sort
D. Select
2. Reporting Basics
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
2.A. Basic Rules
All you need for a FOCUS report are:
1. Data
2. File Description
3. FOCEXEC
2.A.1
Running online isn’t recommended, unless you run against QA data or have a record limit defined. Use the batch methods with FOCBAT or Job Submittal to run Production reports.
FOCUS for SIS Beginning Report Writing
2.A. Basic Rules
2.A.2
FOCEXECFOCEXEC
Report Report
FOCUS for SIS Beginning Report Writing
2.A. Basic Rules
2.A.3
00000 * * * TOP OF FILE * * *
00001 -* SAMPLE FOCEXEC
00001 TABLE FILE NAME
00002 PRINT
00003 NAMEFRSTNM
00004 NAMEDTOFBTH
00005 NAMEPID
00006 END
00007 * * * END OF FILE * * *
TABLE FILE filenameTABLE FILE filename
Required Components
At least one space between words is required.
Recommend using indentation, but not required.
Verb – PRINT display all records
Verb – PRINT display all records
END – must be on separate line.END – must be on separate line.
FOCUS for SIS Beginning Report Writing
2.B. Print
2.B.
00000 * * * TOP OF FILE * * *
00001 TABLE FILE filename
00002 PRINT
00003 NAMEFRSTNM
00004 NAMEDTOFBTH
00005 NAMEPID
00006
00007 END
00008 * * * END OF FILE * * *
Print is a Verb – Only 1
Verb Objects – Fields to Print
Sort Command – BY fieldname
00000 * * * TOP OF FILE * * *
00001 TABLE FILE filename
00002 PRINT
00003 NAMEFRSTNM
00004 NAMEDTOFBTH
00005 NAMEPID
00006 BY NAMELTNM
00007 END
00008 * * * END OF FILE * * *
FOCUS for SIS Beginning Report Writing
2.C. Sort
2.C.1
No Sort
Sorted
BY statement is placed after the PRINT fields, although it prints first and in the order listed.
Up to 31 Sort Phrases.
FOCUS for SIS Beginning Report Writing
2.C. Sort
2.C.2
Multiple Sort
Fields
RESI sample with 2 sort fields.
Change Sort
Direction
FOCUS for SIS Beginning Report Writing
2.C. Sort
2.C.3
Repeat Field Invisible Sort Field
-Every occurrence is displayed
-Move sort field to print where desired.
-Every occurrence is displayed
-Move sort field to print where desired.
FOCUS for SIS Beginning Report Writing
2.D. Select
2.D.1
Limit Records
Multiple Selection
WHERE expression [;]
Simple compare of a field to a set value. If comparing to an alphanumeric field then place value in single quotes, ‘?’.
Expression
FOCUS for SIS Beginning Report Writing
2.D. Select
2.D.2
Relationship
Equal EQ WHERE RECORDLIMIT EQ 10Not Equal NE WHERE BDETOWAMT NE 0Greater Than GT WHERE SGPAGPAVL GT 5.5Greater Than or Equal to GE WHERE BDETTYR GE '1998'Less Than LT WHERE SGPAGPAVL LT 5.5Less Than or Equal to LE WHERE BDETTYR LE '1998'Value is within field CONTAINS WHERE ADDRADRLN1 CONTAINS 'STOREY'Value is not within OMITS WHERE (APPLPLCD OMITS 'IELC');In a list of values IN WHERE AWRDMYCD IN ('STFA','STFB','STFC')Within a range FROM TO WHERE SGPAGPAVL FROM 5.0 TO 5.5
2. ReviewNeed a TABLE FILE, Verb and END
statement to create FOCUS report.
PRINT verb is used to list data. PRINT field field
Sort in descending order with HIGHEST. Hide sort fields - NOPRINT. BY [HIGHEST] field [NOPRINT]
Select with the WHERE command using EQ, NE, GT, GE, LT, LE, and others.
2. Review
FOCUS for SIS Beginning Report Writing
3. Formatting A. Column Title
B. Heading
C. Footing
D. Separations
E. Fields
3. Formatting
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
3.A. Column Title
3.A.
Column TitlesColumn Titles
The column titles have been set for us in the MFD Title field.
To override the assigned title use the AS option.
Use a comma to split title onto multiple lines.
/C /L /R to align the column heading as center,left,right: AWRDPID/C AS ‘PERSON’
FOCUS for SIS Beginning Report Writing
3.B. Heading
Center the heading above the report, multiple lines of text and skip two lines
before the data.
3.B.
Heading Line between Table File
and End.
TABLE FILE AWRD
HEADING CENTER “GREAT BASIN COLLEGE” “AWARDS FOR 2001 </2”
PRINT AWRDPID … END
To add run date to heading, include &DATE
within quotes.
FOCUS for SIS Beginning Report Writing
3.C. Footing
Center the footing at the bottom of the page.
3.C.
FOOTING BOTTOM CENTER
"UADCJH1.AWRDLIST"
Footing Line between Table File
and End
Recommend placing name of focexec in
footing.
FOCUS for SIS Beginning Report Writing
3.D. Separations
Can separate sections of a report with blank lines, underlines or put them on separate pages.
3.D.
BY field UNDER-LINE
BY field SKIP-LINE
BY field PAGE-BREAK REPAGE
BY field UNDER-LINE
BY field SKIP-LINE
BY field PAGE-BREAK REPAGE
FOCUS for SIS Beginning Report Writing
3.E. Fields
An MFD has a defined format for each field, you may change that format for reporting purposes.
An MFD has a defined format for each field, you may change that format for reporting purposes.
3.E.1
FOCUS for SIS Beginning Report Writing
3.E. Fields
3.E.2
FOCUS for SIS Beginning Report Writing
3.E. Fields
3.E.3
PRINT AWRDPID/C AS 'PERSON' AWRDOROFRAM/D7 AS 'ORIG AMT' AWRDCUOFRAM/D9.2M AS 'CURR AMT‘
AWRDCRSNCD AS 'REASON'
FOCUS for SIS Beginning Report Writing
3.E. Fields
3.E.4
D9.2MField TypeAlphanumeric AInteger IPacked PFloating Decimal D Length.Decimal
Edit OptionsCommas CMoving $ MNot Moving $ NBracket Negative BCredit RLeading Zeros LSuppress Zeros S
Stored Value Format Printed Value123 MAIN STREET A10 123 MAIN S1005 I4 10051005 I4C 1,005123456789 P09 123456789123456789 P07 **12.34 P7.1 12.312.345 P7.2N $ 12.35-345.66 P7.2B (345.66)
Examples
3. ReviewColumn title is changed with the AS option.
To change alignment of the column title use /C, /L, or /R.
HEADING should be between TABLE FILE statement and END. Use double quotes around text. CENTER is optional. Use </# within quotes to skip lines.
FOOTING statement with CENTER and BOTTOM options.
Separate section options UNDER-LINE, SKIP-LINE, and PAGE-BREAK.
Field definitions have 3 parts a type, length and edit option.
3. Review
FOCUS for SIS Beginning Report Writing
4. Data Selection
A. Available Operators
B. Alphabetic Comparison
C. Numeric Comparison
D. Multiple Criteria
E. Date Comparison
F. Field to Field Comparison
4. Data Selection
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
4.A. Available Operators
4.A.
Relation
WHERE expression; WHERE fieldname relation value1 [OR/AND expression] [;]
Compare a field to a set value, compare field to another field, compare field calculation to value, complex relationships with AND/OR.
Compare field to field WHERE ADDRADRLN1 EQ ADDRADRLN2Compare calculated WHERE (OWED - PAID) GT 15
Other Options
Equal EQ WHERE RECORDLIMIT EQ 10Not Equal NE WHERE BDETOWAMT NE 0Greater Than GT WHERE SGPAGPAVL GT 5.5Greater Than or Equal to GE WHERE BDETTYR GE '1998'Less Than LT WHERE SGPAGPAVL LT 5.5Less Than or Equal to LE WHERE BDETTYR LE '1998'Value is within field CONTAINS WHERE ADDRADRLN1 CONTAINS 'STOREY'Value is not within OMITS WHERE (APPLPLCD OMITS 'IELC');In a list of values IN WHERE AWRDMYCD IN ('STFA','STFB','STFC')Within a range FROM TO WHERE SGPAGPAVL FROM 5.0 TO 5.5
FOCUS for SIS Beginning Report Writing
4.B. Alphabetic Comparison
4.B.1
Alphanumeric Comparison Value is enclosed in single quotes.
Alphanumeric Comparison Value is enclosed in single quotes.
WHERE RECORDLIMIT EQ 5
WHERE NAMELTNM LT ‘M’
WHERE AWRDAWYR EQ ‘2001’
WHERE RESISTCD EQ ‘NV’;
WHERE RESISTCD EQ ‘NV’ OR ‘CA’;
WHERE RESISTCD NE ‘NV’ OR ‘ ‘;
Examples already used
All parts must be true AND WHERE SGPATYR EQ '1998' AND SGPATCD EQ '4'One part must be true OR WHERE BDETTYR EQ '1998' OR '1999'
And/Or Conditions
FOCUS for SIS Beginning Report Writing
4.B. Alphabetic Comparison
4.B.2
Mask Trailing CharactersMask Trailing Characters
WHERE NAMELSTNM EQ ‘SMITH$*';
Mask Leading CharacterMask Leading Character
WHERE RESICNTCD EQ '$W$';
Contains characters somewhere within field
Contains characters somewhere within field
WHERE CLASCLNM CONTAINS ‘COMPUTER';
Omit a character string from the result.
Omit a character string from the result.
WHERE CLASCLNM OMITS ‘COMPUTER';
FOCUS for SIS Beginning Report Writing
4.C. Numeric Comparison
4.C.1
WHERE SGPAGPAVL GT 3.5;
WHERE (SGPATOTUNEN LE 60) OR (SGPATOTUNEN GE 170);
FOCUS for SIS Beginning Report Writing
4.C. Numeric Comparison
4.C.2
Calculation in the WHERE statement.
FOCUS for SIS Beginning Report Writing
4.D. Multiple Criteria
4.D.1
WHERE RESISTCD EQ ‘NV’ OR ‘CA’;
In English ask “I want Nevada and California”.
Outside of Range.
WHERE (SGPATOTUNEN GE 60) AND (SGPATOTUNEN LE 170);
Inside a Range.
AND – all must be true. OR – one must be true.
FOCUS for SIS Beginning Report Writing
4.D. Multiple Criteria
4.D.2
Each line is an “AND” condition.
WHERE (SGPATOTUNEN GE 80) AND (SGPATOTUNEN LE 100);
Is the same
as:
WHERE SGPATOTUNEN GE 80;
WHERE SGPATOTUNEN LE 100;
FOCUS for SIS Beginning Report Writing
4.E. Date Comparison
4.E.
SIS Dates are stored as “Numeric 9” and are formatted as YYYYMMDD. Example would be “20001031”. Can use Numeric Comparison techniques to select with these fields.
Numeric edit options don’t help much to format the field.
Calculations with these dates? How many days between Begin Date and End Date? 20010512-20010116= 396 days. We would like to get 116 days, cover in Chapter 5.
FOCUS for SIS Beginning Report Writing
4.F. Field to Field Comparison
4.F.
4. ReviewSyntax: WHERE expression;
Compare Alphanumeric, Numeric, Dates, calculated values, and fields.
Enclose an Alphanumeric value in single quotes. Masks can be used for character fields using the $ as a place holder.
Numeric comparison can include decimal values (no quotes).
4. Review
FOCUS for SIS Beginning Report Writing
5. New FieldsA. Define Fields
B. Numeric
C. Alphanumeric
D. Dates
E. Conditional Define
5. New Fields
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
5.A. Define Fields
5.A.
Define new fields in their own section. Located before the TABLE section.
Define new fields in their own section. Located before the TABLE section.
While it appears first, it builds the field during execution time, but before verbs. FOCUS uses efficiency and will perform the WHERE commands that it can before it does the calculate.
DEFINE FILE filename [ADD]
Newfield/Format = expression;
ENDThe END is required.
New fields can be printed, used in where expressions, used to create more new fields, sorted on. Anything a regular field can do, it can do too.
The ADD option will add the new fields to the existing DEFINE fields; if not specified, it will overwrite the previous fields.
FOCUS for SIS Beginning Report Writing
5.B. Numeric
5.B.
Define a new calculated field and display it on the report and use it as selection criteria.
Define a new calculated field and display it on the report and use it as selection criteria.
FOCUS for SIS Beginning Report Writing
5.C. Alphanumeric
5.C.1
Alphanumeric defines can break a field apart or put multiple together.
Alphanumeric defines can break a field apart or put multiple together.
Break apart Zip Code.
FOCUS for SIS Beginning Report Writing
5.C. Alphanumeric
5.C.2
Put fields together.
Concatenation Symbols: | - Weak, Don’t remove the trailing blanks || - Strong, Remove the trailing blanks.
Note: The resulting field length must be as long as the combination of all the fields. It can be shortened on the print line.
FOCUS for SIS Beginning Report Writing
5.C. Alphanumeric
5.C.3
Add characters.
FOCUS for SIS Beginning Report Writing
5.D. Dates
5.D.1
Format Date fields to look better. Actually a numeric format.
Format Date fields to look better. Actually a numeric format.
Example already used
FOCUS for SIS Beginning Report Writing
5.D. Dates
5.D.2
Use subroutines and edits to format the date.
Use subroutines and edits to format the date.
FOCUS for SIS Beginning Report Writing
5.D. Dates
5.D.3
Version 7.0 FOCUS Makes date processing much easier.
Version 7.0 FOCUS Makes date processing much easier.
DEFINE FILE filename new_date/YMD = sis_date; END
PRINT new_date/dformats
END
YMD 01/10/31
YYMD 2001/10/31
MDY 10/31/01
MTDYY OCT 31, 2001
MtrDYY October 31, 2001
YY 2001
MTR OCTOBER
M 10
D 31
WTR Wednesday
Q Q4
QYY Q4 2001
FOCUS for SIS Beginning Report Writing
5.E. Conditional Define
5.E.
Can conditionally set a field to a value using an “IF” statement or the “DECODE” function.
Can conditionally set a field to a value using an “IF” statement or the “DECODE” function.
5. ReviewDefine section can create new fields
which can be printed, used in a where statement, and sorted on.
DEFINE FILE filename Newfield/Format=expression END
Use calculations to create new fields.
Break fields apart.
Put fields together or add characters into a field.
Create date fields using functions.
Conditional field creation.5. Review
FOCUS for SIS Beginning Report Writing
6. Summary Reports
A. Sum Verb
B. Sum with Sort
C. Across – Spreadsheet
D. Select on Sum
E. Compute
F. Compute vs. Define
G. Holding Data
6. Summary Reports
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
6.A. Sum Verb
6.A.
SUM Verb very similar to Print verb, select data, specify fields to sum, can use sorting.
SUM Verb very similar to Print verb, select data, specify fields to sum, can use sorting.
FOCUS for SIS Beginning Report Writing
6.B. Sum with Sort
6.B.
Use the BY statement.Use the BY statement.
FOCUS for SIS Beginning Report Writing
6.C. Across – Spreadsheet
6.C.
Put into spreadsheet format.Put into spreadsheet format.
FOCUS for SIS Beginning Report Writing
6.D. Select on Sum
6.D.
FOCUS for SIS Beginning Report Writing
6.E. Compute
6.E.
Compute is a method of creating new fields.
Compute is a method of creating new fields.
FOCUS for SIS Beginning Report Writing
6.F. Compute vs. Define
6.F.
Question DEFINE COMPUTE
When is the field evaluated (created)?
Before any verb acts on the value.
After aggrega-tion with BY statement.
Can I use the new field to SORT with?
Yes. No.
Can I use it to select the field using a WHERE?
Yes, either TOTAL or individual value.
Only with TOTAL tests.
FOCUS for SIS Beginning Report Writing
6.G. Holding Data
6.G.
How do you sort with a COMPUTEd field? Or with a calculated total?
How do you sort with a COMPUTEd field? Or with a calculated total?
Hold the data for further processing.
ON TABLE HOLD [AS filename]
6. ReviewSummary reports can be created with the
SUM verb.
Use the ACROSS to create a spreadsheet format.
WHERE TOTAL will select based on the aggregated values.
A COMPUTE can be used within a verb to create a new field.
Use care in determining whether to use the COMPUTE or the DEFINE.
Can use HOLD statement to store data for subsequent use.
6. Review
FOCUS for SIS Beginning Report Writing
7. More Summary Reports
A. Prefixes
B. Column & Row Totals
C. Section Totals
7. More Summary
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
7.A. Prefixes
7.A.1
Sample PRINT of MSID file.
FOCUS for SIS Beginning Report Writing
7.A. Prefixes
7.A.2
FOCUS for SIS Beginning Report Writing
7.A. Prefixes
7.A.3
Available prefixes:
CNT MIN PCT
AVE MAX
Available prefixes:
CNT MIN PCT
AVE MAX
FOCUS for SIS Beginning Report Writing
7.A. Prefixes
7.A.4
To select based on the prefixes, use the WHERE TOTAL command.
To select based on the prefixes, use the WHERE TOTAL command.
FOCUS for SIS Beginning Report Writing
7.B. Column & Row Totals
7.B.1
FOCUS for SIS Beginning Report Writing
7.B. Column & Row Totals
7.B.2
Row Total
Co
lumn T
ota
l
ROW-TOTAL [fieldname fieldname]
FOCUS for SIS Beginning Report Writing
7.C. Section Totals
7.C.
Ability to subtotal fields with the following commands.
Ability to subtotal fields with the following commands.
SUBTOTAL/
SUB-TOTAL
Add all numeric columns. For specified sortfield only/And all higher sort fields.
RECOMPUTE/
SUMMARIZE
Add all numeric columns and recalculate COMPUTEd fields. For specified sort field only/And all higher sort fields. (PCT)
ON|BY sortfield subtotal [MULTILINES] [field1 field2] [AS ‘text’];
MULTILINES – Won’t print a subtotal line if only 1 detail.
7. ReviewIn the SUM Verb can use prefixes of
CNT, AVE, MIN, MAX and PCT to create additional statistics.
Use the WHERE TOTAL to select based on these new values.
The ROW-TOTAL and COLUMN-TOTAL verb objects.
Use the ON field SUBTOTAL object to create section totals.
7. Review
FOCUS for SIS Beginning Report Writing
8. MultiplesA. Join Multiple Files
B. Multiple Verbs
C. Fields for use in Multiple Runs
8. Multiples
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.1
NAMENAMEKEY
NAMEPID
NAMELTNM
NAMEFRSTNM
NAMESSN
RESIRESIKEY
RESIPID
RESIDSTRCD
RESICNTCD
RESIRSCD
Use the JOIN to have fields from two files in one report.
Use the JOIN to have fields from two files in one report.
JOIN CLEAR *
JOIN field IN file TO field IN file AS asname
JOIN CLEAR *
JOIN NAMEPID IN NAME TO RESIPID IN RESI AS JOIN1
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.2
Example of JOIN.
Example of JOIN.
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.3
ADDRKEY A17
ADDRPID A10
ADDRADRCD A2
ADDRADRGDFR P5
ADDRADRLN1 A30
ADDRADRLN2 A30
ADDRCYNM A20
ADDRSTCD A2
ADDR
NAMENAMEKEY A10
NAMEPID A10
NAMELTNM A25
NAMEFRSTNM A15
NAMESSN A10
RESIRESIKEY A10
RESIPID A10
RESIDSTRCD A2
RESICNTCD A3
NAME to RESI is a one-to-one relationship. For every NAME there is only one RESI. Their keys are the same.
NAME to RESI is a one-to-one relationship. For every NAME there is only one RESI. Their keys are the same.
The 2 files must have something in common. The name of the common field can be different, but the format must match.
Reminder: Use Actual lengths to determine fields within the key.
The 2 files must have something in common. The name of the common field can be different, but the format must match.
Reminder: Use Actual lengths to determine fields within the key.
NAME to ADDR is a one-to-many relationship. For every NAME there could be multiple ADDR records with various Codes or Start Dates.
NAME to ADDR is a one-to-many relationship. For every NAME there could be multiple ADDR records with various Codes or Start Dates.
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.4
One-to-Many Join
NAME to ADDR is a 1/many join. The ALL will match from NAME to every occurrence in the ADDR file. Without the ALL, only the first occurrence would appear.
One-to-Many Join
NAME to ADDR is a 1/many join. The ALL will match from NAME to every occurrence in the ADDR file. Without the ALL, only the first occurrence would appear.
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.5
NAMER00000001
JONES
R00000003
SMITH
R00000002
DOE
ADDR
R00000001
MA
19990101
123 MAIN
R00000003
MA
20000801
123 VINE ST.
R00000003
MA
19990101
123 A ST.
No Path Multiplicative Effect
Selecting the correct HOST file is very important. This shows the differences between results based on switching host file.
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.6
JOIN Checklist
• Determine which files need
• Check for common fields
• Decide which file will be Host file and whether you need an ALL for the 1/many. (See Flowchart)
• Write the JOIN
• Check the file structure
• Run requests
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.7
Find the common fields.
Advanced Join Create Defined
field, use a linking file, or create hold
files.
Determine which file is Host/Cross Reference and whether the ALL is needed.
Determine which file is Host/Cross Reference and whether the ALL is needed.
This file is the Cross Reference
Use ALL
This file is the Cross Reference
No ALL
In this file, are there more
fields in the key than just
the common
field?
Yes
No
The file with the longer key is the Cross Reference
Use ALL
Is either file
optional? Yes
No
Optional file is the Cross Reference
No ALL
Either file can be Cross Reference
No ALL
Is the entire key on both files the same?
No
Yes
How many files have the common field first?
Both
Only 1Neither
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.8
NAME to RESI
Either file could be the Host or Cross-Reference based on the keys. However if RESI data is optional, it should be the Cross Reference.
NAME to RESI
Either file could be the Host or Cross-Reference based on the keys. However if RESI data is optional, it should be the Cross Reference.
JOIN NAMEPID IN NAME TO RESIPID IN RESI AS JOIN1
*
* Common Field*-- Key Fields
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.9
NAME to TOOK
The NAME file should be the Host file. Use the ALL.
NAME to TOOK
The NAME file should be the Host file. Use the ALL.
JOIN NAMEPID IN NAME TO ALL TOOKPID IN TOOK AS JOIN1
*
*
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.10
NAME to AWRD
The NAME file must be the Cross-Reference (second) file. It is the only file that has the common field as the first part of the key.
NAME to AWRD
The NAME file must be the Cross-Reference (second) file. It is the only file that has the common field as the first part of the key.
JOIN AWRDPID IN AWRD TO NAMEPID IN NAME AS JOIN1
*
*
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.11
PERSON FIRST STUDENT TOOK NUM
ID NAME COUNTER CLASS UNITS
------ ----- ------- ----- -----
N000000001 DEBBIE 1 .00
N000000002 JOANNE 1 PN 118 1.00
N000000003 LINDA 1 DP 252 3.00
SET ALL = ON
JOIN NAMEPID IN NAME TO TOOKPID IN TOOK AS JOIN1
Missing Multiple Classes
Missing Multiple Classes
N000000002 JOANNE 1 PN 118 1.00
JOANNE 1 ABE 111 1.00
JOANNE 1 ACC 136 3.00
JOANNE 1 ACC 152 3.00
N000000003 LINDA 1 DP 252 3.00
LINDA 1 JOUR298 1.00
LINDA 1 RPED178 2.00
LINDA 1 RPED178 2.00
JOIN TOOKPID IN TOOK TO NAMEPID IN NAME AS JOIN1
Missing Students without Classes
Missing Students without Classes
JOIN NAMEPID IN NAME TO ALL TOOKPID IN TOOK AS JOIN1
N000000001 DEBBIE 1 . .
N000000002 JOANNE 1 PN 118 1.00
JOANNE 1 ABE 111 1.00
JOANNE 1 ACC 136 3.00
JOANNE 1 ACC 152 3.00
N000000003 LINDA 1 DP 252 3.00
LINDA 1 JOUR298 1.00
LINDA 1 RPED178 2.00
NAME / TOOK
Join Examples
NAME / TOOK
Join Examples
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.12
PERSON FIRST STUDENT TOOK CLASS NUM
ID NAME COUNTER CLASS COUNT UNITS
------ ----- ------- ----- ----- -----
N000000002 JOANNE 4 ACC 152 4 8.00
N000000003 LINDA 19 AUTO299 19 35.00
JOIN TOOKPID IN TOOK TO NAMEPID IN NAME AS JOIN1
Incorrect Sum of the Name File
Student Counter.
Incorrect Sum of the Name File
Student Counter.
JOIN NAMEPID IN NAME TO ALL TOOKPID IN TOOK AS JOIN1
PERSON FIRST STUDENT TOOK CLASS NUM
ID NAME COUNTER CLASS COUNT UNITS
------ ----- ------- ----- ----- -----
N000000001 DEBBIE 1 . 0 .
N000000002 JOANNE 1 ACC 152 4 8.00
N000000003 LINDA 1 AUTO299 19 35.00
NAME / TOOK
Sum the Joined File
NAME / TOOK
Sum the Joined File
SUM
NAMEFRSTNM
NAMESCNT
CLASS AS 'TOOK,CLASS'
CNT.CLASS
TOOKNOUN
BY NAMEPID
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.13
If 1/1 – Nothing to report.
If 1/many – Show several with their counts.
Run this to verify the number of records, and fields.
FOCUS for SIS Beginning Report Writing
8.A. Join Multiple Files
8.A.14
JOIN multiple files.
JOIN multiple files.
FOCUS for SIS Beginning Report Writing
8.B. Multiple Verbs
8.B.
Multiple Verbs, both a SUM and a PRINT.
Multiple Verbs, both a SUM and a PRINT.
Rules: Up to 6 Verbs per TABLE FILE.
PRINT can only be used once and last.
If SUM has a BY, the next must repeat all of the BYs.
Rules: Up to 6 Verbs per TABLE FILE.
PRINT can only be used once and last.
If SUM has a BY, the next must repeat all of the BYs.
FOCUS for SIS Beginning Report Writing
8.C. Fields for Use in Multiple Runs
8.C.1
&DATE – gets the current date.
&field – set a value once and use it multiple times.
&DATE – gets the current date.
&field – set a value once and use it multiple times.
FOCUS for SIS Beginning Report Writing
8.C. Fields for Use in Multiple Runs
8.C.2
To set a variable at execution time
To set a variable at execution time EX focexec var1=value, var2=value
Batch processing using FOCBAT will allow your terminal to be released for other tasks while your FOCEXEC runs. The output will be stored in VMCF for you to view, route to a printer, or cancel.
8. ReviewUse the JOIN command to combine two
files. If it is a one-to-many relationship use the ALL option.
Use the JOIN CLEAR * to clear old joins.
Multiple verbs may be used in the TABLE FILE command, PRINT must be last.
Can use variables to add flexibility you your reports.
Use FOCBAT to submit jobs in batch – so you can do something else while it runs.
8. Review
FOCUS for SIS Beginning Report Writing
9. BonusA. Focus Processing Flow
B. Set Parameters
C. Common Errors/Problems
D. Tips
E. FOCBAT/VMCF/Job Submittal
F. Managing FOCEXECs
9. Bonus
FOCUS for SIS Beginning Report Writing
FOCUS for SIS Beginning Report Writing
9.A. Processing Flow
9.A.
FOCUS Processing Flow
FOCUS Processing Flow
Locate MFD’s
and Data
Format & PrintWHERE TOTAL – Select
on aggregated and computed values.
COMPUTE – Create new values.
WHERE – Select based on DEFINEd values.
CNT, AVE – Prefix operators applied.
DEFINE – Create new values.
WHERE - Select based on database values.
JOIN/BY – Merge and sort.
FOCUS for SIS Beginning Report Writing
9.B. Set Values
9.B.
PARAMETER SETTINGSALL. OFF HOLDATTR FOCUS PREFIXASNAMES ON HOLDLIST ALL PRINT ONLINEBINS 64 HOLDSTAT OFF QUALCHAR .BLKCALC NEW HOTMENU OFF QUALTITLES OFFBYPANELING OFF INDEX TYPE NEW SCREEN ONCACHE 0 LANGUAGE AMENGLISH SESSION MONITOR OFFCARTESIAN OFF LINES/PAGE 66 SHADOW PAGES OFFCOLUMNSCROLL OFF LINES/PRINT 57 SPACES AUTOCONSULTOPTN INVISIBL MESSAGE ON TITLE ONEMPTYREPORT OFF MODE TSO WIDTH 130FIELDNAME NEW NODATA . XRETRIEVAL ONFOCSAM NEW PAGE-NUM ONFOCSTACK SIZE 8K PAUSE ON>
> > ? SET
FOCUS for SIS Beginning Report Writing
9.C. Common Errors/Problems
9.C.
Space ErrorError: Abend SB37 If holding files and don’t get any data.
Solution: Add Allocation statements to increase file size. DYNAM FREE FILE xxx DYNAM ALLOC FILE xxx SPACE 20 5 CYL
Error: S322 Ran out of time.
Solution: There are 3 ways to submit FOCUS. Try the next method to get more time. FOCBAT get 30 minutes of CPU, overnight Job Submittal gets lots more. If running multiple focexecs in one focbat, need to submit them separately.
Time Error
Lose Fields on Hold File
Error: If holding files and have missing fields.
Solution: Add Allocation to increase file length. DYNAM FREE FILE xxx DYNAM ALLOC FILE xxx LRECL 800
FOCUS for SIS Beginning Report Writing
9.D. Tips
9.D.1
STATFILE or other external file
Use the DYNAM command to show FOCUS where to find the file.
DYNAM FREE FILE STATFILE DYNAM ALLOC FILE STATFILE DS 'LADSISQ.USRSTATR.DATA.D010205.T20003P' SHR
To Save a File on disk or to download.
Use the DYNAM command to save to permanent hold file.
DYNAM FREE FILE xxx DYNAM ALLOC FILE xxx DS ‘UADCJH1.FOCUS.DATA.D010725’ SPACE 20 5 CYL
If need to run again, change the name within the quotes, delete the file manually or add delete before the allocate.
DYNAM DELETE UADCJH1.FOCUS.DATA.D010725
FOCUS for SIS Beginning Report Writing
9.D. Tips
9.D.2
HOLD File??Since HOLD is a function in FOCUS, we couldn’t use HOLD as the name of an MFD. Therefore, HLDS is the file name in FOCUS
Don’t Overtype
Create a new program then copy the old one into it with the GET. If already changed program, use FILE to create new program and then get out with QQUIT to cancel all changes to original program.
FOCUS for SIS Beginning Report Writing
9.E. FOCBAT/VMCF/Job Submittal
9.E.1
FOCBAT is a procedure to submit FOCUS in batch. To execute:
> > ex focbat > > sis
The above screen will appear. You will enter your FOCEXEC name and print options. You may submit up to 3 focexecs in one job. There is a limit of 30 minutes CPU time (not clock time).
FOCUS for SIS Beginning Report Writing
9.E. FOCBAT/VMCF/Job Submittal
9.E.2
VMCF – Look at batch jobs and send them to a printer.
TSO Option Line: =V
VMCF Command Line: 2, printer U9000 or U9*
Select Printer Name: Q
Select Report: S to view, PF3 to return.
Print a Report: Tab to DEST and enter printer id, PF3 to return.
FOCUS for SIS Beginning Report Writing
9.E. FOCBAT/VMCF/Job Submittal
9.E.3
FOCUSADFOCUSCMPFOCUSDSFOCUSFAFOCUSLABFOCUSSAFOCUSSR
Job Submittal LDEF’s
Job Submittal is used to submit batch jobs for overnight processing.
Function Description
LDEF Definition - created by systems, default values.
LREQ Request - Your name and when to run.
LRPF Parameter Fields - Name of the FOCEXEC.
LRSB Substitutions - Printer name, UserID
FOCUS for SIS Beginning Report Writing
9.F. Managing FOCEXECs
9.F.
Commands to assist in managing your files within TED.
Description FOCUS Command
List your FOCEXECs >>EX LIST
List your MFD’s >>EX LISTMFD
Delete a FOCEXEC >>EX DELETE
Copy a FOCEXEC from group copy area.
>>TED FOCEXEC(newname) =>GET COPYEXEC(copyname)
Copy your FOCEXEC to the group area.
>>TED FOCEXEC(yourname) =>SAVE COPYEXEC(newcopy)
9. Bonus Review
A. Focus Processing Flow
B. Set Parameters
C. Common Errors/Problems
D. Tips
E. FOCBAT/VMCF/Job Submittal
F. Managing FOCEXECs
9. Review
FOCUS for SIS Beginning Report Writing
Syntax Summary
DEFINE FILE filename CLEAR|ADD
tempfield[/format] [WITH realfield]=expression;
tempfield[/format] REDEFINES qualifier.fieldname=expression;
END
Syntax Summary
FOCUS for SIS Beginning Report Writing
TABLE FILE filename
HEADING [CENTER]
"text"
display command} [SEG.]field [/R|/L|/C] [/format]
display command}[prefixop.][field] [/R|/L|/C] [/format]
[NOPRINT|AS 'title1,...,title5'] [AND|OVER] [obj2...obj495]
[WITHIN field] [IN n]
COMPUTE field[/format ]=expression;[AS 'title,...,title5'] [IN n]
[AND] ROW-TOTAL [/R|/L|/C] [/format][AS 'name']
[AND] COLUMN-TOTAL [/R|/L|/C] [AS 'name']
ACROSS [HIGHEST] sortfieldn [IN-GROUPS-OF qty] [NOPRINT|AS'title1,...,title5']
BY [HIGHEST] sortfieldn [IN-GROUPS-OF qty] [NOPRINT|AS'title1,...,title5']
BY [HIGHEST|LOWEST{n}]TOTAL[prefix_operator]{field|code_value}
RANKED BY {TOP|HIGHEST|LOWEST} [n]field
ON sortfield option1 [AND] option2 [WHEN expression;...]
Syntax Summary
FOCUS for SIS Beginning Report Writing
WHERE [TOTAL] expression
WHERE RECORDLIMIT EQ n
WHERE READLIMIT EQ n
IF [TOTAL] field relation value [OR value...]
ON TABLE SET parameter value
ON TABLE HOLD [VIA program][AS name] [FORMAT format] [MISSING {ON|OFF}]
ON TABLE PCHOLD [AS name] [FORMAT format] [MISSING {ON|OFF}]
ON TABLE SAVE [AS name] [FORMAT format] [MISSING {ON|OFF}]
ON TABLE SAVB [AS name] [FORMAT format] [MISSING {ON|OFF}]
ON TABLE NOTOTAL
ON TABLE COLUMN-TOTAL [/R|/L|/C] [AS 'name'] fieldname
ON TABLE ROW-TOTAL [/R|/L|/C] [format] [AS 'name'] fieldname
Syntax Summary
FOCUS for SIS Beginning Report Writing
FOOTING [CENTER] [BOTTOM]
"text"
MORE
FILE file2
[IF field relation value [OR value...]|WHERE expression]
{END|RUN|QUIT}
Syntax Summary
FOCUS for SIS Beginning Report Writing