master file basics

36
Copyright 2007, Information Builders. Slide 1 Master File Basics Joel Starkman Director of Operations June, 2008

Upload: vanig

Post on 12-Feb-2016

52 views

Category:

Documents


1 download

DESCRIPTION

Master File Basics. Joel Starkman Director of Operations June, 2008. Describing a File to FOCUS What does a Master Do?. 123495DENEWARK06782S47.22035551212 349856CAPOMONA92739C81.47304384773 238745VTSTOWE 05638S 9.84234942747 957484OHTOLEDO27384C26.06738392947 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Master File Basics

Copyright 2007, Information Builders. Slide 1

Master File Basics

Joel StarkmanDirector of Operations

June, 2008

Page 2: Master File Basics

Copyright 2007, Information Builders. Slide 2

Describing a File to FOCUSWhat does a Master Do?

123495DENEWARK06782S47.22035551212349856CAPOMONA92739C81.47304384773238745VTSTOWE 05638S 9.84234942747957484OHTOLEDO27384C26.06738392947363842LAGRETNA47402C33.34434933934

FILE=…SEG=…FIELD=OFFICE,,I5,$FIELD=STATE,,A2,$FIELD=CITY,,A6,$FIELD=ZIPCODE,,A5,$FIELD=CS,,A1,$FIELD=SALES,,D4.1,$FIELD=AREACODE,,A3,$FIELD=PHONENUMBER,,A7,$DEFINE CSTEXT/A12 = IF CS EQ ‘C’ THEN ‘CONSULTING’

ELSE IF CS EQ ‘S’ THEN ‘SALES’ ELSE ‘ ‘; ,$

A Master tells you what your data

looks like

Page 3: Master File Basics

Copyright 2007, Information Builders. Slide 3

Describing a File to FOCUSWhat does a Master Do?

STATE

CITY

Detailed

information

A Master defines the relationships among

groups of related data

SegmentCOUNTRY

SegmentSegment

Segment

EMBASSY

Lots of

Detailed

information

Page 4: Master File Basics

Copyright 2007, Information Builders. Slide 4

Major Components of Describing a Data Structure

File Segment Field Attribute

Country

State

Field1Field2Field3

City

EmbassyField4Field5

Field6Field7Field8Field9Field10Field11

Field12Field13

Type of dataLength

Decimal placesCommas

Currency symbolNegative display

Date formatIndexed

Field Attributes

(Usage and A

ctual)

F I L E

Page 5: Master File Basics

Copyright 2007, Information Builders. Slide 5

Master File DescriptionDescribing a File to FOCUS Called a Master File Description, or MFD, or colloquially just “MASTER“

Information in a Master Type and physical location of the file or its parts (segments) Organization and relationships among the data fields Characteristics of the data fields Calculations of fields created at runtime Connections to other files (cross-references - CR) Security restrictions (DBA) if applicable

Naming conventions: filename MASTER or MASTER(filename) or filename.mas

Create a Master via: System editor (ISPF, XEDIT, vi), TED, IEDIT, other AUTO tool or CREATE SYNONYM Tool COBOL-to-FOCUS Translator

Page 6: Master File Basics

Copyright 2007, Information Builders. Slide 6

General Syntax Flow

FILE=SEGNAME=, SEGTYPE=

FIELD=FIELD=$ Whole-Line Comment

SEGNAME=, SEGTYPE=, PARENT=, CRSEG=FIELD=FIELD=FIELD=. . . . . . . . . . . . . . . ,$ CommentFIELD=DEFINE runtime field

Indent and line-up attributes

for readability

Page 7: Master File Basics

Copyright 2007, Information Builders. Slide 7

General Syntax Components

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET =

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Up to 3096 different fields

Up to 256 segments (new in 7.6) (XFOCUS and non-FOCUS files only)

Page 8: Master File Basics

Copyright 2007, Information Builders. Slide 8

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET =

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Name for this data as known to FOCUS

(TABLE FILE name)Physical dataset location (quick substitute for ACCESS)

DATASET ‘dsname [ON sinkname]’

File Attributes

Type of fileFOC, XFOCUS, FIX, DFIX, COM, TAB, VSAM, DB2, etc.

Default Century and Year Threshold for all

dates in the file (override at field level)

Names of theACCESS File where physical file location

and information is described

Default Century and Year Threshold for all dates in the file (override at

field level)

Page 9: Master File Basics

Copyright 2007, Information Builders. Slide 9

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Segment Attributes

SEGTYPE S[H]n Data sorted by first “n” fields. ‘H’ means sorted high-to-low S0 No keys - for most non-FOCUS data structures U Unique segment – one occurrence per parent instance K[L]U/M Data is in another file, with a cross-ref field in common

PARENT Structurally higher segment to which this segment belongs Example: Segment with employee name might be the PARENT of a segment of salary data

FML Hierarchies use additional options “CAPTION=“ and “PARENT_OF=“

How segment instances are arranged (sorted, inverted sort, no sort,

# of sort keys)

Segment higher in the structure to which these

“children” relate(no PARENT on root seg)

Arbitrary or expressive name of a collection of related fields

“Segments are logical collections of fields”

Page 10: Master File Basics

Copyright 2007, Information Builders. Slide 10

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Segment Attributes LOCATION, DATASET

Reduces size of main physical file Often used for Unique segments (Segtype=U) with large alpha strings Often used for seldom-accessed or generally-archived segments Must be declared when file is Created or Rebuilt

Logical name of the file containing the data for this segment

Physical full name of the file containing the data for this segment

Top

Middle

Bottom

Seg1

Seg2

Seg3

Page 11: Master File Basics

Copyright 2007, Information Builders. Slide 11

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field AttributesAssign a Name to the FIELD and Provide an ALIAS Name

Example: FIELD=THISISTHELONGNAMEOFTHEFIELD, ALIAS=SHORTNAME, ... FIELD=SOCIAL_SECURITY_NUMBER, ALIAS=SSN, ...

Assigns a name to a unit of data for reference in

all requests*, up to 66 chars long

Alternate name, usually shorter

(but not always)*

*also column-name for relational databases(specific ALIAS is required for some data adapters)

Page 12: Master File Basics

Copyright 2007, Information Builders. Slide 12

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field AttributesDeclare How a Field Should Be Displayed

Example:… USAGE=D12.3BcM, …

How a field is used in calculations and

aggregations, and how to display it on output

D double precision,12 12 total positions, .3 3 decimal places,B bracket when negative,c suppress thousands commas,M floating dollar sign

So -12,345,678.1234 would

display as ($12345678.123)

8-char max

Page 13: Master File Basics

Copyright 2007, Information Builders. Slide 13

 

Type (T) Length (L) Description A 1-4096 Alphanumeric characters (up to 256 before 7.1.1)

D 1-15 Decimal, double-precision numbers

F 1-9 Decimal, single-precision numbers

I 1-9 Integer (no decimal places)

P 1-31 Packed decimal numbers

DATE 4 Date format, stored as integer offset from base date

H 8 Datetime format, stored as date concatenated w/ time

Field AttributesUSAGE Types & Lengths

USAGE=format (or FORMAT=format) 

Syntax: USAGE = TL.NO (up to 8 characters total)T – type (A,D,F,I,P,date,H)L – total characters, including sign and decimal point (D, F, I, P) (commas add’l)N – number of decimal places. Ex: D12.2 –99,999,999.99 to 999,999,999.99O - display options. Ex: D12.2BM

Page 14: Master File Basics

Copyright 2007, Information Builders. Slide 14

  

Edit Option Meaning Effect C Commas Insert 1000’s comma (or period if CDN)c No Commas Suppress 1000’s comma (for ‘D’ format)

% Percent Sign Display % following numeric value- Minus Sign after Display minus sign on right side of field L Leading Zeroes Display leading zeroes

B Bracket Negative Enclose negative numbers in parentheses

R Credit Negative Place “CR” after negative numbers

S Zero Suppress Display 0 value as blank

M or !D Floating Currency Floating “$” to the left of the number!L - British pound, !E – Euro, !Y – Yen

N or !d Fixed Currency Fix “$” at the left of the field width

Edit Options tailor the display of the fieldNo effect on actual field length

Now use :d also (new in 7.6)!D must be last in format

Page 15: Master File Basics

Copyright 2007, Information Builders. Slide 15

  

Usage Value Display 17C 47693 47,693

D10.2S 0.00

P8CR -4719 4,719CR

D12.2M 28148.00 $28,148.00

15B -341 (341)

D12.2N 28148.00 $ 28,148.00

F5.2% 47.30 47.30%

P6L 21 000021

D12.5E 1234.56 0.123456D+04

I6MTDY 20675 FEB 06 75

A8YYMD 19750601 1975/06/01

Examples of USAGE Attributes

Page 16: Master File Basics

Copyright 2007, Information Builders. Slide 16

Field AttributesUSAGE Date Components

Options Meaning Effect D Day Value from 1 to 31M Month Value from 1 through 12 Y Year Two-digit year

YY Full year Four-digit yearQ Quarter Value from 1 to 4 (Q1 begins Jan)

JUL Julian See yy/ddd (YYJUL - yyyy/dddd)

Date components describe appearance

“Traditional Dates” Ex: I8YYMD Numeric representation of dates Stored as A6, A8, I6, I8, P6, P8 No validation of date Edit options to alter display

“Smart Dates” Ex: YYMD Numeric offset from Base Date Stored as I4 Automatic validation of date Components alter display

Page 17: Master File Basics

Copyright 2007, Information Builders. Slide 17

  

USAGE DISPLAYwrMtrDYY Monday, December 30 1985

YQ 85 Q4

QYY Q4 1985

YMD 85/12/30

Wtr Monday

MDYY 12/30/1985

Field AttributesUSAGE Date Examples

TR/tr, W/w and R/r are additional date-formatting options

Various displays of 12/30/85

Page 18: Master File Basics

Copyright 2007, Information Builders. Slide 18

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field AttributesForce an Automatic Datestamp with AUTODATE

Automatically populates with current date/time upon Include/Update of segment

where field resides

AUTODATE

Make any field an automatic timestampSuggestion: one field per segment to be trackedUse for display and calculations, but cannot be controlledFOCUS and XFOCUS files only

Display format is HYYMDS

Page 19: Master File Basics

Copyright 2007, Information Builders. Slide 19

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field Attributes Declare How The Data Is ACTUALLY Stored

Examples:FIELDNAME = EMPID, , USAGE=A3, ACTUAL=A3, $FIELDNAME = MARGIN, , P11, Z6, $FIELDNAME = HIREDATE, , MtrDYY, A6YMD, $FIELDNAME = MONEY, , P17.2M, P9, $

Real type and length of field in the file

(not for FOCUS files)

Usually derived from existing File Descriptions

like COBOL FD’s

Page 20: Master File Basics

Copyright 2007, Information Builders. Slide 20

  

ACTUAL USAGE Meaning DATE Date 4-byte integer containing number of days from base date

An All “n” = 1-4096. Alphanumeric A-Z, 0-9, and special chars

D8 D Double-precision, floating-point numbers, in eight bytes

F4 F Single-precision, floating-point numbers, in four bytes

I1, I2, I4 I, Date Binary integers:I1= one-byte, I2= half-word, I4= full-word

Pn P Packed decimal; “n”= 1-16 bytes, each with two digits, except for the last byte which contains a digit and the sign. Ex: P6 means 11 digits plus a sign

Zn P Zoned decimal; “n” = 1-31 digits, each taking a byte of storage. Last digit is digit and sign

Field AttributesFormat Types for the ACTUAL Attribute

Convert to

Page 21: Master File Basics

Copyright 2007, Information Builders. Slide 21

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Example:FIELD=HELLO,,A20, FIELDTYPE=I, $

TABLE FILE CAR.HELLO PRINT COUNTRY IF HELLO EQ ‘HI’ OR ‘BONJOUR’END

COUNTRY HELLOUSA HI FRANCE BONJOUR

Field Attributes Establish an INDEX for the Field

Indexes this field for quick lookup and cross-reference access

COUNTRY

CAR

MODELHELLO

LANGUAGE

WORDS

Indexedview

XREF

Page 22: Master File Basics

Copyright 2007, Information Builders. Slide 22

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field Attributes Declare the TITLE for the Field on a Report

Example:FIELD=HELLO,,A20, TITLE=‘ HI,THERE’, $

TABLE FILE CAR PRINT COUNTRY AS ‘NATION’ HELLO ...

HINATION THERE------ -----AUSTRALIA GDAYENGLAND TOP ’O THE MORNIN’ FRANCE BONJOUR

Column title for report headings.Same as using ‘AS’ in TABLE (which also overrides TITLE)

Page 23: Master File Basics

Copyright 2007, Information Builders. Slide 23

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=,TITLE_lang DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field Attributes Multilingual TITLE options (new in 7.6)

Example:FIELD=HELLO,,A20,

TITLE=‘ Hi,There’, TITLE_FR=‘Bonjour’,

TITLE_DE=‘Hallo’,TITLE_ES=‘Hola’ ,$

$SET LANG=FRETABLE FILE CAR PRINT HELLO ...

TITLE with lang suffix to display alternate language in title.

30 language extensions supported.

Page 24: Master File Basics

Copyright 2007, Information Builders. Slide 24

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC[_lang]=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field Attributes Document the Field in the Metadata

Example: $ CREATED ON 7/13 FIELD=EMPID,, A9, DESC=’Employee ID’,$ comment

DESCription for documentation.Up to 2K characters long.

Use DESC_lang for languages - same as TITLE extensions (new in 7.6)

All text after $ is a comment.

All text after $ is a comment.

Page 25: Master File Basics

Copyright 2007, Information Builders. Slide 25

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field Attributes Declare Acceptable Input Values for a Field

Example: … ACCEPT=A or B or C, …

Choose a letter: > D(FOC534) The data value is not among the acceptable values …Choose a letter: > B

Specific values to be accepted when prompting during data entry -- no local validation coding needed

Also notes Rectype in VSAM/FIX files

WebFOCUS allows ACCEPT Pairs to display user-friendly choices in a

dropdown, but still pass the actual value

Page 26: Master File Basics

Copyright 2007, Information Builders. Slide 26

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Field AttributesSolve Y2K Legacy-Date Century Issues: DEFCNT/YRTHRESH

Default century and year-threshold when converting A6 or I6 to SmartDateEx: FIELD=DT1,,USAGE=MDYY,DEFCENT=19,YRTHRESH=55,$ 010703 becomes 01/07/2003 010758 becomes 01/07/1958

Year 0 50 99

Century to imply for this field, default century is 1900ex: 6/12/05 is treated as

6/12/1905

Boundary year for this field when the implied century flips;

default=00 (see example)

55

2000 1900

Page 27: Master File Basics

Copyright 2007, Information Builders. Slide 27

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

GROUP DeclarationAssociate Consecutive Fields as One “Field”

GROUP=FULLNAME, FN, A22,$ FIELD=FIRSTNAME,F, A9, $ FIELD=MIDDLE, M, A1, $ FIELD=LASTNAME, L, A12,$

Logically relates consecutive real fields as one field.

Not stored, length is total of component fields

TABLE FILE …PRINT FULLNAME MIDDLEEND

FULLNAME MIDDLE-------- ------JOHN QPUBLIC Q

9 1 12

Sum of 3 field lengths

Page 28: Master File Basics

Copyright 2007, Information Builders. Slide 28

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

GROUP Using ELEMENTS DeclarationAssociate Consecutive Fields as One “Field” (new in 7.6)

GROUP=FULLNAME,, ELEMENTS=3,$ FIELD=FIRSTNAME,F, A9, $ FIELD=MIDDLE, M, A1, $ FIELD=LASTNAME, L, A12,$

TABLE FILE …PRINT FULLNAME MIDDLEEND

FULLNAME MIDDLE-------- ------JOHN QPUBLIC Q

9 1 12

Instead of adding field lengths yourself,

use ELEMENTS(new in 7.6)

Adding field lengths gets tricky when one of the group fields is numeric

Page 29: Master File Basics

Copyright 2007, Information Builders. Slide 29

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTERENDDBA=, DBAFILE=

DEFINE in the MasterCreate New Fields at Runtime - DEFINE

Example:DEFINE HOUR/A2 = EDIT(‘&TOD’,’99$$$$$$’); $DEFINE GREETING/A12 = IF (HOUR LE 12) THEN ‘GOOD MORNING’

ELSE ‘GOOD EVENING’ ; $

Identical to DEFINE in focexec. Evaluated for each segment

instance retrieved when field is mentioned or used in the TABLE. Absorbs no space in the data file.

Don’t forget the $

Date and Time system variables are the only ones permitted in the Master.

13 different &date configurations.

Page 30: Master File Basics

Copyright 2007, Information Builders. Slide 30

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTERENDDBA=, DBAFILE=

DEFINE in the MasterPrepare Calculations in the Metadata – COMPUTE (new in 7.6)

COMPUTE GREETING/A12 = IF (TIME LT 12) THEN ‘GOOD MORNING’ELSE ‘GOOD EVENING’; $

Syntactically identical to COMPUTE in focexec.

Absorbs no space in the data file.

TABLE FILE CARPRINT . . .COMPUTE LOCALFIELD/I5 = RCOST + DCOST;COMPUTE GREETING; AS ‘HELLO’. . .

In Master

In Focexec

Note the semicolon

A COMPUTE in the Master will not conflict

with other COMPUTE’s of the same-name

Page 31: Master File Basics

Copyright 2007, Information Builders. Slide 31

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTERENDDBA=, DBAFILE=

DEFINE in the MasterPut Screening Criteria in the Metadata – FILTER (new in 7.6)

FILTER MORNING/I1 = IF (TIME LT 12) THEN 1 ELSE 0; $

Similar to COMPUTE in Master. Binary resolve (I1 only 0 or 1).

Absorbs no space in the data file.Implemented as WHERE in TABLE.

TABLE FILE CARPRINT . . .WHERE MORNINGWHERE . . .

In Master

In Focexec

Page 32: Master File Basics

Copyright 2007, Information Builders. Slide 32

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER (not local &’s)

ENDDBA=, DBAFILE=

DBA Security Restrict Access to Data

END required only when DBA is present

DBA=password , DBAFILE=filenameDBA=SECRET ,$ USER=ABC12345, ACCESS=R, RESTRICT=VALUE,

NAME=MANAGER, VALUE=SALARY LT 100000 ,$

This will restrict ABC12345 to read-only access to people with

salaries only under $100K

Defines security access to the file and its data for each user or group.

File level, Segment level, Field level, or Value-range/Expression

Keep DBA security in separate file. DBA person still has full creation

and modification rights

Password up to 64 characters (new in 7.6)

Page 33: Master File Basics

Copyright 2007, Information Builders. Slide 33

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER (not local &’s)

ENDDBA=, DBAFILE=

Cross Reference Files Create a Larger Logical Structure

KU Keyed UniqueKM Keyed Multiple (non-unique join)KL Keyed LinkedKLU Keyed Linked Unique

Main FileTop

Middle

Bottom

Family

Father

Location Child

Address Grandch

CR FileKM

KLU KM

Up to 256 total segments

Page 34: Master File Basics

Copyright 2007, Information Builders. Slide 34

Check the Master File Description for Valid Syntax

CHECK FILE filename [PICTURE [RETRIEVAL]] [HOLD]

Checks the MFD for correct syntax and logical relationships

PICTURE draws a diagram of the file – useful with JOINs in effect, and for complex structures.

RETRIEVAL shows the PICTURE in a retrieval-logic flow, such as putting Unique segments in-line.

HOLD creates an external file with information about the fields in the MFD. For documentation too.

S1

S2U

S1

S2

UPICTURE RETRIEVAL

Page 35: Master File Basics

Copyright 2007, Information Builders. Slide 35

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET =

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER

ENDDBA=, DBAFILE=

Create a BUSINESS VIEW (BV) Into Your Real Data(WebFOCUS only – coming to FOCUS)

FILE=bv_name, VIEW_OF=real_mfd_name SEGMENT= folder_name, … FIELD=bv_fieldname, ALIAS=real_fieldname, TITLE=, … BELONGS_TO_SEGMENT=real_seg_name…

SET FOCTRANSFORM=ONTABLE FILE bv_name

table commands using BV field namesEND

Business View Master

All other field attributes are taken from mapped real field

S1

S2U

fieldfieldfieldfieldfield

BV mfd

Selected fields -other fields not accessible to user

Identifies a Business View

Use only to resolve field name conflicts

Page 36: Master File Basics

Copyright 2007, Information Builders. Slide 36

FILE=, SUFFIX=, FDFC=, FYRTHRESH=, ACCESS=, DATASET = ‘fully qualified dataset name’,

SEGNAME=, SEGTYPE=, PARENT=, LOCATION=, DATASET=,CRFILE=, CRSEG=, CRKEY=,

FIELD=, ALIAS=, USAGE=, ACTUAL=, FIELDTYPE/INDEX=, TITLE=, DESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$

GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, DEFINE, COMPUTE, FILTER (not local &’s)

ENDDBA=, DBAFILE=

Introduction to Master Files