1 / 36

Master File Basics

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

vanig
Download Presentation

Master File Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Master File Basics Joel Starkman Director of Operations June, 2008

  2. Describing a File to FOCUSWhat 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. FILE Describing a File to FOCUSWhat does a Master Do? Segment A Master defines the relationships among groups of related data COUNTRY STATE Segment Segment EMBASSY Lots of Detailed information CITY Detailed information Segment

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

  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

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

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

  8. File Attributes 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= Default Century and Year Threshold for all dates in the file (override at field level) Default Century and Year Threshold for all dates in the file (override at field level) Type of file FOC, XFOCUS, FIX, DFIX, COM, TAB, VSAM, DB2, etc. Names of theACCESS File where physical file location and information is described Name for this data as known to FOCUS (TABLE FILE name) Physical dataset location (quick substitute for ACCESS) DATASET ‘dsname [ON sinkname]’

  9. 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=“ Segment Attributes How segment instances are arranged (sorted, inverted sort, no sort, # of sort keys) • 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= Arbitrary or expressive name of a collection of related fields Segment higher in the structure to which these “children” relate (no PARENT on root seg) “Segments are logical collections of fields”

  10. 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 Segment Attributes LOCATION, DATASET • 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= Logical name of the file containing the data for this segment Main File Location File Top Seg1 Middle Seg2 Physical full name of the file containing the data for this segment Bottom Seg3

  11. Example: FIELD=THISISTHELONGNAMEOFTHEFIELD, ALIAS=SHORTNAME, ... FIELD=SOCIAL_SECURITY_NUMBER, ALIAS=SSN, ... Field AttributesAssign a Name to the FIELD and Provide an ALIAS Name • 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= 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. Example: … USAGE=D12.3BcM, … Field AttributesDeclare How a Field Should Be Displayed • 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= How a field is used in calculations and aggregations, and how to display it on output 8-char max 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)

  13. 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.99 O - display options. Ex:D12.2BM

  14. Edit Options tailor the display of the fieldNo effect on actual field length !D must be last in format Now use :d also (new in 7.6)

  15. Examples of USAGE Attributes

  16. Field AttributesUSAGE Date Components • “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 Date components describe appearance

  17. Field AttributesUSAGE Date Examples Various displays of 12/30/85 TR/tr, W/w and R/r are additional date-formatting options

  18. Field AttributesForce an Automatic Datestamp with AUTODATE • 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= Automatically populates with current date/time upon Include/Update of segment where field resides Display format is HYYMDS 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

  19. Examples: FIELDNAME = EMPID, , USAGE=A3, ACTUAL=A3, $ FIELDNAME = MARGIN, , P11, Z6, $ FIELDNAME = HIREDATE, , MtrDYY, A6YMD, $ FIELDNAME = MONEY, , P17.2M, P9, $ Field Attributes Declare How The Data Is ACTUALLY Stored • 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= Real type and length of field in the file (not for FOCUS files) Usually derived from existing File Descriptions like COBOL FD’s

  20. Field AttributesFormat Types for the ACTUAL Attribute Convert to

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

  22. Example: FIELD=HELLO,,A20, TITLE=‘ HI,THERE’, $ TABLE FILE CAR PRINT COUNTRY AS ‘NATION’ HELLO ... HI NATION THERE ------ ----- AUSTRALIA GDAY ENGLAND TOP ’O THE MORNIN’ FRANCE BONJOUR Field Attributes Declare the TITLE for the Field on a Report • 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= Column title for report headings. Same as using ‘AS’ in TABLE (which also overrides TITLE)

  23. Example: FIELD=HELLO,,A20, TITLE=‘ Hi,There’, TITLE_FR=‘Bonjour’, TITLE_DE=‘Hallo’, TITLE_ES=‘Hola’ ,$ $ SET LANG=FRE TABLE FILE CAR PRINT HELLO ... Field Attributes Multilingual TITLE options (new in 7.6) • 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_langDESC=, ACCEPT=, DEFCNT=, YRTHRESH=, HELPMESSAGE=, RECTYPE=, OCCURS=, ,$ • GROUP=, ALIAS=, USAGE=, FIELDTYPE/INDEX=, • DEFINE, COMPUTE, FILTER • END • DBA=, DBAFILE= TITLE with lang suffix to display alternate language in title. 30 language extensions supported.

  24. Field Attributes Document the Field in the Metadata • 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= 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. • Example: • $ CREATED ON 7/13 • FIELD=EMPID,, A9, DESC=’Employee ID’,$ comment

  25. Field Attributes Declare Acceptable Input Values for a Field • 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= Specific values to be accepted when prompting during data entry -- no local validation coding needed Also notes Rectype in VSAM/FIX files • 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 WebFOCUS allows ACCEPT Pairs to display user-friendly choices in a dropdown, but still pass the actual value

  26. 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/2003 010758 becomes 01/07/1958 Field AttributesSolve Y2K Legacy-Date Century Issues: DEFCNT/YRTHRESH • 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= Boundary year for this field when the implied century flips; default=00 (see example) Century to imply for this field, default century is 1900 ex: 6/12/05 is treated as6/12/1905 55 Year 0 50 99 2000 1900

  27. GROUP=FULLNAME, FN, A22,$ FIELD=FIRSTNAME,F, A9, $ FIELD=MIDDLE, M, A1, $ FIELD=LASTNAME, L, A12,$ GROUP DeclarationAssociate Consecutive Fields as One “Field” • 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= Logically relates consecutive real fields as one field. Not stored, length is total of component fields Sum of 3 field lengths TABLE FILE … PRINT FULLNAME MIDDLE END FULLNAME MIDDLE -------- ------ JOHN QPUBLIC Q 9 1 12

  28. GROUP=FULLNAME,,ELEMENTS=3,$ FIELD=FIRSTNAME,F, A9, $ FIELD=MIDDLE, M, A1, $ FIELD=LASTNAME, L, A12,$ GROUP Using ELEMENTS DeclarationAssociate Consecutive Fields as One “Field” (new in 7.6) • 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= Adding field lengths gets tricky when one of the group fields is numeric Instead of adding field lengths yourself, use ELEMENTS (new in 7.6) TABLE FILE … PRINT FULLNAME MIDDLE END FULLNAME MIDDLE -------- ------ JOHN QPUBLIC Q 9 1 12

  29. Example: DEFINE HOUR/A2 = EDIT(‘&TOD’,’99$$$$$$’); $ DEFINE GREETING/A12 = IF (HOUR LE 12) THEN ‘GOOD MORNING’ ELSE ‘GOOD EVENING’ ; $ DEFINE in the MasterCreate New Fields at Runtime - DEFINE • 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= 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. Date and Time system variables are the only ones permitted in the Master. 13 different &date configurations. Don’t forget the $

  30. COMPUTE GREETING/A12 = IF (TIME LT 12) THEN ‘GOOD MORNING’ ELSE ‘GOOD EVENING’; $ DEFINE in the MasterPrepare Calculations in the Metadata – COMPUTE (new in 7.6) • 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= In Master TABLE FILE CAR PRINT . . . COMPUTE LOCALFIELD/I5 = RCOST + DCOST; COMPUTE GREETING; AS ‘HELLO’ . . . In Focexec Note the semicolon Syntactically identical to COMPUTE in focexec. Absorbs no space in the data file. A COMPUTE in the Master will not conflict with other COMPUTE’s of the same-name

  31. FILTER MORNING/I1 = IF (TIME LT 12) THEN 1 ELSE 0; $ DEFINE in the MasterPut Screening Criteria in the Metadata – FILTER (new in 7.6) • 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= In Master TABLE FILE CAR PRINT . . . WHERE MORNING WHERE . . . In Focexec Similar to COMPUTE in Master. Binary resolve (I1 only 0 or 1). Absorbs no space in the data file. Implemented as WHERE in TABLE.

  32. DBA=password , DBAFILE=filename DBA=SECRET ,$ USER=ABC12345, ACCESS=R, RESTRICT=VALUE, NAME=MANAGER, VALUE=SALARY LT 100000 ,$ DBA Security Restrict Access to Data • 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= Defines security access to the file and its data for each user or group. File level, Segment level, Field level, or Value-range/Expression END required only when DBA is present Keep DBA security in separate file. DBA person still has full creation and modification rights This will restrict ABC12345 to read-only access to people with salaries only under $100K Password up to 64 characters (new in 7.6)

  33. Main File Top Family Father Middle CR File KM Location Bottom Child KLU KM Address Grandch Cross Reference Files Create a Larger Logical Structure • 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= KU Keyed Unique KM Keyed Multiple (non-unique join) KL Keyed Linked KLU Keyed Linked Unique Up to 256 total segments

  34. 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. RETRIEVALshows 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. Check the Master File Description for Valid Syntax S1 S1 PICTURE RETRIEVAL U U S2 S2

  35. Create a BUSINESS VIEW (BV) Into Your Real Data(WebFOCUS only – coming to FOCUS) 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= Identifies a Business View FILE=bv_name,VIEW_OF=real_mfd_name SEGMENT= folder_name, … FIELD=bv_fieldname, ALIAS=real_fieldname, TITLE=, … BELONGS_TO_SEGMENT=real_seg_name… Business View Master Use only to resolve field name conflicts All other field attributes are taken from mapped real field SET FOCTRANSFORM=ON TABLE FILEbv_name table commands using BV field names END S1 BV mfd field field field field field Selected fields -other fields not accessible to user U S2

  36. Introduction to Master Files • 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= Thank You !

More Related