Converting an S/36 DIRECT file into a LANSA file

Date: Archived
Product/Release: LANSA for the AS/400
Abstract: It is possible to convert an S/36 DIRECT file into a LANSA file?
Submitted By: LANSA Technical Support

To convert an S/36 DIRECT file into a LANSA file follow the steps below:

  1. Use LANSA to create a file and specify it as being maintained by "OTHER".
  2. Select the option to review the created file.
  3. Select the option to load the definition of a file not maintained by LANSA.
  4. Since an S/36 direct file is usually one "field" per record, it is necessary to create several virtual fields to separate it. To do this, select the option to review or change a virtual field, to separate the record. It is, of course, necessary to create new fields in the LANSA repository.
  5. Select to review/change extended definition. Execute the "substring the virtual" action. Remember the option to derive "virtual" file on input from file and setup "real" field before output to file must be "YES".

Remember that it is restricted to a field size of 256 characters. To work with a field size greater than this to map records into virtual fields than look at using the virtual RPG code : VC_USING. This allows the specification of how virtual fields are derived from real fields and vice versa, achieved by entering RPG/400 program code.

Refer to the LANSA Technical Guide for more information on virtual code where there are detailed examples of virtual code uses.