All Forums Tools
Qaisar Kiani 337 posts Joined 11/05
26 Oct 2008
setting BTEQ Import attribute dynamically

I am having a situation where I have to load some data from a txt file via BTEQ, but the problem is that the file file location and name is dynamic and is always available in a table.I just want to know that is it possible to have some sort of select statement in .IMPORTI think this could be a very generic issue and somebody out there would have faced the same problem. So any suggestions that could help me.Regards.

joedsilva 505 posts Joined 07/05
26 Oct 2008

If you are doing it from Unix/Linux, you can do it in two stages.first bteq to get the filename and path from the control tablebteq <<-END.login.......set ....... (turn of title dashess etc ..).export file=filename.txt;SELECT TRIM(FILENAME) (TITLE '') FROM CTLTBL;.quit;ENDFILENAME=$(cat filename.txt)This bteq can import file ...bteq <<-END.import file = ${FILENAME} END

Qaisar Kiani 337 posts Joined 11/05
26 Oct 2008

Thanks for the reply.But we are using windows.

Fred 1096 posts Joined 08/04
27 Oct 2008

EXPORT a ".IMPORT" statement to a temp file and .RUN that, e.g..set format off.export report file=importcmd.txtSELECT '.IMPORT DATA FILE='||FILENAME (TITLE '') FROM CTLTBL;.export reset.run file=importcmd.txt

You must sign in to leave a comment.