15.15 @@RTV_RELN Command

The @@RTV_RELN command is used to retrieve the relationship (the key fields of the access route) for the specified file number into the required list. This defines how this file is "related" to the file at the next higher level. This applies to all files except the primary file.

Note that the values returned would actually come from the "parent" or "joined" file, not the file nominated by the OF_FILE parameter.

Note that the file must already have been chosen by the @@GET_FILS command, and the list must have been defined/cleared by the @@CLR_LST command.

                                                         Required 

                                                                  

  @@RTV_RELN ----- OF_FILE ----- number ------------------------> 

                                 index                            

                                                                  

             >---- INTO_LST ---- number ------------------------| 

                                 index                            

                                                                  

                                                                  

Parameters

OF_FILE

Specifies the file number for which the relationship (key fields in the access route) is to be retrieved. This number may be a 1 or 2 character numeric or a 2 character index name. If it is an index name, then the current index value will be substituted in this command. Refer to the @@SET_IDX, @@INC_IDX, @@DEC_IDX, @@CMP_IDX commands for setting and using indexes. Note that the file number must have already been selected by an @@GET_FILS command.

INTO_LST

Specifies the list number into which the fields are to be added. This number may be a 1 or 2 character numeric or a 2 character index name. If it is an index name, then the current index value will be substituted in this command. Refer to the @@SET_IDX, @@INC_IDX, @@DEC_IDX, @@CMP_IDX commands for setting and using indexes. Note that the list number must have been previously defined by an @@CLR_LST command.

Examples

The following examples apply to the @@RTV_RELN command.

Example 1: Retrieve the relationship of file 2 into list 2.

@@CLR_LST NUMBER(2)

@@RTV_RELN OF_FILE(2) INTO_LST(2)

 

Example 2: Retrieve the relationship of file "CF" into list 3 and use this to FETCH the related record from file "CF".

@@CLR_LST  NUMBER(3)

@@RTV_RELN OF_FILE(CF) INTO_LST(3)

FETCH      FIELDS(#PANELDATA) FROM_FILE(@@FNAMECF) WITH_KEY(@@LST03)