Chapter

4
Modifying Access Paths
This chapter explains how to modify an existing access path. It contains nine topics that identify where you can modify the access paths. Once you add access paths to your model, you can modify the details, values, or options you selected. Synon/2E provides sensible defaults for the selections and protects the values that should not be changed. However, in creating your own application, you may need to change some of the defaults based on your own organization’s application design conventions. These procedures walk you through the process.

Before You Begin
When an access path is created, it is created with defaults based on your model values. Some of the model values are specifically used with access paths. By changing the options for one of these model values, it is possible to modify the access paths if your application design warrants the changes. For more information: on the types of access paths available in Synon/2E, refer to this module’s Chapter 1, ‘‘Access Paths: An Introduction.’’ on the default values for access paths and instructions on how to change them, refer to this module’s Chapter 2, ‘‘Setting Default Options for Your Access Paths.’’ on how to add access paths to your model, refer to this module’s Chapter 3, ‘‘Adding Access Paths.’’ on how to generate and compile an access path, refer to this module’s Chapter 7, ‘‘Generating and Compiling.’’

Building Access Paths

BAP 4 -- 1

Before Modifying

Before Modifying
This topic describes navigational techniques and aids used in the subfile selection area of the left margin of the panel and the selection options found in the command text area at the bottom of the panels. This topic also identifies procedures for adding and removing virtual fields, holding and locking access paths, and displaying access path references.

Navigational Techniques and Aids

Synon/2E provides you with ways to navigate to different panels other than by using function keys. Synon/2E identifies a number of standard line selection values usually found in the command text area at the bottom of the panel. For example, you can use Z to zoom into a file or D to delete. When you place one of these selections next to a file in the subfile selection area of your Edit Database Relations panel and press Enter, Synon/2E executes the action. For more information: on navigation, refer to Getting Started, Chapter 3, ‘‘Using Your Model,’’ Navigation Facilities topic and Generating and Implementing Applications, Chapter 1, ‘‘Managing Model Objects,’’ Editing Model Object Lists topic.

Automatic Add Options

Each access path initially contains all of the relations for the file on which it is based, but none of the virtuals. If you add a new relation to a file, the effect on the access path is controlled by the Automatic Add setting. Following are the three Auto Add settings: *Attr Only *All *Held Only attributes are added (physical file changes). Both virtuals and attributes are added. No changes are made to the access path. This prevents level checking.

BAP 4 -- 2

Building Access Paths

Before Modifying

Changing the Auto Add Setting 1. Zoom into the file. Type Z next to any relation for the selected file on the Edit Database Relations panel and press Enter. The Edit File Details panel displays. 2. Toggle the Auto Add setting. At the Edit File Details panel, type H next to the selected access path and press Enter. The allowable Auto Add settings and defaults are as follows.
Access Path PHY UPD RTV RSQ QRY Atr Only Default Default Default Default Default Held No Yes Yes Yes Yes All No No Yes Yes Yes

A refreshed panel displays with the indicator ALL, ATR ONLY, or HELD showing that the selected access path has changed its Auto Add setting. 

Note: The key relations (Known by, Owned by , and Qualified by) are added to the access path regardless of the Auto Add setting. These relations must always be present on all access paths for the file. If a relation is added to an access path and functions that use the access path already exist, the entries that result from resolving the new relations are added to any device designs (reports and panels) used by the functions. For example, if the entries are not key fields on the access path, they will be added as hidden fields to the device designs.

Building Access Paths

BAP 4 -- 3

Zoom into the file. At the Edit File Details panel. enter T next to the selected access path and press Enter. they are added as input fields to the device designs. The Edit File Details panel displays.  Note: You can also trim a format using the Edit Access Path Details panel. Chapter 6. refer to Building Applications. Zoom into the file. The device designs may therefore require readjustment before they can be successfully regenerated. ‘‘Modifying Device Designs. To trim an Access Path: 1. If you trim an access path that has Auto Add set to ALL. For more information: on readjusting the device designs. To Virtualize an Access Path: 1.Before Modifying If they are key fields on the access path. The Edit File Details panel displays. Type Z next to any relation for the selected file on the Edit Database Relations panel and press Enter. You need to repeat the action to confirm. BAP 4 -.’’ Trimming an Access Path You can remove all virtuals from an access path using the Trim option. 2. Virtualizing an Access Path You can add all virtual fields to an access path using the Virtualize option.4 Building Access Paths . Type Z next to any relation for the selected file on the Edit Database Relations panel and press Enter. Auto Add is reset to ATR ONLY. Trim the Access Path.

A permanent lock prevents users from changing a Synon/2E object. Building Access Paths BAP 4 -. Locking an Access Path Temporary Locks Synon/2E supports two types of object locks: temporary and permanent. For designers to add and remove permanent locks. until they are removed by the designer. You need to repeat the action to confirm. These locks are normally cleared by Synon/2E when the object is no longer in use. select L from the bottom of the Edit File Details panel to view the locks in your model. At the Edit File Details panel enter V next to the selected access path and press Enter. Temporary locks hold the access paths so that they can be changed only by one user at a time.Before Modifying 2. Synon/2E automatically removes the locks no longer required. This lock is automatically placed on each Synon/2E object while it is in use. Permanent locks can be placed on Synon/2E objects.  Note: You can also virtualize a format of an access path using the Edit Access Path Details panel. Temporary locks are imposed automatically by Synon/2E to prevent two users from working on the same object at the same time. such as with a subsystem termination or power failure.5 . Permanent Locks Permanent locks can be placed by the designer on any object to prevent any modification or generation of that object. If you are using an object and leave the model abnormally. To remove this inactive temporary lock. they must have *OBJOWN rights to the YMDLLIBRFA data area. a temporary lock can be left on the object. even if the object and model are not in use. These locks stay in effect. This lock now prevents you from accessing the object. If you virtualize an access path that has Auto Add set to Held. Virtualize the Access Path. it will be reset to All.

A Y implies that any access paths that are based on this file can conceivably exist on a remote machine. Chapter 3. just as files created as Distributed Y can be changed to Distributed N. Y means it is distributed and N means it is local. For more information: on usages. ‘‘Managing Model Objects. type U or F next to the selected access path and press Enter. BAP 4 -. via a high-level programming language. The distributed flag indicates whether the file is distributed or local. YGENRDB is the model value that specifies the relational database used when distributed functions are used. The default is N. access to relational databases and files that reside on multiple machines. Displaying Usages for Access Paths To view a list of where each access path is used in the model: View the usages. ‘‘Using Your Model. From the Edit File Details panel. Files initially designed and created as Distributed N can be changed to Distributed Y. The Display Model Usages panel displays with a list of all model objects that use the selected access path. DRDA is IBM’s architecture that provides access to data distributed across various machines. refer to Generating and Implementing Applications. The field has two values.6 Building Access Paths .’’ Locking Objects topic. Chapter 1.’’ Impact Analysis topic.Building Distributed Relational Database Applications For more information: on locks. Specifying Distributed Files Synon/2E lets you flag any files you create for DRDA on the Edit File Details panel. The objective of DRDA is to provide the user. the flag is ignored regardless of its content. refer to Getting Started. Building Distributed Relational Database Applications This topic discusses Distributed Relational Database Architecture (DRDA). If it is set to *NONE.

alternate collating sequence. or Immediate. Building Access Paths BAP 4 -. For instance.7 . The values allowed for the implementation details depend on the access path. ‘‘Distributed Relational Database Architecture. Synon/2E provides defaults for those options and protects the values that should not be changed. Chapter 7. select/omit criteria. Access paths are implemented as separate OS/400 objects. generation mode. You can specify various implementation options for each access path such as the OS/400 object name for the logical file and whether the access path maintenance will be Rebuild. access path maintenance. A table of OS/400 access path implementation attributes follows.’’ Modifying Access Path Details This topic discusses use of the Edit Access Path Details panel including specifying unique/duplicate key retrieval sequence. Delay. For more information: on Distributed Relational Database Architecture refer to Generating and Implementing Applications. and changing source member text and names.Modifying Access Path Details  Note: Any functions built over this file must be regenerated and recompiled to contain the distributed functionality. OS/400 requires that immediate access path maintenance be specified if you specify the DDS UNIQUE keyword.

The default UPD and RTV access paths must be unique. F=FIFO.8 Building Access Paths .D. (4) Alternative collating sequence table for DDS only (DDS ALTCOL keyword) (5) Selection type (S=static. if not unique.Modifying Access Path Details Access path type (1) (2) (3) (4) (5) Unique or Access Alt Col Selection Dup key path maint. Method Used to Implement the Access Path Maintenance Option (1) OPNQRYF command (QRY Access Paths) *FIRSTIO *MINWAIT *ALLIO Edit Access Path Details Panel Maintenance Option DDS (Non-QRY Access Paths) SQL I (immediate) D (delay) R (rebuild) *IMMED *DLY *REBLD Create Index No Index No Index (1) For QRY access paths the access path maintenance options are implemented using OPTIMIZE parameter values on the OS/400 OPNQRYF command.R Yes Yes S/D S/D S/D D S/D PHY Physical UPD Update (default) UPD Update RTV Retrieval (default) RTV Retrieval RSQ Resequence QRY Query SPN Span /C /C /C /C The following legend applies for the access path types: (1) Unique key status (DDS unique keyword or SQL unique keyword with create index statement). D=*MINWAIT. BAP 4 -. (DDS only) sequence DDS only) U U/L/F/ U U/L/F/ U/L/F/ F U/L/F/ I I.D.R I. CL.D. Refer to the following table.R I. C=FCFO) (3) OS/400 access path maintenance (I=*IMMED. R=*ALLIO).R I.R I I. or SQL. (2) Duplicate key sequence for DDS only (L=LIFO. U indicates unique.D.’ ’=undefined. for QRY access paths (I=*FIRSTIO. D=*DLY). see note (2). R=*REBLD.D. D=dynamic) (DDS DYNSLT keyword) The following table shows the effect of each of the Access Path Maintenance options depending on whether this option is implemented in DDS.

. . Generation mode . . .L-LIFO. . . R-RBLD) . refer to IBM AS/400 Control Language Reference. : U (-Unique. Unique or duplicate order Index maintenance option Alternate collating table . : MYAGREL1 . : Customer Retrieval Index Format text (Based on file) Customer Associated Update access path Update index GEN pfx AG SEL: Z-Entries. . . : RTV . Unique/Duplicate Key sequence Access Path Maintenance Alternate Collating Sequence Select/Omit Criteria Generation Mode Source Member Name and Text Building Access Paths BAP 4 -. Editing Access Path Details You can display and change the details for a Synon/2E access path using the Edit Access Path Details panel. X-UNX) . . . Source member name. Format ? Seq name 1 FAGREAV . . . . : . .acps. . . .9 . . . : (S-Static. : I (I-IMMED. : REF . ’ ’-None) . . . . . D-DDS. : Customer Attribute . D-Dynamic.’ ’-Undefined) . . S-SQL. . . Source member text . D-DLY. : M (M-MDLVAL. . V-Virtualize F3=Exit F8=Rename F20=Narrative You can display and edit the following details for an access path using the Edit Access Path Details panel. Access path name. .C-FCFO. . T-Trim. : Retrieval index Type. R-Relations. A-Assoc.Modifying Access Path Details For more information: on parameters for the OPNQRYF command.F-FIFO. Op: YOU MYMDL DSP32 6/30/94 13:40:26 EDIT ACCESS PATH DETAILS File name. . S-Select/omit. . Allow select/omit.

Change the key sequence by entering the selected option in the Duplicate Sequence field and press Enter. Type Z next to the selected access path and press Enter. first out (LIFO). Zoom into the access path. C for first changed. For more information: on the unique/duplicate key sequence. The Edit File Details panel displays. The Edit Access Path Details panel displays. If you do not specify the type of maintenance. the frequency of additions. Zoom into the file. BAP 4 -. first out (FCFO).10 Building Access Paths . and updates to a file. 2. first out (FIFO). Blank means an unspecified sequence is used. However. while they are open. Specifying Access Path Maintenance Synon/2E lets you select the type of maintenance for your OS/400 access paths. L for last in. if they are duplicate. Specify the key sequence. From the Edit Database Relations panel. when the file is closed. what the sequence would be. deletions. OS/400 maintains all access paths immediately. 3. regardless of the maintenance option. the default is immediate maintenance. and the frequency of opens. refer to IBM AS/400 DDS Reference Manual and AS/400 Database Guide. type Z next to the selected file and press Enter. The type of access path maintenance you specify depends on the number of records. 1. the access path maintenance option specifies to OS/400 how the access path should be maintained.Modifying Access Path Details Specifying Unique/Duplicate Key Retrieval Sequence Synon/2E lets you determine if the key values of the access path are unique or duplicate and. F for first in. The possible options are U for unique (this requires Immediate maintenance.

Any maintenance for the OS/400 access path is done the next time the associated file is opened. regardless of whether the OS/400 file is open. D=*DLY Delay maintenance. The OS/400 access path is maintained as changes are made to its associated data. which minimizes delays while reading the file. ‘‘Tailoring for Performance’’ and IBM AS/400 DDS Reference Manual. refer to this module’s Chapter 9. which minimizes time required to open the file and to retrieve the first buffer of records from the file. For QRY access paths.11 . the OPNQRYF command’s OPTIMIZE parameter is set to *ALLIO. Building Access Paths BAP 4 -. For QRY access paths. The OS/400 access path is completely rebuilt each time the file is opened. R=*REBLD Rebuild maintenance. on the OS/400 OPNQRYF command. The access path maintenance options are: I=*IMMED Immediate Maintenance.  Note: Specify I (immediate maintenance) for all files that require unique keys in order to ensure uniqueness for inserts and updates. enter or change the maintenance selection for updating the records in the Maintenance field and press Enter.Modifying Access Path Details Specify access path maintenance. which attempts to minimize total processing time. the OPNQRYF command’s OPTIMIZE parameter is set to *MINWAIT. the OPNQRYF command’s OPTIMIZE parameter is set to *FIRSTIO. refer to IBM AS/400 Control Language Reference. At the Edit Access Path Details panel. For more information: on access path maintenance. For QRY access paths.

For more information: on select/omit criteria. RSQ. instead of when the access path (if any) is maintained BAP 4 -. enter or change the keyword name of the alternative collating sequence table in the Alternating Collating Table field and press Enter. to make the collating sequence for both upper and lower case the same. At the Edit Access Path Details panel. Choosing Select/Omit Criteria topic. which applies the selection and omission criteria as the records are added (stored) D for dynamic. A typical example is to use the OS/400-supplied translate table. QCASE256. refer to this chapter. Use the OS/400 Create Table (CRTTBL) command to create the table or use an existing OS/400 table. Options are: S for static. enter or change the select/omit criteria at the Allow Select/Omit field and press Enter. Specifying Select/Omit Criteria Synon/2E allows you to specify select/omit criteria that filter your view of the records for the RTV. Any field used as a key for this access path should be similarly translated (upper-case only). and QRY type access paths. which specifies the selection and omission of logical file records performed during processing. Specify Alternate Collating Sequence .12 Building Access Paths . SPN. Specify select/omit criteria. such as QSYSTRNTBL or QCASE256.Modifying Access Path Details Specifying Alternate Collating Sequence Synon/2E lets you specify a keyword to direct the OS/400 program to use an alternative collating sequence table when sequencing the records. At the Edit Access Path Details panel. This creates an access path that suppresses unwanted upper/lower case discrepancies in the collating sequence while preserving the upper/lower case differences in the data.

Modifying Access Path Details Blank for no selection/omission criteria  Specifying Generation Mode Note: Dynamic must be specified if there are any virtual fields on the access paths. For example. For QRY access paths. Synon/2E Logical Access Path Synon/2E Physical Access Path DDS DDS SQL Yes Yes SQL No Yes Implications of Using SQL and DDS SQL and DDS Joins To join information from tables/files. while some are not. Outer joins are not part of the American National Standards Institute (ANSI) standard for SQL. The following table outlines these rules. some combinations of files and access paths that use different Data Definition Languages are permitted. SQL uses inner joins and DDS uses outer joins. you cannot have a Synon/2E SQL logical file over a Synon/2E DDS physical file. At the Edit Access Path Details panel enter or change the generation mode at the Generation Mode field and press Enter. Options are: D for DDS S for SQL M for Model value X for Unix In Synon/2E. dynamic will be defaulted if required. Specify Generation Mode . be aware that the same records might not be included. If you switch an access path from DDS to SQL or vice versa. Synon/2E lets you specify the mode in which you generate the source (Data Definition Language). Building Access Paths BAP 4 -.13 .

# 1 2 3 Cust. # 1 2 3 Order Date 4/1/92 4/2/92 4/3/92 Customer File (Secondary File) Cust.14 Building Access Paths . # 1 3 4 Cust. In the SQL join file. Note that the virtual field Cust.Modifying Access Path Details The following examples illustrate an SQL inner join and a DDS outer join. where the joins resolve to a different set of records: Order File (Primary File) Order # 001 002 003 Cust. Name JONES SMITH Order Date 4/1/92 4/2/92 Resulting Joined file--DDS Order # Outer Join 001 002 003 * = spaces Cust. the customer record for Order # 002. # 2. does not exist in the Customer file. the record for Order # 002 is included in the file. In the DDS join file. # 1 3 Cust. Name is filled with blanks in the DDS join file. Name JONES * SMITH Order Date 4/1/92 4/2/92 4/2/92 In the above example. Cust. Copying an Access Path Generated with SQL If you use the Copy Model Objects (YCPYMDLOBJ ) command to copy an SQL generated access path or function to a model that does not have a SQL BAP 4 -. Name JONES SMITH BROWN Resulting Joined file--SQL Order # Inner Join 001 003 Cust. the record for Order # 002 is dropped from the file.

Modifying Access Path Format Entries This topic provides information on identifying access path format text and keys and instructions on changing the key sequence and editing access path format entries. and QRY type access paths are initially defaulted to the entries defined by the key relations but can be changed. YCPYMDLOBJ runs successfully. Identifying Access Path Format Text An access path format can have up to fifty characters of descriptive text. but you need to create a SQL collection for the receiving access path before you can generate source. SPN type access paths can have more than one format.15 . Keys can be sequenced in ascending or descending order. Changing Source Member Text and Names Synon/2E lets you change the source member names and text created. The text appears in the Format Text field on the Edit Access Path Format Entries panel.Modifying Access Path Format Entries environment. Identifying Access Path Format Keys Building Access Paths BAP 4 -. SPN. The keys of the RSQ. and the order in which the key fields appear. At the Edit Access Path Details panel. The keys of UPD and RTV access paths come from the key relations for the based-on file and cannot be changed. The default text is a concatenation of the file name and the access path name. An access path format shows which fields are present in the access path. Change the text or name. It also indicates which of those fields are key fields for the access path. change the name in the Source Member Name field or the text in the Source Member Text field and press Enter. Other types of access paths have only one format.

you can use selection option 2 from the Edit Model Object List panel.16 Building Access Paths . If an alternative collating table is specified for the access path. Zoom into the file. type Z next to any relation for the selected file and press Enter. Changing the Key Sequence 1. Type Z next to the selected access path and press Enter. At the Edit Database Relations panel. Type Z next to the selected format and press Enter. Alternatively. BAP 4 -. you can specify whether to use it to collate particular key fields. You can use this panel to flag those keys that are to be alternately collated. The Edit File Details panel displays. 3.Modifying Access Path Format Entries For more information: on the OS/400 limit on the number of keys that can be specified. The Edit Access Path Format Entries panel displays. Zoom into the access path. refer to AS/400 Database Guide. The Edit Access Path Details panel displays. Zoom into the format. 2.

5.Modifying Access Path Format Entries EDIT ACCESS PATH FORMAT ENTRIES File name . Numbers represent the order of the fields that make up a composite key. : . . . Dsc seq 1 : 1 Ref cnt 1 1 1 1 1 1 1 ? Field Customer Code Customer Name Customer Address1 Customer Address2 Customer Address2 Credit Limit Customer Type CDE TXT TXT TXT TXT VAL STS Type A K A A A A A SEL: Z-Field details. ‘‘Generating and Compiling. . . : . Building Access Paths BAP 4 -.’’ Editing Access Path Format Entries The presence of a field on an access path format (an access path entry) is controlled by the relations specified for the access path. . . . . : Op: YOU DSP32 MYMDL 9/30/94 13:43:05 Customer Customers by name Customer Customer GEN Name AHCD ALTX ANTX AOTX APTX AFVA AGST Attribute. . Based on . Access path name Format text . Change the key order as appropriate by changing the numbers in the Key no. Generate the access path. . L-Locks. you can omit fields from the access path’s format. . Low key order indicates the sequence of the major keys. By dropping particular relations from an access path. . column. Ensure that the key sequence numbers are unique. refer to this module’s Chapter 7. . . . . Key Altcol no. For more information: on how to generate an access path. : RSQ Format No . . . F3=Exit F7=Relations 4. For the new specification to take effect. you must regenerate the access path. : . . . . Change the key sequence. By default.17 . : REF Type . all the relations specified for the based-on file are declared to be present on an access path so that all the fields from the file are initially present.

• Altering Field Sequence or Implementation Name 1. The physical file format entries for an assimilated Synon/2E physical access path can be edited using the Edit Physical File Format Entries panel. Access path formats are created automatically for all access path types except SPN. BAP 4 -. type Z next to any relation for the selected file and press Enter. use the Edit Access Path Relations panel. For SPN access paths you need to add formats explicitly. At the Edit Database Relations panel. refer to this module’s Chapter 3.’’  Editing Physical File Format Entries Note: Relations are present on an access path if they were added to the based-on file after a hold was specified on the access path. QRY. that the fields occur in a different order from that shown on the Edit Access Path Entries panel. You use the panel to specify override values to be used when generating source. This panel allows you to specify • that the fields in a given database file have different implementation names from those used in the logical files based over them. Alternatively. ‘‘Adding Access Paths. To display the fields that are present on the access path format. and SPN type access paths.18 Building Access Paths . You can use the Edit Access Path Format Entries panel to specify an alternative key order for RSQ. For more information: on adding SPN access path format entries. Synon/2E lets you edit access path format entries using the Edit Access Path Details panel. you can use selection option 2 from the Edit Model Object List panel. use the Edit Access Path Format Entries panel. Zoom into the file.Modifying Access Path Format Entries To display and change the relations for an access path.

The Edit Access Path Details panel displays. .0 DDS Name Type ORDCDE S ORLN PRODUC ORDQTY Length CDE NBR CDE QTY F3=Exit F5=Reload Override order Override name Fields in format 5.0 2. : Order detail MY 13/05/92 MYMDL Attribute Type :REF :PHY 10:59:28 -------------OVERRIDE--------------Field Order code Order line number Product code Order quantity Type A P A P Length 5 3. : Physical file Format text .0 1.19 . Type Z next to the format and press Enter. The Edit Physical File Format Entries panel displays.Modifying Access Path Format Entries The Edit File Details panel displays. : Order detail Access path. .0 6 7. 3.2 Seq 3. . . . . . Press F8. Change the DDS name or the file sequence as appropriate and press Enter. Zoom into the format. 4.0 4. . Op: EDIT PHYSICAL FILE FORMAT ENTRIES File name . 2. . Type Z next to the PHY access path and press Enter. Zoom into the physical access path of the assimilated file. Change the DDS Name or the Sequence. The Edit Access Path Format Entries panel displays. Access the Edit Physical File Format Entries panel. Building Access Paths BAP 4 -.

‘‘Understanding Your Data Model. The relations for an access path are composed of the set or subset of a file’s relations that apply to a particular access path. a particular access path may not require all of the fields and relations from the file to be present on the access path.20 Building Access Paths . File A A Known by A Has A Refers to A Refers to b c D E Access path (1) A Known by A Has A Refers to A Refers to b c D E Access path (2) A Known by A Has A Refers to b c E A A Access path (3) Known by Refers to b D For more information: on relations. When you drop file-to-file relations. BAP 4 -. For a specific access path belonging to a given file. The following is an illustration of access path and file relations. In other words. only some of the relations specified for the file need to apply. those key fields associated with the relation are dropped as are all associated virtual fields. Each access path may have its own subset of the file’s attributes and relations. such as Refers to.Modifying Access Path Relations Modifying Access Path Relations This topic discusses required relations and provides instructions on editing access path relations. Chapter 3.’’ Using Relations topic. refer to Defining a Data Model.

they will be added as hidden fields to the device design.21 . A PHY type access path always contains all of the relations for the file on which it is based. 1. Adding Relations to a File topic. On this panel. For more information: on how to define specific required relations. If a new relation is added to a file. refer to the instructions in this chapter. they will be added as input fields to the device designs. define the entries resulting from the resolution of the relations as the keys of the access path. On other access path types. Adding Relations to a File Each access path initially contains all the relations for the file on which it is based.Modifying Access Path Relations Understanding Required Relations The key level relations for a file (Known by. From the Edit Database Relations panel. Zoom into the file. as do any functions attached to them. Held access paths remain unchanged. the entries that result from resolving the new relations will be added to the function’s device designs as follows: • If they are not key fields on the access path. it will be added to the list of access path relations for each of the file’s access paths provided that the access paths are not held. • Editing Access Path Relations Synon/2E lets you display and edit access path relations with the Edit Access Path Relations panel. not necessarily as key fields. Alternatively. If a relation is added to an access path and functions already exist that use that access path. you can reinstate or drop relations from an access path. If they are key fields. Owned by. and Qualified by ) must be present on all access paths for the file. On UPD and RTV type access paths. type a Z next to any relation for the selected file and press Enter. you Building Access Paths BAP 4 -. the relations merely cause the fields to be present on the file.

Specify the access path relations. .Modifying Access Path Relations can use selection option 2 from the Edit Model Object List panel. . . : REF Type . . . Held access BAP 4 -. The Edit Access Path Relations panel displays. . V-Virtual F3=Exit F7=Entries 4. . it is added to the list of access path relations for each of the file’s access paths except those access paths specified to be held. Access path/Function : 1 File/for Customer Code Customer Name Customer Address1 Customer Address2 Customer Address3 Credit Limit Customer Type SEL: A-Ref Accpths. Type Z next to the selected access path and press Enter. The Edit File Details panel displays. Select the access path relation. . Type + (plus) or . : : : : Customer Customers by name Customer Customer Attribute.22 Building Access Paths . . . . . Type an R next to the selected access path and press Enter. . . Based on . Zoom into the access path. . .(minus) next to the relations you want to reinstate or remove from the access path and press Enter. Each access path initially contains all of the relations for the file on which it is based. Op: YOU MYMDL DSP32 9/30/92 13:57:21 EDIT ACCESS PATH RELATIONS File name . : RSQ Format No . The Edit Access Paths Details panel displays. . T-Default F4. . . . S-Select F4. . ? Verb * Known by * Has * Has * Has * Has * Has * Has . Access path name Format text . ‘+’/ ‘-’-Add/Rmv relation. 3. . 2. . If a new relation is added to a file.

and Customer address). For example. to each instance of that relation on a particular access path of the file. Branch name. if Customer file has five fields (Customer no. Customer name. Understanding Access Path Virtual Field Entries An access path virtual field is a field that is logically.23 . This topic also contains instructions on editing virtual field entries. A virtual field specified on a relation of a file is added. only the Branch name field is available as a virtual field on all access paths of Customer file. and tailor virtual fields for access paths. The virtual fields for an access path can be selected only from among fields that have been specified as virtual fields for the file. present on an access path. Modifying Virtual Field Entries This topic explains how to identify relations with virtual fields. specify file and access path relations. Although the field does not reside on the based-on physical file. Branch no.. Building Access Paths BAP 4 -.Modifying Virtual Field Entries paths remain unchanged as do any functions attached to them. a view of it is available through the relations that exist for the access path. rather than physically. by default. It is possible to omit particular virtual fields from a particular access path. and if Customer file Refers To Branch file with only Branch name field as a virtual field..

’’ Specifying File and Access Path Relations Specifying virtual fields is a two level process: for a field to be used as a virtual field. you must specify it as a virtual field on both the file relations and the access path relations. You can include or drop this virtual field from any access paths over the Customer file. Identifying Relations with Virtual Fields Synon/2E lets you specify only virtual fields on the Owned by. Chapter 3. Branch name Branch address Customer no.Modifying Virtual Field Entries Branch Branch Branch Customer Customer Customer Customer Known by Has Has Known by Has Has Refers to Branch no. BAP 4 -. It checks on the generation mode and access path type. refer to Defining a Data Model. For more information: on files and relations. to the Customer file. ‘‘Creating/Defining Your Data Model. This read-only field is implemented as a join logical file or SQL view. ‘‘Understanding Your Data Model’’ and Chapter 4. Refers to. Virtual fields can be used only as read-only fields in standard functions. Different access paths for a file can contain different combinations of relations. Customer name Customer address Branch The Customer Refers to relation adds the field Branch No. and Extended by relation types.24 Building Access Paths . and each file-to-file relation on the access path can have a different set of virtual fields associated with it. Virtualization allows you to add the field Branch name as a virtual field to the Customer file.

Building Access Paths BAP 4 -.y.25 . as it is not specified as a field on the relations for the file.z A Refers to E Vrt: h Access path(2) A Known by A Has A Refers to b c E Access path (3) A Known by A Refers to Vrt: z b D Editing Virtual Field Entries Synon/2E lets you edit the virtual field entries on both the file and the access path. on specifying virtual fields on an access path.’’ Adding/Modifying Virtual Fields topic. the Tailoring Virtual Fields for Access Paths subtopic.Modifying Virtual Field Entries In the previous example. For more information: on specifying virtual fields on a file.z A Refers to E Vrt: h File E E Known by E Has E Has f g h Access path(1) A Known by b A Has c A Refers to D Vrt: x. the field Branch address is not available as a virtual field on any access path of the Customer file. File D D D D D D D Known by Has Has Has Has Has w x y z r t File A A Known by b A Has c A Refers to D Vrt: x. Field level virtual fields are specified using the Edit Virtual Field Entries panel.y. The following example shows you how access paths can have subsets of the relations on the file. Chapter 5. refer to this topic. refer to Defining a Data Model. Access path virtual fields are specified using the Edit Access Path Relation Virtual Fields panel. ‘‘Maintaining Your Data Model.

Specify virtual fields. 1. 5. Select the virtual field entry. Zoom into the file . The access path level panel specifies that a virtual field is present on a particular access path. The Edit Access Path Details panel displays. 4. Type Z next to the selected format and press Enter.26 Building Access Paths . The Edit Access Path Format Entry panel displays. Type V next to the selected relation and press Enter. BAP 4 -. Zoom into the format. The Edit File Detail panel displays. you can use selection option 2 from the Edit Model Object List panel.Modifying Virtual Field Entries The file level panel declares that a field is available for use as a virtual field on any of the access paths for the file. The Edit Access Path Relations panel displays. At the Edit Database Relations panel. 2. The Edit Access Path Relation Virtual Field panel displays. Type Z next to the selected access path and press Enter. Press F7 and Enter. Alternatively. type Z next to any relation for the selected file and press Enter. 3. Zoom into the access path.

Building Access Paths BAP 4 -. Relation . Ensure that the join logicals you set up when you virtualize provide you with the data you need. . . or Extended by relation or you will not be able to virtualize the field. for . Access path name . . Tailoring Virtual Fields for Access Paths It is important to consider the design of your application when specifying virtual fields. : CPT Type . . . F3=Exit ‘+’/‘. Refers to. . L=Locks. . .27 . . .  Note: The selected relation must be an Owned by. . . refer to this module’s Chapter 9. .’’ Using Join Logicals topic. ‘‘Tailoring for Performance. . . . . Type + (plus) or (minus) next to the field(s) you want to virtualize and press Enter.Modifying Virtual Field Entries Op: YOU EDIT ACCPTH RELATION VIRTUAL FIELDS MYMDL File name . : : : : : Order Retrieval index Order Order Refers to Customer DSP32 9/30/93 13:43:05 Attribute. . Based on . For more information: on tailoring virtuals. . Format text . . . . . : RTV Format No . . : 1 ? D Field * Customer Name * Credit Limit GEN Name ALTX AFVA Ref cnt 1 1 SEL: Z-Field details. Edit the virtual field entry. A refreshed panel displays with your choices highlighted. . .Add/Remove virtual field. 6. This saves the operating system from having to do unnecessary Input/Output (I/O) to other files. . . . . . . .

Access path selection lets you specify that a particular access path retrieves only the records from the file that meet specified select/omit criteria. If a record does not satisfy any select or omit set. the conditions within a set are ANDed together. If you want to obtain a view of only the part-time employees. Each of the select/omit sets are defined by one or more conditions. If there is more than one condition. it will be tested against subsequent sets.Choosing Select/Omit Criteria Choosing Select/Omit Criteria This topic provides instructions on specifying selection and conditions. If a record does not satisfy a select or omit set. the access path suspended order is made of two select/omit sets: Awaiting Confirmation and Passed Credit Check. BAP 4 -. For example. you can define an access path with selection on an employee type field that identifies part-time employees. or many select/omit sets specified. one. In the following example.28 Building Access Paths . you have a personnel file containing records for both full-time and part-time employees. Each set is made up of one or more conditions that specify the actual values that a field may take. such as those that contain specified values for particular fields. For example. if there are two conditions. it is either selected or omitted and further sets are not relevant. A given access path may have none. the sets are ORed together. If there is more than one set. Once a record satisfies a select or omit set. both must be valid for the entire set to be valid. it is omitted if the last set was a select set and selected if the last set was an omit set. Understanding Select/Omit Synon/2E lets you specify selection using a select/omit set.

Type Z next to the selected access path and press Enter. Zoom into the file. Select the format. 2. Building Access Paths BAP 4 -. 4. The following steps tell you how to specify selection. 3. 1. Zoom into the access path. The Edit Access Path Details panel displays. Enter an S for select or O for omit in the S/O column and the text description to indicate the name for the selection criteria set. Type S next to the selected format and press Enter. Alternatively. Specify selection. type Z next to any relation for the selected file and press Enter. The Edit File Details panel displays.  Note: The Allow Select/Omit access path option must be set to either S or D.Choosing Select/Omit Criteria Accpth Suspended order Select 001 Select/Omit set Field Condition Op Value Passed credit check 001 Order status AND 002 Credit limit Awaiting confirmation 001 Invoice status AND 002 Invoice value Open Not exceeded *EQ *GT H 5000 Select 002 Unconfirmed not zero *EQ *GT U 0 Specifying Selection Use the Edit Access Path Select/Omit panel to specify selection and the names of the select/omit sets that make up the selection criteria.29 . you can use selection option 2 from the Edit Model Object List panel. At the Edit Database Relations panel. The Edit Access Path Select/Omit panel displays.

. . Specifying Conditions Use the Edit Access Path Conditions panel to specify conditions (which are the actual field conditions that make up a given select/omit set). . . 2. . : REF Type . .30 Building Access Paths . . place a question mark in the appropriate column and press Enter. . : : : : Op: YOU MYMDL DSP32 9/30/92 14:05:05 Customer Retrieval index Customer Customer Attribute. . ? S/O S Seq . Type Z next to the selection to specify the conditions and press Enter. Zoom into the selection. The Display Access Path Format Entries panel or the Edit Field Conditions panel displays. Based on . . .Choosing Select/Omit Criteria EDIT ACCESS PATH SELECT/OMIT File name . If you do not know the field or condition name. : RTV Format No . . . : 1 Text description Select Active Customers Only SEL: Z-Conditions. . Access path name Format text . . . . . View the fields or conditions. . . The Edit Access Path Conditions panel displays with the selections. Type X next to the selected field or condition and press Enter. F3=Exit F5=Reload F9=Entries 5. The Edit Access Path Conditions panel displays. . 1. . Enter the field and condition name for the selection in the appropriate column. Specify the condition. . BAP 4 -.

the relation always references an access path. and Fathers be only male by specifying the access path selection on the relation. by default.’’ Adding/Modifying Conditions topic. This access path is used by functions for validation and. This enables you to specify selection criteria for the relationship. Using the F4 prompt function assignment you can change the prompt function assigned to a file-to-file relation. ‘‘Maintaining Your Data Model. Mother Father Animal The relations you would need to specify the pedigree are as follows: Building Access Paths BAP 4 -. Changing a Referenced Access Path This topic discusses referenced access paths. If you change the access path. refer to Defining a Data Model. this is the access path RTV automatically created by Synon/2E. alter the relation so that a different access path is used. For more information: on function assignment. refer to the information at the end of this topic. When an access path includes a relation that refers to another file. then the prompt function will default to the SELRCD function for that access path. Chapter 5.31 . you could specify that Mothers be only female.Changing a Referenced Access Path For more information: on how to add conditions. however. You can. In a database recording pedigrees.

BAP 4 -. Record exists message ? Typ PHY UPD RTV RTV RTV : : : : : : : Animal REF JZ Animal Animal not found already exists Source mbr UUJZREP UUJZREL0 UUJZREL1 UUJZREL1 UUJZREL1 Key None Unique Unique Unique Unique NF Msgid: USR0005 EX Msgid: USR0006 Maint Immed Immed Immed Immed Held YOUR WRKSTN1 14/05/92 15:22:26 MYMDL Field reference file : ZODRFP Source library. Op: EDIT FILE DETAILS File name . . U-Usage.Changing a Referenced Access Path FIL FIL FIL FIL FIL FIL FIL Animal Animal Animal Animal For: Animal For: REF REF REF REF Mother REF Father Known by Has Has Refers to Refers to FLD FLD FLD FIL Sharing: FIL Sharing: Animal code Animal name Gender Animal Animal CDE TXT STS REF REF Then. L-Locks F3=Exit F7=Functions F8=Change name F17=Services Synon/2E access paths for file Z option to transfer to access path details display Having added the new access paths. . . . D-Delete. . and mothers must be female. . . . Attribute . fathers must be male. . you can return to the relations for the original retrieval Synon/2E access path and specify that the Refers to relations are to use the additional Synon/2E access paths with gender-specific selection. . N-Narrative. Record not found message . Male and Female. G/J-Generate. Thus. : ZOOGENLIB Z Z Access path Physical file Update index Retrieval index Males index Females index SEL: Z-Details. .32 Building Access Paths . you can define two additional retrieval access paths on the Animal file that select on each gender respectively. RPG format prefix. . . . Documentation seq . Assimilated physical . . . . E-STRSEU. O-Overrides. . . having attached two conditions to gender. H-Hold/Release.

. S-Select F4.’+’/’-’ Add/Rmv relations. Select the Referenced Access Paths option. The Edit Access Path Details panel displays. The Display File Access Paths panel displays. Go to the access path relations panel.33 . The Edit Access Path Relations panel displays. Zoom into the access path details.Changing a Referenced Access Path 1. Type A next to the relation and press Enter.: 1 Animal Retrieval index Animal Animal Access path/Function A Males index Females index * Refers to SEL: A-Ref Accpths. : RTV Format no. Type R next to the formats and press Enter. : REF Type . Type Z next to the selected access path on the Edit File Details panel. 4. Op: EDIT ACCESS PATH RELATIONS File name Access path Format text Based on ? * * * * Verb Known by Has Has Refers to File/for Animal code Animal name Gender Animal mother Animal father : : : : YOUR WRKSTN1 14/05/92 15:22:02 MYMDL Attribute . V-Virtual F3=Exit F7=Entries The ‘A’ line selection option is used to call a subsidiary display to change the relations to use the appropriate Synon/2E access paths in the based-on file. Building Access Paths BAP 4 -. 2. Select the access path. Type X next to the appropriate access path and press Enter. T-Default F4. 3.

Use the instructions on the previous page to get to the Edit Access Path Relations panel.34 Building Access Paths . To cancel the function assignment and return to the default function: Type T next to the selected relation and press Enter. For more information: on F4 prompt function assignment at the function level. You can select any external function other than Print File (PRTFIL) and the function can be based over any access path that is valid for the function type you select. 3. The Edit Function panel displays. This can be done at the access path or function level.Changing a Referenced Access Path F4 Prompt Function Assignment Synon/2E allows you to change the access path assigned to the file-to-file relation and to assign a new prompt function over the access path. refer to Building Applications. Type S next to the selected file-to-file relation you want to assign to the access path and press Enter. BAP 4 -. To prompt for a new function assignment: 1.’’ SELRCD topic. Function level overrides take precedence over access path level overrides. Type X next to the selected function and press Enter. 2. ‘‘Defining Functions. Chapter 3.

Modifying Access Path Auxiliaries Modifying Access Path Auxiliaries This topic provides instructions on editing access path auxiliaries. either DDS or CL. which does not contain any data. Synon/2E will automatically supply source member names. You can control the implementation names given to the auxiliary objects by controlling the names given to the source members generated for them. In order to do this. To implement QRY type access paths for DDS. Understanding Access Path Auxiliaries Use the following three types of OS/400 objects to implement a QRY access path in DDS: • an OS/400 logical file based on the real physical file whose data is being referenced. • • Each object type has its own source. For SQL. When you create a new QRY type access path Synon/2E generates default values for the access path auxiliary display. It is called at execution by any program generated for a function based on the QRY access path. use dynamic SQL. If the YALCVNM model value is set to YES. All three of the auxiliary objects must be generated and compiled. Synon/2E holds some additional information for QRY access paths only. but is used to define a record format and keys to any HLL program generated for a function based on the QRY access path. which is held in the appropriate source file in the generation library. use the OS/400 Open Query File (OPNQRYF) command. an OS/400 physical file. which is shown on the Auxiliary Display panel. a CL program that executes the OPNQRYF command.35 . Building Access Paths BAP 4 -.

you must zoom into the access path by typing Z next to the QRY access path. Press F7. BAP 4 -. refer to this module’s Chapter 1. Type Z on the selected QRY access path and press Enter. Edit the auxiliaries. Zoom into the file.  Note: In order to get the F7 option for auxiliaries. 2. The Edit Access Path Auxiliaries panel displays.36 Building Access Paths . Alternatively.’’ Editing Access Path Auxiliaries Use the Edit Access Path Auxiliaries panel to display and change the auxiliary details for a QRY access path including changing source member names. 3. For the new specifications to take effect. View the auxiliaries. 1. At the Edit Database Relations panel. The Edit File Details panel displays. Zoom into the access path. you need to regenerate the access path. Generate the access path. type Z next to any relation for the selected file and press Enter. you can use selection option 2 from the Edit Model Object List panel.Modifying Access Path Auxiliaries For more information: on access path auxiliaries and QRY access paths. 4. The Edit Access Path Details panel displays. ‘‘Access Paths: An Introduction. Change any of the following details as appropriate: ° ° Source Member Name Source Member Text 5.

37 . refer to the instructions in this module’s Chapter 7.Modifying Access Path Auxiliaries For more information: on how to generate the access path.’’ Building Access Paths BAP 4 -. ‘‘Generating and Compiling.

38 Building Access Paths .Modifying Access Path Auxiliaries BAP 4 -.