Before you can actually get to the point of sending command strings to the database engine and getting back data, there are some things that you have to do once.

First, you need to load the RXODBC.DLL add-on as so:

LIBRARY rxodbc

Next, you should set the OdbcErr and OdbcHeading variables for how you would like error handling. Here we set them so that ODBC functions raise an ERROR condition when they fail, and the name of the ODBC function that failed is prepended to the error message.

OdbcErr = "ERROR"
OdbcHeading = 1
Finally, you need to call OdbcAllocEnv to initialize the ODBC Manager. Because we've set the ODBC functions to raise ERROR, then we can CATCH it for any failure:
DO

  OdbcAllocEnv()

   /* If OdbcAllocEnv fails, we do the following. */
   CATCH ERROR

      /* Display an error message box, and end the script. */
      CONDITION("M")
      RETURN
END
It is best to put the above at the start of your script, since this needs to be done once only. Any child scripts you call will not need to duplicate the above initialization. So, you need do the above only at the start of your main script (and your child scripts will be able to call ODBC functions too).