The *RTVFLDINF built-in function specifies that the meta-information about a field is to be retrieved into one or more fields.
Meta-information about a field consists of information about the field itself (the field textual name, the DDS name of the field, the field length, and so forth.), irrespective of the current value of the field. This can be of use if you want to build SQL statements to retrieve information from the file containing the field or if you want to write your own utilities to retrieve information about model objects (for instance, for documentation).
The parameters for the *RTVFLDINF function are:
Note 1: If the field passed in the input parameter specified with the DB1 context, this returns the name of the field on the file, including the 2-character file prefix. If the field is passed in any other context, this returns the name of the field with the appropriate 2-character program prefix (WU for a field in the WRK context, and so forth)
Note 2: This is the (typically 4-character) name of the field as it appears in the model, without any prefix.
Note: 3: If the field passed in the input parameter is a REF field, this parameter returns the surrogate number of the field to which it is referenced, otherwise it returns the same value as is returned in the *Field surrogate parameter.
Note 4: This is the 3-character field attribute, for example, VNM, TXT, CDE, NBR and so on. If the field is a REF field, the attribute of the referenced field is used.
Note 5: This is the name of the field as it is used in the program. For RPG programs, if the field is specified in the DB1 context, this value is the same as the *Field DDS name, except that it has the rename prefix applied to it instead of the file prefix. For all other contexts, this parameter has the same value as the *Field DDS name. For COBOL programs, this field contains the fully qualified name of the field as it is used in the program.
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |