Creating Symbolic Links

Sequential, Index Sequential, Random, or External Sequential work files must have symbolic links between a location in the IFS and the member in a physical file that actually contains the data needed by the program that uses the work file.

For output files, the work file routines in the runtime system automatically create the symbolic links. For input files, you use the CRTWRKLNK command to create symbolic links for all of the work files listed in the LAWRKLNK/LINKS member (default library is the Lawson xxxPGM library). If you change the file name and path (as you are allowed to do, for example, with IC500 and RQ500), you must create symbolic links manually. Use the following procedure to create such links.

To create a symbolic link

  1. Determine the location of the IFS where the symbolic link will be.
    1. In a Lawson Interface Desktop session, use Form Transfer (F8).
    2. In the Form ID field on the Form Transfer form, type workdef and click the OK button or press Enter.
    3. On the Work File Definition form, type in the product line name, system code, and program code, and then press Select (F4). This lists all of the work files associated with the program.
    4. Select the work file whose symbolic link you need to set up. The work file will be of the Sequential, Index Sequential, Random, or External Sequential type.
    5. Note the value for the Value/WsFld Id field. If Value Id is marked, the value of the field indicates the IFS location as follows:

      /EnvironmentDirectory/law/DataArea/work/ValueId/ ValueId

      If the WsFld Id is marked, the value of the field will indicate the field that the program stores the path and filename in. Often this means that you supply the file name as a parameter. See the documentation for the application program for more information. For example, for the IC500 program if you supply the value IC500LOAD as the file name, you will need a symbolic link in the IFS at the following location:

      /EnvironmentDirectory/law/DataArea/hht/IC500LOAD

  2. Determine the name of the member where the input data is stored.
    1. In a Lawson Interface Desktop session, use Form Transfer (F8).
    2. In the Form ID field on the Form Transfer form, type workdef and click the OK button or press Enter.
    3. On the Work File Definition form, type in the product line name, system code, and program code, and then press Select (F4). This lists all of the work files associated with the program.
    4. Select the work file whose symbolic link you need to set up. The work file will be of the Sequential, Index Sequential, Random, or External Sequential type.
    5. Note the name of the work file in the File Name field.
    6. If you installed Lawson Core Technology on an IASP, at the IBM i command prompt, type

      SETASPGRP IASPName

    7. Set the Environment variables (CALL LAWENV).
    8. At the IBM i command line, type WRKOBJPDM and press Prompt (F4).
    9. Enter the following values and press Enter:
      Field Description
      Library The library where the physical files for work file data members are stored.
      Object Type the program code followed by an asterisk--for example, IC500*.
      Object Type *FILE
      Object Attribute *ALL
    10. In the list of files, look for a file whose descriptive text contains the same work file name as you noted above in the Work File Definition utility (workdef).
    11. For this file, use option 12 (Work with) to see the file’s member. Note the name of the member.
  3. Set the symbolic link. At the IBM i command line, type

    ADDLINK OBJ(’/qsys.lib/LAWPGMName.lib/PhysicalFile.file/Member.mbr’) NEWLINK(’/EnvironmentDirectory/law/DataArea/work/WorkFileDir/WorkFileName') LNKTYPE(*SYMBOLIC)

    where you replace any library,directory, file, and member names with the appropriate names from your system.

    For example:

    ADDLINK OBJ(’/qsys.lib/LAW9PGM.lib/OE510WFW.file/OE510WFW.mbr’) NEWLINK(’/law9/law/lawapp9/work/SALESORDERS/SALESORDERS’) LNKTYPE(*SYMBOLIC)