OpenFrame PL/I Verification

This chapter describes how to compile the sample PL/I file after installing OpenFrame PL/I.

1. Compilation

The following describes how to use the ofpli command to compile the sample PLI file after installing OpenFrame PL/I.

  1. Find the sample file in the following location.

    ${OFPLI_HOME}/temp
  2. Execute the ofpli command and compile sample.pli file. For information about the command, refer to Compilation Command.

    ofpli -o sample.so sample.pli
  3. If the following .so file is created after the compilation, then OpenFrame PL/I has been installed successfully. If a compilation error occurs, check the error. For error descriptions, refer to Compilation Error Messages.

    sample.so

2. Compilation Command

The following describes how to use the ofpli compilation command.

  • Usage

    ofpli source files ... [command options...]
    • Source files

      Files to compile.

    • Basic compile command options

      Option Description

      -o file name

      Sets an output file.

      -I <dir>

      Sets an INCLUDE directory.

      -MI <dir>

      Sets an INCLUDE directory to be used by the %INCLUDE statement.

      -SI <dir>

      Sets an INCLUDE directory to be used by the EXEC SQL INCLUDE.

      -l <library>

      Connects to a shared library.

      -L <dir>

      Sets a library path.

      -O0, -O1, -O2, -O3

      Sets an optimization level. The lower the number, the faster the compilation but the compiled file may run slowly because it will be less optimized.

      -U

      Enables the dynamic load function.

      -dli

      Adds the DLITPLI interface. (IMS exclusive)

      -change old:new

      Changes an external entry name from "old" to "new".

      -g

      Specifies that compilation results contains debug information to use for source-level debugging.

      -fixeddec31

      Sets the maximum precision for FIXED DECIMAL to 31.

      -trace

      Displays trace information about the start and end, parameters, and return values of a procedure.

      -trace-flow

      Displays trace information at the beginning and end of a procedure.

      -trace-param

      Displays trace information about parameters.

      -trace-return

      Displays trace information about return values.

      -rule-margin-w

      Displays an error message when a non-blank character is detected that is not part of the source code.

      -rule-margin-s

      Displays an error message when a non-blank character is detected that is not part of the source code.

      -system mvs, cics, ims

      Sets a runtime environment to run a PL/I program. (Default: mvs)

      -h

      Displays help.

      -help-esql

      Displays help for ESQL preprocessor.

      --version

      Displays the current version information of OpenFrame PL/I.

      -license

      Displays license information for OpenFrame PL/I.

      -enable-esql

      Enables ESQL preprocessor.

      -tibero

      Executes ESQL preprocessor on Tibero. Must be used in conjunction with the -enable-esql option.

      -oracle

      Executes ESQL preprocessor on Oracle. Must be used in conjunction with the -enable-esql option.

      -enable-cics

      Enables CICS preprocessor.

      -enable-ofasm

      Enables ASM calls via OpenFrame ASM.

      -enable-scan-sjis

      Enables Shift-JIS recognition. Cannot be used in conjunction with the -enable-scan-extascii option.

      -enable-scan-extascii

      Enables Extended-ASCII recognition. Cannot be used in conjunction with the -enable-scan-sjis option.

      -disable-inc-limit

      Disables file length limit in an %INCLUDE statement.

      --save-temps

      Saves the temporary files created during compilation.

      The following are the temporary files created by using the command option:

      • .mp: macro preprocessing result file created when SQL or CICS preprocessor is enabled

      • .pp: preprocessing result file

      • .bc: compilation result file

      • .o: assembly result file

    • ESQL preprocessing command options

      Option Description

      -close-on-commit

      Automatically closes the cursor after a commit.

      -end-of-fetch (1403 | 100)

      Sets a SQLCODE to return to the user at an END-OF-FETCH state after executing a SQL statement. (Default value: 1403)

      -insert-no-data-error

      "no data found" error occurs for INSERT and SELECT statements.

      -prefetch N

      Prefetches N number of rows when a cursor is opened.

      -no-select-error

      An error occurs when the actual query returns more rows than given by the preprocessor due to causes like host variable.

      -unsafe-null

      Allows a NULL value when indicator variable is missing.

3. Compilation Error Messages

OpenFrame PL/I outputs error messages when an error occurs during compilation.

The following is a sample error format:

SAMPLE.pli 6:11: OFPLI1009 [S] Syntax error.

[File name]: SAMPLE.pli
[Position of code]: 6:11
[Error number]: OFPLI1009
[Error type]: [S]
[Error message]: Syntax error.
Item Description

File name

Name of the file where the error occurred.

Position of code

Line and column numbers where the error originated from.

Error number

Error number.

Error type

  • [I] (Information): useful information under normal compilation circumstances.

  • [W] (Warning): errors that do not affect program execution but may cause undesired results. Compilation executes normally.

  • [E] (Error): general error that may cause compilation to fail or cause issues during program execution.

  • [S] (Severe): fatal error that causes compilation to fail.

Error message

Error description.