Building and running embedded SQL applications written in REXX

REXX applications are not precompiled, compiled, or linked. You can build and run REXX applications on Windows operating systems, and on the AIX® operating system.

About this task

On Windows operating systems, your application file must have a .CMD extension. After creation, you can run your application directly from the operating system command prompt. On AIX, your application file can have any extension.

Procedure

To build and run your REXX applications:

  • On Windows operating systems, your application file can have any name. After creation, you can run your application from the operating system command prompt by invoking the REXX interpreter as follows:
       REXX file_name
  • On AIX, you can run your application using either of the following two methods:
    • At the shell command prompt, type rexx name where name is the name of your REXX program.
    • If the first line of your REXX program contains a "magic number" (#!) and identifies the directory where the REXX/6000 interpreter resides, you can run your REXX program by typing its name at the shell command prompt. For example, if the REXX/6000 interpreter file is in the /usr/bin directory, include the following line as the very first line of your REXX program:
         #! /usr/bin/rexx 
      Then, make the program executable by typing the following command at the shell command prompt:
         chmod +x name 

      Run your REXX program by typing its file name at the shell command prompt.

    Note: On AIX, you should set the LIBPATH environment variable to include the directory where the REXX SQL library, db2rexx is located. For example:
       export LIBPATH=/lib:/usr/lib:/$DB2PATH/lib