Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Thu, 11 Aug 2016 @ 11:53:02 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Suffix date timestamp in exported file
 
From:   Choudhury, Surjit

Hi All,

I need a quick solution of suffix date timestamp in exported file in Windows OS, could it be possible with Bteq script below?

Will be appreciated of your prompt response!!


Thanks,

-Surajit


====

     .OS run_date=%date% %time%

     .RUN FILE=@TD_LOGON@;

     .set width 65531
     .set errorout stdout
     .set RETLIMIT = 2147483647,*;

     SEL CURRENT_TIMESTAMP;
     .IF ERRORCODE <> 0 THEN .QUIT ERRORCODE;

     /* .OS DEL C:\Test_BTQ\ESRA_BrandHrchy_%run_date%.txt */

     .EXPORT FILE = C:\Test_BTQ\ESRA_BrandHrchy_%run_date%.txt

     .SET FORMAT OFF;

     SELECT
     '"CUEAN"'||','||
     -- '"TUEAN"'||','||
     '"ProductBrand"'||','||
     '"ProductBrandCategory"'||','||
     '"ProductBrandMarket"'||','||
     '"ProductBrandSubsector"'||','||
     '"ProductCorporateProductGroup"'||','||
     '"ProductFormBrand"'||','||
     '"ProductDivision"'||','||
     '"ProductSubdivision1"'||','||
     '"ProductSubdivision2"'||','||
     '"ProductCategory"'||','||
     '"ProductMarket"'||','||
     '"ProductSector"'||','||
     '"ProductSubsector"'||','||
     '"ProductSegment"'||','||
     '"ProductForm"'||','||
     '"ProductSubform"'||','||
     '"ProductSizePackFormSizePack"'( TITLE '' ) ;

     SELECT
     '"' || CUEAN ||'"'||','||
     -- '"' || TUEAN ||'"'||','||
     '"' || ProductBrand ||'"'||','||
     '"' || ProductBrandCategory ||'"'||','||
     '"' || ProductBrandMarket ||'"'||','||
     '"' || ProductBrandSubsector ||'"'||','||
     '"' || ProductCorporateProductGroup ||'"'||','||
     '"' || ProductFormBrand ||'"'||','||
     '"' || ProductDivision ||'"'||','||
     '"' || ProductSubdivision1 ||'"'||','||
     '"' || ProductSubdivision2 ||'"'||','||
     '"' || ProductCategory ||'"'||','||
     '"' || ProductMarket ||'"'||','||
     '"' || ProductSector ||'"'||','||
     '"' || ProductSubsector ||'"'||','||
     '"' || ProductSegment ||'"'||','||
     '"' || ProductForm ||'"'||','||
     '"' || ProductSubform ||'"'||','||
     '"' || ProductSizePackFormSizePack ||'"' ( TITLE '' )

     FROM EDW_V_MT_SEMANTIC.ESRA_PROD_HIER_BKP_TST
     ;


     SELECT '"EOF"'( TITLE '' )
     ;

     .EXPORT RESET

     SEL CURRENT_TIMESTAMP;
     .IF ERRORCODE <> 0 THEN .QUIT ERRORCODE;

     .LOGOFF;

     .QUIT;


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 24 Jul 2020