Archives of the TeradataForum
Message Posted: Tue, 29 Jan 2003 @ 01:41:58 GMT
Subj: | | Re: How to pass external arguements to mload script |
|
From: | | Dwight Etheridge |
If you put your mload commands instream in perl with a heredoc piping mechanism, you can do all the symbolic substitutions you want. The
following chunk of code can be wrapped in a loop to process many, many files via sequential invokations of mload. All the $vars here are
simple perl variables.
open(ipipe, "| mload ");
print ipipe <
.logon dbc,xyz
.logtable $opt_d$lt;
.begin mload tables $opt_d
worktables $opt_d$wt errortables $opt_d$et $opt_d$uv
checkpoint 5000000 errlimit 1 ;
.layout CPTDLAY indicators;
.table $opt_d;
.dml label CPTDML;
insert into $opt_d.* ;
.import infile $opt_t/$opt_s.exp format fastload layout CPTDLAY apply
CPTDML;
.end mload;
.logoff;
EOM
close ipipe;
--
Dwight Etheridge
Teradata Certified Master
|