Encountered EOF on RUN file. Returning to stdin.

Tools & Utilities
Fan

Encountered EOF on RUN file. Returning to stdin.

Hi All,

 

I have a bteq file that runs other bteq files and then each of these runs yet another bteq files.

the setup in a nutshell looks like this:

 

initial.bteq:

.logon blabla

...

.RUN FILE 'file_1.bteq';

.RUN FILE 'file_2.bteq';

...

..RUN FILE 'file_n.bteq';

 

file_1.bteq:

.EXPORT DATA FILE = c:\data.txt;
.SET RECORDMODE OFF;
.SET SEPARATOR ',';

<some sql stataments>;

.EXPORT RESET

.OS cmd /c call powershell.exe -ExecutionPolicy remotesigned -file <path_to_PS_script> <c:\data.txt>

.RUN FILE = <.bteq file created in the PS script>;

<more select statements>

 

the ps script takes the export file, and does some manipulation to the data and creates some sql statments then stores them in a new bteq file which is to be run from file_1.bteq

The issue that I have is that when I run this setup. I get: 

 *** Encountered EOF on RUN file. Returning to stdin.

and the rest of the select statments after calling .RUN FILE = <.bteq file created in the PS script>; are being skipped

 

Any idea what am i missing here?


Accepted Solutions
Teradata Employee

Re: Encountered EOF on RUN file. Returning to stdin.

This is the documented behavior of the BTEQ .RUN command: (quote from manual, emphasis added)

 

If specifying a RUN command within a run file, BTEQ switches and begins reading from the new file; BTEQ does not return to the previous file.

Files executed with a RUN command can be chained, but not nested.

1 ACCEPTED SOLUTION
2 REPLIES
Teradata Employee

Re: Encountered EOF on RUN file. Returning to stdin.

This is the documented behavior of the BTEQ .RUN command: (quote from manual, emphasis added)

 

If specifying a RUN command within a run file, BTEQ switches and begins reading from the new file; BTEQ does not return to the previous file.

Files executed with a RUN command can be chained, but not nested.

Highlighted
Fan

Re: Encountered EOF on RUN file. Returning to stdin.

Thank you Fred for your answer.

I think I'll just have to call the other bteq file from within PS in as a seperate session.