An Bteq Error Code return issue.Need Help

Database
gkk
N/A

An Bteq Error Code return issue.Need Help

Hai friends,

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.

Regards,
gkk
Tags (1)
2 REPLIES
N/A

Re: An Bteq Error Code return issue.Need Help

It is in an environment variable called errorlevel.
See:

http://stackoverflow.com/questions/334879/how-do-i-get-the-application-exit-code-from-a-windows-command-line
gkk
N/A

Re: An Bteq Error Code return issue.Need Help

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:

if errorlevel

see if /? for details.

For Example

@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.

Please Help me .

Regards,
gkk