In scenarios where environment variables need to be used as part of the BTEQ script, a Here document, which can be used to specify a string literal in a command-line shell, is a possible option.
The following example outlines a UNIX script as a Here document.
#!/bin/sh ######################################### export DATADIR=/datasvc/data bteq <<EOI .LOGON mydbs/myid,mypw; .EXPORT REPORT FILE=$DATADIR/output SELECT * from table_name; .EXPORT RESET .LOGOFF .EXIT EOI #########################################