Access Paths

1270 Views


Access paths specify views of the files in the data model.

The views define how data is to be presented to the functions. Finally they are logic files. Functions specify the processes that operate on the data.

Access paths control three different aspects of how data is presented to a function.

An access path determines:

■ Which fields will be available to the function

■ Which records will be selected or omitted from the file (select/omit)

■ The order in which records are presented (key sequence) to the function

There are five access path types in Synon:

* Physical access path
* Update access path   
* Retrieval access path 
* Resequence access path
* Query access path      
* Spans access path        

Three default access paths are automatically created when a file is created:

■ A physical (PHY) access path (un-keyed).

   It contains the address of all data stored physically within a file and stored in the order in which the data was written to the file.

■ An update (UPD) access path (logical view).

   It is used to update the file and contains all fields defined for the file. It cannot be altered.

■ A retrieval (RTV) access path (logical view).

   It specifies a view of the data that CA 2E generated programs use to retrieve records from a file. Each file has at least one.

Edit File Details

  • In the top half of this panel, view the details for the file.

  • In the bottom half of the panel, view the list of all access paths already defined for the file, including the three default access paths (PHY, RTV, and UPD)

Adding a Physical (PHY) Access Path

Unlike other access path types, you cannot add a physical access path to an existing file. The PHY access path corresponds to an arrival sequence i OS physical file or an SQL table. When you create and define your file and then zoom into the file from the Edit Database Relations panel, 

CA 2E automatically creates a PHY access path as one of the three defaults.

Adding a Resequence (RSQ) Access Path

Once you add the RSQ access path, follow the instructions in the preceding section, Adding an Access Path. At the Edit Access Paths Format Entries panel, you can also identify the new key sequence order:

Adding a Resequence (RSQ) Access Path

Changing the Key Sequence

  • Remove the old key sequence order from the Key no. column.

  • Add the new key sequence order in the Key no. column. Ascending or descending sequence can also be specified for each field in the key sequence.

Lower key numbers indicate a higher key order or a major key. The key sequence numbering should be unique.

Adding a Query (QRY) Access Path

After you add the QRY access path, following the instructions in the preceding section, Adding an Access Path, 

CA 2E creates and generates default values for three auxiliary objects for DDS only. Each object type has its own source, either DDS or CL, that is held in the appropriate source file in the generation library. These objects include:

  • Logical file, which is based on the physical file whose data is being referenced.

  • Physical file, which never contains data and is used to define a record format and keys to any HLL program generated for a function based on the QRY access path.

  • CL program, which executes the Open Query File OPNQRYF ) command. This command is called at execution by any program generated for a function based on the QRY access path.

Adding a Span (SPN) Access Path

The SPN access path is a multi-format view that allows views of two or more formats. The SPN access path can only be specified over files with Owned by or Refers to relationships. The SPN access path must be created over an owning or referred to file.

Once you add the SPN access path, following the instructions in the preceding section, Adding an Access Path, you can also add the new format entries.

Follow these steps:

  • Press F9 from the Edit Access Path Details panel to select formats.The Display Access Path Formats panel displays where you select the format.

  • Type an 

    X

     next to the primary format for the specified file and press Enter.

    You always select the Refers to or Owned by file first.

    The Edit Access Paths Details panel redisplays which shows the format selection indicated by the number in the Seq column next to the format.

  • Follow Steps 1 and 2 to select the secondary format.

Adding a Span (SPN) Access Path

Take Z on each access path to see its field structure.

UVG8REP, UVG8REL0, UVG8REL1 are logic file names used in programs. 

 File name . . . . . . . . : Emp Details               Attribute . : REF  
 Access path name. . . . . : Physical file             Type. . . . : PHY  
 Format text . . . . . . . : Emp Details                                  
 Based on. . . . . . . . . : Emp Details               Format No . :   1  
                                                                          
                                      GEN               Key    Altcol Ref 
 ? Field                              Name       Type   no. Dsc seq   cnt 
   empno                     CDE      ALCD         A                    1 
   empname                   TXT      AKTX         A                    1 
   status                    STS      ANST         A                    1 
   designation               TXT      CJTX         A                    1 
                                                                          
--------------------------------------------------------------------------
 File name . . . . . . . . : Emp Details               Attribute . : REF   
 Access path name. . . . . : Update index              Type. . . . : UPD   
 Format text . . . . . . . : Emp Details                                   
 Based on. . . . . . . . . : Emp Details               Format No . :   1   
                                                                           
                                      GEN               Key    Altcol Ref  
 ? Field                              Name       Type   no. Dsc seq   cnt  
   empno                     CDE      ALCD         K      1             1  
   empname                   TXT      AKTX         A                    1  
   status                    STS      ANST         A                    1  
   designation               TXT      CJTX         A                    1  
--------------------------------------------------------------------------
 File name . . . . . . . . : Emp Details               Attribute . : REF  
 Access path name. . . . . : Retrieval index           Type. . . . : RTV  
 Format text . . . . . . . : Emp Details                                  
 Based on. . . . . . . . . : Emp Details               Format No . :   1  
                                                                          
                                      GEN               Key    Altcol Ref 
 ? Field                              Name       Type   no. Dsc seq   cnt 
   empno                     CDE      ALCD         K      1             1 
   empname                   TXT      AKTX         A                    1 
   status                    STS      ANST         A                    1 
   designation               TXT      CJTX         A                    1 

When we take E on each access path, we can see the source of each logical files. The sources are generated when the access paths are compiled. Take J to generate source and compile the file.

Here is the source of one of the logic file or access path.

 Columns . . . :    1  80                                       Edit                       
 SEU==>                                                                                    
 FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8   
0013.00      A*=====================================================================       
0014.00      A                                      UNIQUE                                 
0015.00      A*=====================================================================       
0016.00      A          R FG8REZG                   TEXT('Emp Details')                    
0017.00      A                                      PFILE(UVG8REP)                         
0018.00      A*---------------------------------------------------------------------       
0019.00      A            G8ALCD                    TEXT('empno')                          
0020.00      A            G8AKTX                    TEXT('empname')                        
0021.00      A            G8ANST                    TEXT('status')                         
0022.00      A            G8CJTX                    TEXT('designation')                    
0023.00      A*.....................................................................       
0024.00      A* Key fields                                                                 
0025.00      A          K G8ALCD                                                           
0026.00      A*=====================================================================       
        ****************** End of data ****************************************************

 

 A Spans SPN access path must be attached to the file that is to form the header format of the access path.

To specify the SPN access path you need to:

1. Define two access path file formats, one for the subfile control (header) and one for the subfile record (detail)

2. Specify the keys for those formats Define the new access path by calling it Race and Entries of type SPN. Type the access path type, name, and Z.

Take X on these files

Take J to Genereate and Compile the Span Access Path

The Spans access path is used in  the function type Edit Transaction (EDTTRN).

Post Comments