Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Need to set Return Code upon "EOF on stdin" - response (1) by SuSeSi

$
0
0

This looks to me a shell scripting error. When you provide a bunch of statements through shell like this, make sure that the input bunch is properly read and submitted to bteq by your shell script.
When you say, 

bteq << -EOF > blabla

your shell will scan the script till "-EOF" word and feed it to bteq. But if shell cannot determine what it has to provide, then it send no data, resulting bteq terminating with no error. BTEQ's behaviour is correct as it has nothing to execute.
Try the following in your script.

bteq << [EOF] > ${LogDir}/${Bteq_Log}
.SET SESSIONS 1;
.SET WIDTH 254;
.SET ERROROUT STDOUT;
.SET ERRORLEVEL (0, 2641) SEVERITY 0;
.SET ECHOREQ ON;
.SET RETCANCEL ON;
.SET RETLIMIT 20;
.run file=${MAIN_DIR}/logon_BTEQ_EIS.txt;
.IF ERRORCODE != 0 THEN .quit ERRORCODE;
...
.QUIT 0
[EOF]

Note that "[EOF]" is matched. Also, there is a newline after last "[EOF]".
Please post it to shell scripting forums if still getting the error. This is not a problem with bteq.
 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>