200 likes | 286 Vues
Explore detailed insights on mapping data to reports using declarative statements and field declarations, from segment hierarchies to conditional cross-references. Understand relational data adapters, field aliases, and group declarations. Plan efficient routes with field filtering and virtual field creation for enhanced data retrieval. Master the rules of data mapping techniques for streamlined navigation.
E N D
The Master That Tells All Floria Foote Information Builders June 2008
The MASTER That Tells All The Synonym – The Road Map from the data to the Report EMPLOYEE.FOC
The MASTER That Tells All Where Am I Coming From - The FILE Declaration FILE=filename,SUFFIX=filetype,[FDFC=cent,FYRT=yy,] [ACCESS=accessfile/DATASET=datasetname], [REMARKS|DESC=description] [DESC_ln=description in another language] FILENAME=employee, SUFFIX=FOC , $
The MASTER That Tells All How Will I Get There – SEGMENT Declaration SEGNAME=name, SEGTYPE=, PARENT=, [LOCATION=, [DATASET=,]] • Logical Grouping of Data • For Relational Data Adapters, will represent different tables, identified in the ACCESS file. • SEGTYPE - S0 -- no sequence, • Sn -- Sequence is low-to-high within parent • on first n keys • SHn – Sequenced high-to-low within parent • on first n keys • U -- Only 1 child instance per parent
The MASTER That Tells All How Will I Get There – SEGMENT Declaration SEGNAME=name, SEGTYPE=, PARENT=, CRFILE=, [CRSEG=, [CRKEY=,]SEGSUF=suffix [,$] SEGTYPE: KU Uses Key to access unique instance in CRFILE KM Uses Key to access multiple instances in CRFILE KL[U] Uses Linkage in CRFILE to access other segments CRKEY: Common field in host and cross-referenced file CRSEG: Name of the segment in its own file/master SEGSUF: File SUFFIX of cross-reference file (if not equal host) ,$ No field declarations follow
The MASTER That Tells All How Will I Get There – SEGMENT Declaration Special Cases Conditional Cross-References SEGNAME=name, SEGTYPE=, PARENT=, CRFILE=, [CRSEG=,] JOIN_WHERE = where test; [ JOIN_WHERE = where test2;],$ [,$] Repeated Groups of Data (SUFFIX=FIX/VSAM) SEGNAME=name, SEGTYPE=, PARENT=, OCCURS=VARIABLE|n|fieldname
The MASTER That Tells All How Will I Get There SEGMENT=EMPINFO, SEGTYPE=S1, $ SEGMENT=FUNDTRAN, SEGTYPE=U, PARENT=EMPINFO, $ SEGMENT=JOBSEG, SEGTYPE=KU, PARENT=PAYINFO, CRFILE=JOBFILE, CRKEY=JOBCODE, $ SEGMENT=SECSEG, SEGTYPE=KLU, PARENT=JOBSEG, CRFILE=JOBFILE, $ SEGMENT=ADDRESS, SEGTYPE=S1, PARENT=EMPINFO, $ SEGMENT=ATTNDSEG, SEGTYPE=KM, PARENT=EMPINFO, CRFILE=EDUCFILE, CRKEY=EMP_ID, $ SEGMENT=COURSEG, SEGTYPE=KLU, PARENT=ATTNDSEG, CRFILE=EDUCFILE, $
The MASTER That Tells All What Will I See When I get There? FIELD Declaration FIELD = field_name, [ALIAS= alternate name] , USAGE=usage format, ACTUAL = physical format, [INDEX|FIELDTYPE =I,][ACCEPT=tests,] [DEFCENT=default century,YRTHRESH=year threshold,] [[ TITLE = "default_title" [, TITLE_ln="title_for_ln" ...]] [[, DESC="default_desc" [, DESC_ln="desc_for_ln" ...]], $ Reserved FIELDNAMES RECTYPE -- Used for Delimited,FIX,VSAM,IMS files to indicate different groups of data. MAPVALUE -- Used within a repeating group to indicate different groups of data
The MASTER That Tells All What Will I See When I get There? FIELD Declaration ALIAS Alternate Name Relational Data: Column Name from Relational Table ORDER Used within OCCURS=segment Virtual field containing occurrence number
The MASTER That Tells All What Will I See When I get There? GROUP Declaration GROUP = field_name, ALIAS= alternate name , USAGE=alpha format, ACTUAL = alpha physical format, [INDEX|FIELDTYPE =I,][ACCEPT=tests,] [[ TITLE = "default_title" [, TITLE_ln="title_for_ln" ...]] [[, DESC="default_desc" [, DESC_ln="desc_for_ln" ...]], $ GROUP = field_name, ALIAS= alternate name , ELEMENTS = n [INDEX|FIELDTYPE =I,][ACCEPT=tests,] [[ TITLE = "default_title" [, TITLE_ln="title_for_ln" ...]] [[, DESC="default_desc" [, DESC_ln="desc_for_ln" ...]], $
The MASTER That Tells All How Will I Get There – Field Declaration FIELDNAME=EMP_ID, ALIAS=EID, USAGE=A9, $ GROUP=NAME1, ALIAS=NAME1, ELEMENTS=2, $ FIELDNAME=LAST_NAME, ALIAS=LN, USAGE=A15, $ FIELDNAME=FIRST_NAME, ALIAS=FN, USAGE=A10, $ FIELDNAME=HIRE_DATE, ALIAS=HDT, USAGE=I6YMD, $ FIELDNAME=DEPARTMENT, ALIAS=DPT, USAGE=A10, $ FIELDNAME=CURR_SAL, ALIAS=CSAL, USAGE=D12.2M, $ FIELDNAME=CURR_JOBCODE, ALIAS=CJC, USAGE=A3, $ FIELDNAME=ED_HRS, ALIAS=OJT, USAGE=F6.2, $
The MASTER That Tells All What Are the Rules of the Road? – DBA Security FIELD = … END DBA=dbavalue,$ USER=password, ACCESS=R|RW|U|W, [RESTRICT=SEGMENT,NAME=segment name not allowed] [RESTRICT=FIELD,NAME=field name not allowed] [RESTRICT=VALUE, NAME=segment level for testing|SYSTEM VALUE=“IF test (TABLE)| VALIDATE test (MODIFY)] ,$
The MASTER That Tells All Can I Limit the ROUTEs - FILTERs FILTER name [WITH fieldname] = true/false boolean expression; ,$ FILTER MIS WITH EMPINFO.EMP_ID =DEPARTMENT EQ 'MIS'; $
The MASTER That Tells All What Can I do On the Way Create Virtual/Temporary Fields DEFINE field/format = expression; ,$ • Evaluated on Retrieval of Detail Information • May be used for selection, verb object, sort field DEFINE FULL_NAME/A26 WITH EMPINFO.EMP_ID = FIRST_NAME || (' ' | LAST_NAME); $
The MASTER That Tells All What Can I do Once I Arrive COMPUTE COMPUTE column_name/format = expression; ,$ • Evaluated after retrieval/sort/aggregation • May be used in WHERE TOTAL test or BY … TOTAL DEFINE FULL_NAME/A26 WITH EMPINFO.EMP_ID = FIRST_NAME || (' ' | LAST_NAME); $
The MASTER That Tells AllThe Procedure TABLE FILE EMPLOYEE SUM COMPUTE NEWSAL; COMPUTE NEWDED; BY DEPARTMENT BY FULL_NAME BY EMP_ID NOPRINT ON DEPARTMENT RECOMPUTE AS '*TOTAL' HEADING "" FOOTING "" WHERE MIS; END