Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 09 Feb 2001 @ 14:25:27 GMT


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


Subj:   Re: Predefined System Variables with V2R4.01
 
From:   David Wellman

Sharon,

I've used the variables that you mentioned on a few occasions and they always seem to work fine.

In the cases where I used them, I typically exported them using the "DISPLAY xxxx TO FILE xxx" command and then loaded this data using Bteq. I have successfully issued insert/update commands using these variables within the Multiload script itself, but I couldn't find anything in the Multiload documentation about doing this within the script, so I took the safe route.

The (partial) DISPLAY commands that I used were;

DISPLAY '1 ET &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSETCNT1' TO FILE JOBSTATS;
DISPLAY '1 UV &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSUVCNT1' TO FILE JOBSTATS;
DISPLAY '1 DEL &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSDELCNT1' TO FILE JOBSTATS;
DISPLAY '1 INS &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSINSCNT1' TO FILE JOBSTATS;
DISPLAY '1 UPD &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSUPDCNT1' TO FILE JOBSTATS;

.IF &NUMTABS >= 2 THEN;
.DISPLAY '2 ET &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSETCNT2' TO FILE JOBSTATS;
.DISPLAY '2 UV &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSUVCNT2' TO FILE JOBSTATS;
.DISPLAY '2 DEL &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSDELCNT2' TO FILE JOBSTATS;
.DISPLAY '2 INS &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSINSCNT2' TO FILE JOBSTATS;
.DISPLAY '2 UPD &SCRIPT &PROCNAME &RUNNBR &RUNDATE &SYSUPDCNT2' TO FILE JOBSTATS;
.ENDIF;

The non-standard variables (&NUMTABS, &SCRIPT etc) are all set or read in (using .ACCEPT) earlier on in the Multiload script.

The &NUMTABS variable was used so that I could simply have a standard piece of code (executed using a .RUN FILE command) to handle any Multiload script. It catered for 1-5 tables.

One thing to watch for when using the DISPLAY command to generate data to be read in by Bteq. Because it gets difficult to load variable format records using Bteq, ensure that every record written out by these commands is the same format. All columns neatly lined up etc. In the cases that I've used them, that also means ensuring that when setting the variable values (&SCRIPT for example) you need to pad short values with blanks.

If you want any more info drop me a line.


Cheers,

Dave


P.S. I don't think these variables are related to a specific release of Teradata. They're Multiload variables, were introduced with Mload 6 - or earlier - and can be used against most versions of the Teradata rdbms.



     
  <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: 27 Dec 2016