Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Copyright 2007, Information Builders. Slide 1 Master File Basics Joel Starkman Director of Operations June, 2008."— Presentation transcript:

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

2 Copyright 2007, Information Builders. Slide 2 Describing a File to FOCUS What does a Master Do? 123495DENEWARK06782S47.22035551212 349856CAPOMONA92739C81.47304384773 238745VTSTOWE 05638S 9.84234942747 957484OHTOLEDO27384C26.06738392947 363842LAGRETNA47402C33.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

3 Copyright 2007, Information Builders. Slide 3 Describing a File to FOCUS What does a Master Do? STATE CITY Detailed information A Master defines the relationships among groups of related data Segment COUNTRY Segment EMBASSY Lots of Detailed information

4 Copyright 2007, Information Builders. Slide 4 Major Components of Describing a Data Structure FileSegmentField Attribute Country State Field1 Field2 Field3 City Embassy Field4 Field5 Field6 Field7 Field8 Field9 Field10 Field11 Field12 Field13 Type of data Length Decimal places Commas Currency symbol Negative display Date format Indexed Field Attributes (Usage and Actual) F I L E

5 Copyright 2007, Information Builders. Slide 5 Master File Description Describing 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

6 Copyright 2007, Information Builders. Slide 6 General Syntax Flow FILE= SEGNAME=, SEGTYPE= FIELD= $ Whole-Line Comment SEGNAME=, SEGTYPE=, PARENT=, CRSEG= FIELD= FIELD=...............,$ Comment FIELD= DEFINE runtime field Indent and line-up attributes for readability

7 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 END DBA=, DBAFILE= Up to 3096 different fields Up to 256 segments (new in 7.6) (XFOCUS and non-FOCUS files only)

8 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 END DBA=, 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 file FOC, 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)

9 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 END DBA=, DBAFILE= Segment Attributes SEGTYPE S[H]nData sorted by first “n” fields. ‘H’ means sorted high-to-low S0 No keys - for most non-FOCUS data structures UUnique segment – one occurrence per parent instance K[L]U/MData 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”

10 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 END DBA=, 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

11 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 END DBA=, DBAFILE= Field Attributes Assign 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)

12 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 END DBA=, DBAFILE= Field Attributes Declare 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 Ddouble precision, 1212 total positions,.3 3 decimal places, Bbracket when negative, csuppress thousands commas, Mfloating dollar sign So -12,345,678.1234 would display as ($12345678.123) 8-char max

13 Copyright 2007, Information Builders. Slide 13 Type (T)Length (L)Description A1-4096Alphanumeric characters (up to 256 before 7.1.1) D1-15Decimal, double-precision numbers F1-9Decimal, single-precision numbers I1-9Integer (no decimal places) P1-31Packed decimal numbers DATE4Date format, stored as integer offset from base date H8Datetime format, stored as date concatenated w/ time Field Attributes USAGE 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.99 O - display options. Ex: D12.2BM

14 Copyright 2007, Information Builders. Slide 14 Edit OptionMeaningEffect CCommasInsert 1000’s comma (or period if CDN) cNo CommasSuppress 1000’s comma (for ‘D’ format) %Percent SignDisplay % following numeric value -Minus Sign afterDisplay minus sign on right side of field LLeading ZeroesDisplay leading zeroes BBracket NegativeEnclose negative numbers in parentheses RCredit NegativePlace “CR” after negative numbers SZero SuppressDisplay 0 value as blank M or !DFloating CurrencyFloating “$” to the left of the number !L - British pound, !E – Euro, !Y – Yen N or !dFixed CurrencyFix “$” at the left of the field width Edit Options tailor the display of the field No effect on actual field length Now use : d also (new in 7.6) !D must be last in format

15 Copyright 2007, Information Builders. Slide 15 UsageValueDisplay 17C4769347,693 D10.2S0.00 P8CR-47194,719CR D12.2M28148.00$28,148.00 15B-341(341) D12.2N28148.00$ 28,148.00 F5.2%47.3047.30% P6L21000021 D12.5E1234.560.123456D+04 I6MTDY20675FEB 06 75 A8YYMD197506011975/06/01 Examples of USAGE Attributes

16 Copyright 2007, Information Builders. Slide 16 Field Attributes USAGE Date Components OptionsMeaningEffect DDayValue from 1 to 31 MMonthValue from 1 through 12 YYearTwo-digit year YYFull yearFour-digit year QQuarterValue from 1 to 4 (Q1 begins Jan) JULJulianSee 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

17 Copyright 2007, Information Builders. Slide 17 USAGEDISPLAY wrMtrDYYMonday, December 30 1985 YQ85 Q4 QYYQ4 1985 YMD85/12/30 WtrMonday MDYY12/30/1985 Field Attributes USAGE Date Examples TR/tr, W/w and R/r are additional date-formatting options Various displays of 12/30/85

18 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 END DBA=, DBAFILE= Field Attributes Force 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 timestamp Suggestion: one field per segment to be tracked Use for display and calculations, but cannot be controlled FOCUS and XFOCUS files only Display format is HYYMDS

19 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 END DBA=, 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

20 Copyright 2007, Information Builders. Slide 20 ACTUALUSAGEMeaning DATEDate4-byte integer containing number of days from base date AnAll“n” = 1-4096. Alphanumeric A-Z, 0-9, and special chars D8DDouble-precision, floating-point numbers, in eight bytes F4FSingle-precision, floating-point numbers, in four bytes I1, I2, I4I, DateBinary integers:I1= one-byte, I2= half-word, I4= full-word PnPPacked 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 ZnPZoned decimal; “n” = 1-31 digits, each taking a byte of storage. Last digit is digit and sign Field Attributes Format Types for the ACTUAL Attribute Convert to

21 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 END DBA=, DBAFILE= Example: FIELD=HELLO,,A20, FIELDTYPE=I, $ TABLE FILE CAR.HELLO PRINT COUNTRY IF HELLO EQ ‘HI’ OR ‘BONJOUR’ END COUNTRYHELLO USAHI FRANCEBONJOUR Field Attributes Establish an INDEX for the Field Indexes this field for quick lookup and cross-reference access COUNTRY CAR MODEL HELLO LANGUAGE WORDS Indexed view XREF

22 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 END DBA=, 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... HI NATIONTHERE ----------- AUSTRALIAGDAY ENGLANDTOP ’O THE MORNIN’ FRANCEBONJOUR Column title for report headings. Same as using ‘AS’ in TABLE (which also overrides TITLE)

23 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 END DBA=, 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=FRE TABLE FILE CAR PRINT HELLO... TITLE with lang suffix to display alternate language in title. 30 language extensions supported.

24 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 END DBA=, 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.

25 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 END DBA=, 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

26 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 END DBA=, DBAFILE= Field Attributes Solve Y2K Legacy-Date Century Issues: DEFCNT/YRTHRESH Default century and year-threshold when converting A6 or I6 to SmartDate Ex: FIELD=DT1,,USAGE=MDYY, DEFCENT=19,YRTHRESH=55,$ 010703 becomes 01/07/ 20 03010758 becomes 01/07/ 19 58 Year 050 99 Century to imply for this field, default century is 1900 ex: 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

27 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 END DBA=, DBAFILE= GROUP Declaration Associate 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 MIDDLE END FULLNAME MIDDLE -------- ------ JOHN QPUBLIC Q 9 1 12 Sum of 3 field lengths

28 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 END DBA=, DBAFILE= GROUP Using ELEMENTS Declaration Associate 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 MIDDLE END 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

29 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, FILTER END DBA=, DBAFILE= DEFINE in the Master Create 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.

30 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, FILTER END DBA=, DBAFILE= DEFINE in the Master Prepare 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 CAR PRINT... 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

31 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, FILTER END DBA=, DBAFILE= DEFINE in the Master Put 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 CAR PRINT... WHERE MORNING WHERE... In Master In Focexec

32 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) END DBA=, DBAFILE= DBA Security Restrict Access to Data END required only when DBA is present DBA=password, DBAFILE=filename DBA=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)

33 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) END DBA=, DBAFILE= Cross Reference Files Create a Larger Logical Structure KUKeyed Unique KMKeyed Multiple (non-unique join) KLKeyed Linked KLU Keyed Linked Unique Main File Top Middle Bottom Family Father Location Child Address Grandch CR File KM KLUKM Up to 256 total segments

34 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 PICTUREdraws a diagram of the file – useful with JOINs in effect, and for complex structures. RETRIEVALshows the PICTURE in a retrieval-logic flow, such as putting Unique segments in-line. HOLDcreates an external file with information about the fields in the MFD. For documentation too. S1 S2 U S1 S2 U PICTURE RETRIEVAL

35 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 END DBA=, 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=ON TABLE FILE bv_name table commands using BV field names END Business View Master All other field attributes are taken from mapped real field S1 S2 U field BV mfd Selected fields - other fields not accessible to user Identifies a Business View Use only to resolve field name conflicts

36 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) END DBA=, DBAFILE= Introduction to Master Files


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

Similar presentations


Ads by Google