Specifying File Names in I O Commands

LANSA Technical

Specifying File Names in I/O Commands

Most of the LANSA database I/O commands require the specification of a file name. The parameter name may be FROM_FILE, TO_FILE, INTO_FILE, etc. but in all cases, the way that the file name is specified is identical.

The following points apply to specifying a file name in any LANSA command:

  • The file nominated must be defined within the LANSA system as either a physical file or a logical file.
  • Index-only logical files may not be used for this parameter in RDML code that will execute on the IBM i.
  • Optionally a library name may be specified.
    The use of the file and library name (i.e. fully qualified file names) is NOT recommended because it "locks" the RDML program into using a certain file in a certain library. This may cause problems when you attempt to import or export functions to/from other versions of LANSA that use different library names.

    For the IBM i, separate the file and library name using "." (i.e. full stop). For example a TO_FILE parameter might be specified as:

      TO_FILE(CUSTMST)

      TO_FILE(CUSTMST.QGPL)

      TO_FILE(CUSTMST.USERLIB01)

 

     For Visual LANSA, separate the file and library name using a space. In Visual LANSA, for example, the above TO_FILE parameters would be specified as:

      TO_FILE(CUSTMST QGPL)

      TO_FILE(CUSTMST USERLIB01)

 

Portability Considerations

On platforms other than IBM i, Visual LANSA will ignore the library.

 

  • If a library name is not specified a default library name called *FIRST is used. This indicates that the library list of the job in which the function is being compiled should be searched (in order) to locate the required file. If the file cannot be found using this method then the first definition of the file that can be found in the LANSA dictionary should be used. In such cases a warning message will be issued.

Portability Considerations

Code generation varies for RDML functions and RDMLX code, and may cause a difference in which library is used where there are multiple files of the same name. RDML function generation on IBM i matches up File references to Libraries using the Library List of the job that is compiling the object. If not found in the library list, the first File in the repository found in EBCDIC collation sequence order will be used. RDMLX objects are generated on Windows, which does not have a Library List, and so the first file in the repository found in ANSI collation sequence order will be used.

 

Ý 13.1.1 I/O Commands