Hope your are doing good . i got a issue raised in project reqarding the bteq script . Our environment is teradata on windows platform . i want to capture the bteq script final return error code which is executed from windows command prompt . i came to know from forums how it can be accomplished with the scripts written with in unix script by evaluating the return values by $? . Is there any Inbuilt Environment variables for Bteq to store the return code as we do have in MLOAD (&sysrec).
we execute the bteq scripts very similar as we do in our home and institute lab like .
C:\Documents and Settings\kiran\teradata_bteq_scripts>bteq sample_bteq_script_log.txt
this line is pasted in BODI(an ETL tool) which we will use it for invoking the scripts and as schedular too.
please kindly tell is there any way to capture the return codes of the betq script in Windows Command Prompt.
if it can be captured in BODI at least . please let me know as early as possible . looking forward for your reply.
The information in the link provided is pasted below...
The results are stored in a pseudo environment variable named errorlevel so...
echo Exit Code is %errorlevel%
and a special syntax of the if command:
see if /? for details.
@echo off my_nify_exe.exe if errorlevel 1 ( echo Failure Reason Given is %errorlevel% exit /b %errorlevel% ) Warning: if you set an environment variable name errorlevel, %errorlevel% will return that value and not the exit code. Use (set errorlevel=) to clear the environment variable. ---------
how to implement the above logic to capture the bteq error codes in to the cmd variables.