Page 1 of 1

Help...Help....please organize the code and ExecDOS syntax

Posted: Mon Mar 21, 2005 1:51 pm
by vans2003
Can someone please look at the following code and correct it..I wrote all differtent
pieces..and need syntax to call ExecDOS routine....

my problem here is to drop indexes before loading data into a teradat table using
Multiload Plugin..


--------Teradata Drop Index Macro-----------
REPLACE MACRO si_di_buyers AS (
DROP UNIQUE INDEX CI_BUYERS_U01 (
CLM_NBR
, SOURCE_ID
)
, INDEX CI_buyers_I01 (
CLM_NBR
)
ON EDW_Tables.buyers ;


--------------DropIndex.txt------------------
.logon Servername/username,password;

database EDW_Tables;

EXEC si_di_buyers;

.logoff
---------------------------------------------

--before/After subroutine------Input Values--

ExecDOS : buyers.bat ???????????
---------------------------------------------


buyers.bat
----------------------------not sure this-----
C:\PROGRA~1\NCR\TERADA~1\bin\BTEQ.exe < c:\DS7.5\DropIndex.txt

Posted: Mon Mar 21, 2005 2:46 pm
by chulett
If you are doing this before/after job via the ExecDOS subroutine (equivalent to ExecSH on a UNIX server, I guess) all you need is exactly the same thing you'd need if you ran it from the command line.

Since your 'buyers.bat' file doesn't seem to need any parameters, all you'd put in the Input Value box would be the full path to the batch file.

-or-

If your batch file really is just one line, put that line there. No batch file needed in that case.

Can't help you on the BTEQ syntax. :?

Posted: Tue Mar 22, 2005 1:46 am
by roy
Hi,
open DS manager go to Routines>Built-In>Before/After.
on the right side you'll see the ExecDos routine go over the code and you'll know how to use it.


IHTH,

Posted: Tue Mar 22, 2005 2:00 pm
by vans2003
When I execute the following from command prompt it's working..fine

--------------dropindex.bat-----------------
C:\PROGRA~1\NCR\TERADA~1\bin\BTEQ.exe < c:\DS7.5\DropIndex.txt
--------------------
I tied the following it's giving error...

ExecDOS : C:\PROGRA~1\NCR\TERADA~1\bin\BTEQ.exe < c:\DS7.5\DropIndex.txt

and

ExecDOS : dropindex.bat C:\DS7.5

Need some Syntax help.... any help would be appreciated....

Thanks,
Vans

Posted: Tue Mar 22, 2005 2:24 pm
by Sainath.Srinivasan
Set that dir part of your PATH