Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 26 Feb 2010 @ 16:18:42 GMT


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


Subj:   Re: How to pass database name as parameter
 
From:   Howard Bradley

  Please help me to understand how to pass database name as parameter to either BTEQ or MLOAD.  


We run MLOAD's from an MVS environment. Our loads are coded along the lines detailed below. We pass the database names (and sometimes table names) in from a parameter file, declared within the JCL of the job. The default database of the logon is used for the log table, all other databases are defined in the parameter file.

The parameter file content would look something like this:

     'PRODVMUPD' 'PRODPERMDB'

The multiload would look something like this (hope the EMAIL formatting come out OK).

     .LOGTABLE LT_REASON_TYPE_CODE;
     .ACCEPT TARGETDB,WORKDB FROM FILE DBFILE1;

      DROP TABLE &WORKDB..ET_REASON_TYPE_CODE;  DROP TABLE &WORKDB..UV_REASON_TYPE_CODE;

      DELETE &TARGETDB..REASON_TYPE_CODE;

      .BEGIN MLOAD
         TABLES
           &TARGETDB..REASON_TYPE_CODE
         WORKTABLES
           &WORKDB..WT_REASON_TYPE_CODE
         ERRORTABLES
           &WORKDB..ET_REASON_TYPE_CODE
           &WORKDB..UV_REASON_TYPE_CODE
           ;

     .LAYOUT T_REAS_TYP;
     .FIELD REASON_TYPE_CODE                * SMALLINT;
     .FIELD REASON_TYPE_DESC                * CHAR(30);

     .DML LABEL LOADTAB;
        INSERT INTO &TARGETDB..REASON_TYPE_CODE
            (
              REASON_TYPE_CODE
             ,REASON_TYPE_DESC
            )

        VALUES
           (
             :REASON_TYPE_CODE
            ,:REASON_TYPE_DESC
           );

     .IMPORT INFILE FILIN1
       LAYOUT T_REAS_TYP
       APPLY LOADTAB
       ;
     .END MLOAD;
     .LOGOFF;
     .QUIT ERRORCODE;


     
  <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: 15 Jun 2023