How to call TPT scripts from Shell Scripts

Tools
Teradata Employee

How to call TPT scripts from Shell Scripts

Hello,

I have created TPT scripts and they run fine on the prompt with tbuild -d
Tags (2)
8 REPLIES
Teradata Employee

Re: How to call TPT scripts from Shell Scripts

I am not sure what the -d option is, or why you would want to use it, but the tbuild command takes the script file as an input argument using the -f command line option.

Therefore, in a shell script, just specify "tbuild -f " in a shell script.

You cannot inline the contents of the TPT script in a shell script (it worked well for FastLoad and MultiLoad because their script input came from stdin).
-- SteveF
Teradata Employee

Re: How to call TPT scripts from Shell Scripts

You can do it in two steps:

cat - << EOF >script_file
..code
..code
EOF

tload -f script_file

Re: How to call TPT scripts from Shell Scripts

Hi SteveF,

i am also facing the same issue with tbuid.

when i run the files directly from command line using the comma "tbuild -f mytptscript.tpt " . the tpt script  executes successfully which means the TD utilities is installed on the system.

    but when i use the same command in a shell script it gives me the following error.

    ERROR :tbuildexe.exe can not be found.

Any suggestion please.

--shirdil

Teradata Employee

Re: How to call TPT scripts from Shell Scripts

When you say "in a shell script" do you really mean "in a shell script run via cron"?

Enthusiast

Re: How to call TPT scripts from Shell Scripts

Set tbuild directory path in .bash_profile or use fully qualified path in the shell script

e.g

/opt/teradata/client/15.10/bin/tbuild

Thanks!

Re: How to call TPT scripts from Shell Scripts

Fred ,

when i say shell script i mean a window shell script like "myScript.ps1" that is run i windows cmd like "powershell "&" .\myScript.ps1" .  

@TDThrottle can you please help how can i set  the .bash_profile path. I have tried using fully qualified path but it is not working.

Thanks!

Teradata Employee

Re: How to call TPT scripts from Shell Scripts

On Windows, it would be the PATH environment variable in the registry, not .bash_profile. How are you launching PowerShell and what environment is it inheriting?

PATH should include C:\Program Files\Teradata\client\nn.nn\Teradata Parallel Transporter\bin64 if you are running 64-bit PowerShell;

for 32-bit TPT on 64-bit Windows you would need C:\Program Files (x86)\Teradata\client\nn.nn\Teradata Parallel Transporter\bin

where nn.nn is the version of TTU you have installed.

Teradata Employee

Re: How to call TPT scripts from Shell Scripts

If you are running 15.10 on Windows, you do NOT want to put:

C:\Program Files\Teradata\client\nn.nn\Teradata Parallel Transporter\bin64

in your PATH.

In 15.10, the binaries are located in:

C:\Program Files\Teradata\client\15.10\bin

For 32-bit you would want to access the binaries through:

C:\Program Files (x86)\Teradata\client\15.10\bin

-- SteveF