Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Tue, 14 Aug 2012 @ 13:29:10 GMT

  <Prev Next>  
Next> Last>>  

From:   Anomy Anom

<-- Anonymously Posted: Tuesday, August 14, 2012 04:00 -->

Dear All,

I want to export files .csv using ?bteq, with naming the file filename_date.csv

The date will be selected from a table, I checked on the web and I found that I have to create two bteq scripts like below:

The bteq couldn't open and catch the variable from mydate.ksh

So the file name is ${mydatex} which is wrong

First bteq

     .logon ${LOGON};
     .export report file='mydate.ksh'
     select 'export mydatex=FNAME_'||CAST(DATE AS DATE FORMAT 'YYYYMMDD')||'.CSV'? (title '')
     FROM TABLE; .export reset .exit

Second bteq

I created another bteq :

     .LOGON ${LOGON};
     .OS rm -f ${mydatex};
     .export? file = ${mydatex};

     CALL proc(1,2,3);
     .export reset;

Thank you for helping

  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023