IBM Books

Building Applications for UNIX** Environments


Setting Up and Running REXX Programs

You do not precompile or bind REXX programs.

To run DB2 REXX/SQL programs on AIX, you must set the LIBPATH environment variable to include sqllib/lib under the DB2 install directory.

If LIBPATH has not been set yet, enter:

export LIBPATH=/lib:/usr/lib:/usr/lpp/db2_05_00/sqllib/lib

If LIBPATH has been set already, enter:

export LIBPATH=$LIBPATH:/usr/lpp/db2_05_00/sqllib/lib

On AIX, your application file can have any file extension. You can run your application using either of the following two methods:

  1. At the shell command prompt, enter rexx name where name is the name of your REXX program.

  2. 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 entering its name at the shell command prompt. For example, if the REXX/6000 interpreter file is in the /usr/bin directory, include the following as the very first line of your REXX program:
    #! /usr/bin/rexx
    

    Then, make the program executable by entering the following command at the shell command prompt:

    chmod +xname

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

REXX sample programs are in the directory sqllib/samples/rexx. To run the sample REXX program updat.cmd, do one of the following:

For further information on REXX and DB2, refer to the Embedded SQL Programming Guide, chapter 13, "Programming in REXX".


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]