The slides used in this video are shown below:
Slide 1
Welcome to the training course on IBM Scalable Architecture for Financial Reporting, or SAFR. This is module 9, “Metadata Creation.”
Slide 2
This module provides you with an overview of logical records and files, physical files, and methods for creating and then associating logical records, logical files, and physical files. Upon completion of this module, you should be able to:
- Create physical file definitions
- Create logical file definitions
- Associate physical files with logical files
- Create logical record definitions, and
- Associate logical files with logical records
Slide 3
This module describes creation of logical records, logical files, and physical files. Simple SAFR processes typically include the use of the following:
- A logical record to describe the input record
- A logical file to describe a group of input files
- A physical file to describe an input file
Specifying a logical file and a physical file for output is optional.
Slide 4
Recall from an earlier lesson that:
- A physical file definition describes a data source. Examples include customer files and order files.
- A logical file definition describes a collection of one or more physical files.
- A logical record definition, or LR, describes a record layout. In COBOL programs, record layouts are often found in copybooks. In relational databases, they are found in table definitions.
Slide 5
To create a physical file, you begin by opening the Administration menu, selecting New, and then selecting Physical File. To select and edit an existing physical file, click the Physical File icon in the navigation pane, and then double-click the appropriate physical file to select it from the list.
Slide 6
Begin by giving the physical file a descriptive name. All SAFR components must be uniquely named within an environment. The names may be up to 48 characters long, starting with a letter, and composed of letters, numbers, and the underscore (_). It is a good practice to add an underscore and the letters “PF” at the end of the name. This is not required, but it helps differentiate physical files from similarly named logical files and logical records. Typical names would be “CUSTOMER_PF,” “ORDER001_PF,” and “US_SALES_PF.”
Slide 7
Next, open the File Type list. Most SAFR processes use disk files. Select Tape File only when SAFR high-speed tape processing is required. Pipes and tokens are special internal SAFR virtual files that are never written to disk or tape. Find out more about them in the “Physical File” subsection of the “Metadata” section of the SAFR help documentation, which can be opened from the Help menu of the Workbench.
Slide 8
Next, open the Access Method list. Again, typical SAFR processes use sequential – standard access. Information about other types of access methods can be found in the SAFR help documentation.
Slide 9
The Read User-Exit Routine field, the parameters field, and the Comments field are optional. Read user-exits are custom-developed programs called by the Extract Engine to read data from files for input to SAFR, rather than the engine reading the files directly. Parameters may be passed to the exits when they are called.
Slide 10
If source data resides in an IBM® DB2® database, the “DB2 via SQL” access method or the “DB2 via VSAM” access method is chosen. This SQL section of the Physical File tab allows you to define the DB2 connection. Details about how to set up a DB2 connection can be found in the SAFR help.
Slide 11
The Dataset tab allows for specification of the input and output parameters for physical files. For input data sets, SAFR processes typically use the input DD name. This 8-character name should match what is placed in the JCL for the Extract phase step of the Performance Engine.
The data set name (or DSN), read disposition (or ReadDISP), and record length parameters are optional. If the actual fully qualified data set name is provided and the input DD name is not found in the JCL, the Extract Engine attempts to dynamically allocate this file. If no disposition is specified here, it defaults to Share.
Slide 12
The Output DD Name field enables you to specify the DD name that will receive output from a view. The other output data set parameters, which correspond to typical JCL file parameters, may be used for dynamic file allocation. Depending upon your operating system configuration, the Performance Engine may not be able to dynamically allocate output files.
Slide 13
When the physical file is saved, it is assigned a unique SAFR ID. The time stamps show when the file was created, and when it was last updated.
Physical files are contained within one or more logical files. A list of the associated logical files is presented on this screen for reference. The association of a physical file with a logical file can be done on the Logical File screen, which will be shown later.
Slide 14
Depending on how Workbench security is set up, the Workbench menu bar displays either the Administration menu (for system administrators) or the Components menu (for non-administrators). To create a logical file, you begin by opening the Administration or Components menu, selecting New, and then selecting Logical File. To select and edit an existing logical file, click the Logical File icon in the navigation pane and then double-click the appropriate logical file to select it from the list.
Slide 15
Remember that a physical file definition must have a unique name. A logical file definition must also have a unique name. The name may be up to 48 characters long, starting with a letter, and composed of letters, numbers, and the underscore (_). It is a good practice to add an underscore and the letters “LF” at the end of the name. This is not required, but it helps differentiate logical files from similarly named physical files and logical records. Typical names are “CUSTOMER_LF,” “ORDER_LF,” and “SALES_LF.”
You can use the Comments field to describe this logical file and its purpose.
Slide 16
Logical files are associated with one or more physical files. To make the association, click Add and select the physical file to be associated. After you click OK, the physical file is displayed in the Associated Physical Files area.
Slide 17
If we return now to the Physical File screen that we were discussing a few slides ago, we can see that the association is also shown here. In this case, CUSTOMER_LF is displayed as a logical file associated with the CUSTOMER_PF physical file.
Slide 18
After you save the logical file for the first time, an ID is assigned and the time stamps are updated.
The records in logical files can be described by many logical records. A list of the associated logic records is presented on this screen for reference. You can associate a logical file with an LR on the Logical Record screen. You must first define an LR before you make the association.
Slide 19
To create a logical record, open the Administration or Components) menu, New, and then select Logical Record. To edit an existing logical record, select Logical Record in thenavigation pane and then select the existing LR from the LR list.
Slide 20
Logical records must be given a name. As with PF names and LF names, an LR name may be up to 48 characters long, starting with a letter, and composed of letters, numbers, and the underscore (_).
Select Logical File for the type because this LR will be associated with a logical file. All LRs are inactive until they contain at least one field.
The lookup user-exit routine and parameters are used for custom-developed routines that are called instead of doing a lookup.
Slide 21
Click the LR Fields tab. The grid on this panel is used to create and maintain field definitions. Fields are defined with names, data types, start positions and lengths, and numbers of decimal points. All the data types discussed in the “I/O Processing and Data Types” module of this training course are available for each field.
To begin, select Add Field from the Edit menu. Then click the Add Field icon (the plus sign) on the Logical Record Editor toolbar or press Alt+Insert. This enables you to fill in values to complete the field definition. As with LR names, a field name may be up to 48 characters long, starting with a letter, and composed of letters, numbers, and the underscore (_).
Slide 22
When you save the logical record, the system automatically assigns a field ID to each field definition.
For a logical record to be the target of a join, you must define the structure of the primary key. The primary key can be composed of one or more fields. Click in the Primary Key cell for the first field in the key, and select 1. Select 2 for the second field in the primary key, and continue in this way until all key fields are defined.
The total length of all key fields in the LR is shown in the Total Key Length field.
Slide 23
Typically, as fields are added, the start position of the new field begins at the end position of the last added field. However, you can set field positions to overlap, using the Redefines check box. This check box allows modification of the Fixed Position field.
Use the number in the Total Length field to ensure that the length of the LR is correct when adding redefined fields.
In this example, the customer date of birth year and month field starts at the same position as the full customer date of birth field.
Slide 24
Scrolling right on the grid reveals additional field attributes that can be assigned. The Date/Time Format field designates how the date is stored in fields, if applicable. A check mark in the Signed check box indicates that the field contains valid sign data. If this field is used as a column in a view, the headings entered here (1,2, & 3) are used as the headings for the column in that view.
Slide 25
After you enter the field definitions, you click the Associated Logical Files tab. On this tab, you define which logical records contain records in the layout of the LR. Click Add and then select the logical files to be associated. After you click OK, the list is updated with the associated logical file.
Slide 26
This module presented you with an overview of logical records and files, physical files, and methods for creating and then associating logical records, logical files, and physical files. Now that you have completed this module, you should be able to:
- Create physical file definitions
- Create logical file definitions
- Associate physical files with logical files
- Create logical record definitions
- Associate logical files with logical records
Slide 27
Additional information about SAFR is available at the web addresses shown here.
Slide 28
Slide 29
This concludes the Module 9. Thank you for your participation.