Teradata MultiLoad Reference - Teradata Downloads · Teradata MultiLoad Reference 3 Preface Purpose...

of 258 /258
Teradata MultiLoad Reference Release 13.10 B035-2409-020A February 2010

Embed Size (px)

Transcript of Teradata MultiLoad Reference - Teradata Downloads · Teradata MultiLoad Reference 3 Preface Purpose...

  • Teradata MultiLoadReference

    Release 13.10B035-2409-020A

    February 2010

  • The product or products described in this book are licensed products of Teradata Corporation or its affiliates.

    Teradata, BYNET, DBC/1012, DecisionCast, DecisionFlow, DecisionPoint, Eye logo design, InfoWise, Meta Warehouse, MyCommerce, SeeChain, SeeCommerce, SeeRisk, Teradata Decision Experts, Teradata Source Experts, WebAnalyst, and Youve Never Seen Your Business Like This Before are trademarks or registered trademarks of Teradata Corporation or its affiliates.

    Adaptec and SCSISelect are trademarks or registered trademarks of Adaptec, Inc.

    AMD Opteron and Opteron are trademarks of Advanced Micro Devices, Inc.

    BakBone and NetVault are trademarks or registered trademarks of BakBone Software, Inc.

    EMC, PowerPath, SRDF, and Symmetrix are registered trademarks of EMC Corporation.

    GoldenGate is a trademark of GoldenGate Software, Inc.

    Hewlett-Packard and HP are registered trademarks of Hewlett-Packard Company.

    Intel, Pentium, and XEON are registered trademarks of Intel Corporation.

    IBM, CICS, RACF, Tivoli, and z/OS are registered trademarks of International Business Machines Corporation.

    Linux is a registered trademark of Linus Torvalds.

    LSI and Engenio are registered trademarks of LSI Corporation.

    Microsoft, Active Directory, Windows, Windows NT, and Windows Server are registered trademarks of Microsoft Corporation in the United States and other countries.

    Novell and SUSE are registered trademarks of Novell, Inc., in the United States and other countries.

    QLogic and SANbox are trademarks or registered trademarks of QLogic Corporation.

    SAS and SAS/C are trademarks or registered trademarks of SAS Institute Inc.

    SPARC is a registered trademark of SPARC International, Inc.

    Sun Microsystems, Solaris, Sun, and Sun Java are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries.

    Symantec, NetBackup, and VERITAS are trademarks or registered trademarks of Symantec Corporation or its affiliates in the United States and other countries.

    Unicode is a collective membership mark and a service mark of Unicode, Inc.

    UNIX is a registered trademark of The Open Group in the United States and other countries.

    Other product and company names mentioned herein may be the trademarks of their respective owners.

    THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN AS-IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THE ABOVE EXCLUSION MAY NOT APPLY TO YOU. IN NO EVENT WILL TERADATA CORPORATION BE LIABLE FOR ANY INDIRECT, DIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS OR LOST SAVINGS, EVEN IF EXPRESSLY ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    The information contained in this document may contain references or cross-references to features, functions, products, or services that are not announced or available in your country. Such references do not imply that Teradata Corporation intends to announce such features, functions, products, or services in your country. Please consult your local Teradata Corporation representative for those features, functions, products, or services available in your country.

    Information contained in this document may contain technical inaccuracies or typographical errors. Information may be changed or updated without notice. Teradata Corporation may also make improvements or changes in the products or services described in this information at any time without notice.

    To maintain the quality of our products and services, we would like your comments on the accuracy, clarity, organization, and value of this document. Please e-mail: [email protected]

    Any comments or materials (collectively referred to as Feedback) sent to Teradata Corporation will be deemed non-confidential. Teradata Corporation will have no obligation of any kind with respect to Feedback and will be free to use, reproduce, disclose, exhibit, display, transform, create derivative works of, and distribute the Feedback and derivative works thereof without limitation on a royalty-free basis. Further, Teradata Corporation will be free to use any ideas, concepts, know-how, or techniques contained in such Feedback for any purpose whatsoever, including developing, manufacturing, or marketing products or services incorporating Feedback.

    Copyright 1996-2010 by Teradata Corporation. All Rights Reserved.

    mailto:[email protected]

  • Preface

    Purpose

    This book provides information about Teradata MultiLoad, which is a Teradata Tools and Utilities product. Teradata Tools and Utilities is a group of products designed to work with Teradata Database.

    Teradata MultiLoad provides an efficient way to deal with batch maintenance of large databases. Teradata MultiLoad is a command-driven utility for fast, high-volume maintenance on multiple tables and views in Teradata Database.

    Audience

    This book is intended for use by:

    System and application programmers

    System administrators

    Supported Releases

    This book supports the following releases:

    Teradata Database 13.10

    Teradata Tools and Utilities 13.10

    Teradata MultiLoad Version 13.10

    Note: See Interactive Mode on page 32 to verify the Teradata MultiLoad version number.

    To locate detailed supported-release information:

    1 Go to http://www.info.teradata.com.

    2 Click General Search under Online Publications.3 Type 3119 in the Publication Product ID box.4 Under Sort By, select Date.5 Click Search.6 Open the version of the Teradata Tools and Utilities ##.##.## Supported Platforms and

    Product Versions spreadsheet associated with this release

    Teradata MultiLoad Reference 3

    http://www.info.teradata.com

  • PrefacePrerequisites

    The spreadsheet includes supported Teradata Database versions, platforms, and product release numbers.

    Prerequisites

    The following prerequisite knowledge is required for this product:

    Computer technology and terminology

    Relational database management systems

    Utilities that load and retrieve data

    Changes to This Book

    The following changes were made to this book in support of the current release. Changes are marked with change bars. For a complete list of changes to the product, see the Teradata Tools and Utilities Release Definition associated with this release.

    Date and Release Description

    February 201013.10

    Teradata Teradata MultiLoad Reference

    IBM C is used to develop Teradata MultiLoad replacing SAS/C

    For Delete Initialization events, Teradata MultiLoad is enhanced to pass the same data to notify exit routines as Initialize events.

    Teradata MultiLoad is now supported on z/Linux, and discontinued on z/VM and MP-RAS

    Updated compiling and linking routines. See Compiling and Linking Routines on page 212

    Added information on continuing jobs when the config file has a syntax error

    Added information about the use of an ampersand in object name. See Object Name Restrictions on page 97

    Updated sample outputs for all Invocation Examples. See Appendix B: Invocation Examples

    Teradata MultiLoad now supports online archive. For more information, see Database Administration, B035-1093-mmyx.

    April 200913.00

    Added information on No Primary Index (NoPI) table considerations in chapter 2.

    Updated Teradata MultiLoad configuration file information.

    4 Teradata MultiLoad Reference

  • PrefaceAdditional Information

    Additional Information

    Additional information that supports this product and Teradata Tools and Utilities is available at the web sites listed in the table that follows. In the table, mmyx represents the publication date of a manual, where mm is the month, y is the last digit of the year, and x is an internal publication code. Match the mmy of a related publication to the date on the cover of this book. This ensures that the publication selected supports the same release.

    August 200813.00

    Removed information on SIGINT in the Windows Environment.

    Updated information on Specifying Decimal Data Types.

    Added AMPCHECK entry information to the Teradata MultiLoad Configuration File.

    Added information about the use of a semicolon in object names.

    Described the use of .SET before .LOGON and .LOGTABLE.

    Updated IBM system names (Changed MVS, VM and VM/CMS to z/OS and z/VM).

    Removed References to DSU.

    Added Appendix E, a discussion on using User-Defined-Types (UDTs) and User-Defined-Methods (UDMs).

    Added Period Data types to FIELD command and Text format information to IMPORT command.

    Date and Release Description

    Type of Information Description Access to Information

    Release overview

    Late information

    Use the Release Definition for the following information:

    Overview of all of the products in the release

    Information received too late to be included in the manuals

    Operating systems and Teradata Database versions that are certified to work with each product

    Version numbers of each product and the documentation for each product

    Information about available training and the support center

    1 Go to http://www.info.teradata.com/.2 Click General Search under Online Publications.3 Type 2029 in the Publication Product ID box.4 Click Search.5 Select the appropriate Release Definition from

    the search results.

    Teradata MultiLoad Reference 5

    http://www.info.teradata.com/

  • PrefaceAdditional Information

    Additional product information

    Use the Teradata Information Products web site to view or download specific manuals that supply related or additional information to this manual.

    1 Go to http://www.info.teradata.com/.2 Click Data Warehousing under Online

    Publications, Browse by Category.3 Do one of the following:

    For a list of Teradata Tools and Utilities documents, click Teradata Tools and Utilities, and then select an item under Releases or Products.

    Select a link to any of the data warehousing publications categories listed.

    Specific books related to Teradata MultiLoad are as follows:

    Database Administration, B035-1093-mmyx

    Teradata Director Program Reference B035-2416-mmyx

    Teradata Tools and Utilities Access Module Programmer Guide B035-2424-mmyx

    Teradata Call-Level Interface Version 2 Reference for Network-Attached Systems B035-2417-mmyx

    Teradata Tools and Utilities Access Module Reference B035-2425-mmyx

    Teradata Tools and Utilities Command Summary B035-2401-mmyx

    Introduction to Teradata B035-1091-mmyx

    Security Administration B035-1100-mmyx

    International Character Set Support B035-1132-mmyx

    Teradata Dynamic Workload Manager User Guide B035-2513-mmyx

    SQL External Routine Programming B035-1147-mmyx

    SQL Fundamentals B035-1141-mmyx

    Performance Management B035-1097-mmyx

    SQL Data Types and Literals B035-1143-mmyx

    SQL Data Definition Language B035-1144-mmyx

    SQL Data Manipulation Language B035-1146-mmyx

    Utilities Quick Reference B035-1511-mmyx

    CD-ROM images Access a link to a downloadable CD-ROM image of all customer documentation for this release. Customers are authorized to create CD-ROMs for their use from this image.

    1 Go to http://www.info.teradata.com/.2 Click Data Warehousing under Online

    Publications, Browse by Category.3 Click CD-ROM List and Images.

    Type of Information Description Access to Information

    6 Teradata MultiLoad Reference

    http://www.info.teradata.com/http://www.info.teradata.com/

  • PrefaceAdditional Information

    Ordering information for manuals

    Use the Teradata Information Products web site to order printed versions of manuals.

    1 Go to http://www.info.teradata.com/.2 Click How to Order under Print & CD

    Publications.3 Follow the ordering instructions.

    General information about Teradata

    The Teradata home page provides links to numerous sources of information about Teradata. Links include:

    Executive reports, case studies of customer experiences with Teradata, and thought leadership

    Technical information, solutions, and expert advice

    Press releases, mentions, and media resources

    1 Go to Teradata.com.2 Select a link.

    Type of Information Description Access to Information

    Teradata MultiLoad Reference 7

    http://www.info.teradata.com/http://www.teradata.com/t/resources

  • PrefaceAdditional Information

    8 Teradata MultiLoad Reference

  • Table of Contents

    Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3

    Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3

    Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3

    Supported Releases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3

    Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

    Changes to This Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4

    Additional Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

    Chapter 1: Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    Teradata MultiLoad Utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    What it Does . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    How it Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    Operating Features and Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    Character Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    Task Status Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

    Data Conversion Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

    Checkpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    Teradata MultiLoad Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    Teradata MultiLoad Command Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    Teradata MultiLoad Support Activity Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    Teradata MultiLoad Task Activity Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    Teradata SQL Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    A Teradata MultiLoad Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

    Chapter 2: Using Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Invoking Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    File Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Teradata MultiLoad Reference 9

  • Table of Contents

    Interactive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

    Batch Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32

    Runtime Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33

    z/OS Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39

    UNIX and Windows Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39

    Terminating Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40

    Normal Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40

    Abort Termination. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41

    After Terminating a Teradata MultiLoad Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41

    Reinitializing After Terminating a Teradata MultiLoad Job . . . . . . . . . . . . . . . . . . . . . . . .42

    Implications of Dropping Required Teradata MultiLoad-Created Tables . . . . . . . . . . . . .42

    Restarting a Paused Teradata MultiLoad Job . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44

    After Using the PAUSE ACQUISITION Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45

    After a Teradata MultiLoad Job Script Error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45

    After an Unrecoverable I/O Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46

    After a Down AMP is Recovered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46

    After a Teradata Database Restart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46

    After a Teradata Database System Reconfiguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46

    After a Job Abort or Client System Failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47

    After an Application Processor Reset Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48

    Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48

    Teradata MultiLoad Configuration File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48

    Teradata MultiLoad Command Conventions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51

    Data Conversion Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

    Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .52

    ANSI/SQL DateTime Specifications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56

    Character Set Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57

    Graphic Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62

    Graphic Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63

    Import Tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63

    Delete Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67

    Dealing with AMPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68

    Using Locks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69

    Restrictions and Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71

    Termination Return Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73

    UNIX Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73

    Using INMOD and Notify Exit Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74

    Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74

    Programming Considerations for Using Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74

    Programming Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .75

    Teradata MultiLoad/INMOD Routine Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76

    10 Teradata MultiLoad Reference

  • Table of Contents

    Teradata MultiLoad/Notify Exit Routine Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

    Rules and Restrictions for Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

    Writing a Teradata MultiLoad Job Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

    Estimating Space Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    Handling Teradata MultiLoad Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    Error Recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

    Determining the Cause of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

    Monitoring Teradata MultiLoad Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    Performance Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    Troubleshooting Performance Problems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    Chapter 3: Teradata MultiLoad Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    Syntax Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    Object Name Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    Geospatial Data Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

    ACCEPT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

    BEGIN MLOAD and BEGIN DELETE MLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

    DATEFORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

    DELETE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

    DISPLAY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119

    DML LABEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

    END MLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

    FIELD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

    FILLER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

    IF, ELSE, and ENDIF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    IMPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

    INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

    LAYOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

    LOGDATA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

    LOGMECH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

    LOGOFF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

    LOGON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

    LOGTABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

    PAUSE ACQUISITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

    RELEASE MLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

    ROUTE MESSAGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

    Teradata MultiLoad Reference 11

  • Table of Contents

    RUN FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177

    SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179

    SYSTEM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .181

    TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182

    UPDATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .184

    Appendix A: How to Read Syntax Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187

    Syntax Diagram Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187

    Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .189

    Multiple Legitimate Phrases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .191

    Sample Syntax Diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192

    Diagram Identifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .192

    Appendix B: Invocation Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193

    z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193

    UNIX and Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196

    Appendix C: INMOD and Notify Exit Routine Examples . . . . . . . . . . . . . . . . . . . . . . .203

    z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203

    UNIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .207

    Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219

    Appendix D: Teradata MultiLoad Job Script Examples . . . . . . . . . . . . . . . . . . . . . . . .229

    Import Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .229

    Delete Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230

    Upsert Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .230

    DDL for PERSONNEL Database Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .231

    12 Teradata MultiLoad Reference

  • Table of Contents

    Appendix E: User-Defined Types and User-Defined Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

    User-Defined Types and User-Defined Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

    User-Defined Types (UDTs). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

    User-Defined-Methods (UDMs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

    Creating UDTs with Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    Inserting and Retrieving UDTs with Client Products. . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    External Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    Inserting UDTs with Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    Retrieving UDTs with Teradata MultiLoad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

    Retrieving UDT Metadata with Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

    Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    Teradata MultiLoad Reference 13

  • Table of Contents

    14 Teradata MultiLoad Reference

  • List of Tables

    Table 1: Phases of Teradata MultiLoad Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    Table 2: Teradata MultiLoad Command Input Activities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

    Table 3: Teradata MultiLoad Support Activity Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

    Table 4: Teradata MultiLoad Task Activity Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Table 5: Teradata SQL Statements Supported in Teradata MultiLoad . . . . . . . . . . . . . . . . . . 25

    Table 6: Alternatives to Using Teradata MultiLoad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    Table 7: Data Sets, Files and Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Table 8: Runtime Parameters (Channel-Attached Configurations) . . . . . . . . . . . . . . . . . . . . 34

    Table 9: Runtime Parameters (Network-Attached Configurations) . . . . . . . . . . . . . . . . . . . . 35

    Table 10: System Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

    Table 11: Variable Substitution Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

    Table 12: Notes About Teradata MultiLoad Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

    Table 13: Character Sets Supported by Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . . . 57

    Table 14: Methods for Specifying Character Sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

    Table 15: Commands Impacting Multibyte Character Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

    Table 16: Import Task Considerations for Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . 64

    Table 17: Delete Task Considerations for Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . . . 68

    Table 18: Types of Table Locks Imposed by Teradata MultiLoad . . . . . . . . . . . . . . . . . . . . . . 70

    Table 19: Feature Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

    Table 20: Languages Supported by Platform and Type of User-Developed Routine . . . . . . . 75

    Table 21: Programming Routines by Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    Table 22: Entry Points for Notify Exit Routines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

    Table 23: Teradata MultiLoad-to-INMOD Status Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    Table 24: INMOD-to-Teradata MultiLoad Interface Status Codes . . . . . . . . . . . . . . . . . . . . . 77

    Table 25: Events Passed to the Notify Exit Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

    Table 26: Teradata MultiLoad Support Environmental Commands . . . . . . . . . . . . . . . . . . . . 84

    Table 27: Commands that Specify Teradata MultiLoad Tasks . . . . . . . . . . . . . . . . . . . . . . . . . 85

    Table 28: Adjusting the Preliminary Estimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

    Table 29: Acquisition Error Table Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    Table 30: Application Error Table Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

    Table 31: Sequence Type and Number for Example Statements . . . . . . . . . . . . . . . . . . . . . . . 92

    Table 32: Error Table Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

    Teradata MultiLoad Reference 15

  • List of Tables

    Table 33: ACCEPT Command Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99

    Table 34: Events that Create Notifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110

    Table 35: BEGIN MLOAD and BEGIN DELETE MLOAD Commands . . . . . . . . . . . . . . . . .112

    Table 36: DATEFORM Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115

    Table 37: DELETE Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116

    Table 38: DISPLAY Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119

    Table 39: DML LABEL Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122

    Table 40: Using the FIELD Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129

    Table 41: ANSI/SQL DateTime Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132

    Table 42: FILLER Command Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139

    Table 43: IF, ELSE, and ENDIF Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141

    Table 44: IMPORT Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151

    Table 45: INSERT Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .154

    Table 46: LAYOUT Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .159

    Table 47: LOGOFF Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163

    Table 48: LOGON Usage Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166

    Table 49: LOGTABLE Usage Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168

    Table 50: Pause Acquisition Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170

    Table 51: RELEASE MLOAD Usage Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .173

    Table 52: ROUTE MESSAGES Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .176

    Table 53: RUN FILE Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178

    Table 54: SET Usage Notes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .179

    Table 55: TABLE Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .182

    Table 56: UPDATE Usage Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .185

    Table 57: Sample INMOD Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219

    16 Teradata MultiLoad Reference

  • CHAPTER 1

    Overview

    This chapter provides an overview of the Teradata MultiLoad utility. Topics include:

    Teradata MultiLoad Utility

    Operating Features and Capabilities

    Teradata MultiLoad Commands

    A Teradata MultiLoad Example

    Teradata MultiLoad Utility

    This section describes Teradata MultiLoad and its features, and explains how the utility operates.

    Description

    The Teradata MultiLoad utility is an efficient way to deal with batch maintenance of large databases. Teradata MultiLoad is a command-driven utility for fast, high-volume maintenance on multiple tables and views in Teradata Database.

    A single Teradata MultiLoad job performs a number of different import and delete tasks on database tables and views:

    Each Teradata MultiLoad import task can do multiple data insert, update, and delete functions on up to five different tables or views.

    Each Teradata MultiLoad delete task can remove large numbers of rows from a single table.

    Use Teradata MultiLoad to import data from:

    Disk or tape files (using a custom Access Module) on a channel-attached client system

    Input files on a network-attached workstation

    Special input module (INMOD) programs written to select, validate, and preprocess input data

    Access modules

    Any device providing properly formatted source data

    The table or view in the database receiving the data can be any existing table or view for which privileges for maintenance tasks have been granted.

    Note: Full tape support is not available for any function in Teradata MultiLoad for network-attached client systems. To import data from a tape, a custom access module that interfaces

    Teradata MultiLoad Reference 17

  • Chapter 1: OverviewTeradata MultiLoad Utility

    with the tape device must be written. For information about how to write a custom access module, see the Teradata Tools and Utilities Access Module Programmer Guide.

    What it Does

    When Teradata MultiLoad is invoked, the utility executes the Teradata MultiLoad commands and Teradata SQL statements in the Teradata MultiLoad job script.

    Table 1 describes the phases of Teradata MultiLoad operations.

    How it Works

    Teradata MultiLoad processes a series of commands and Teradata SQL statements which are usually entered as a batch mode job script. The Teradata MultiLoad commands perform

    Table 1: Phases of Teradata MultiLoad Operation

    Phase Teradata MultiLoad Operation

    Preliminary 1 Parses and validates all of the Teradata MultiLoad commands and Teradata

    SQL statements in a Teradata MultiLoad job

    2 Establishes sessions and process control with Teradata Database3 Submits special Teradata SQL requests to Teradata Database4 Creates and protects temporary work tables and error tables in Teradata

    Database

    DML Transaction Submits the DML statements specifying the insert, update, and delete tasks to Teradata Database

    Acquisition 1 Imports data from the specified input data source2 Evaluates each record according to specified application conditions3 Loads the selected records into the worktables in Teradata Database(There is no acquisition phase activity for a Teradata MultiLoad delete task.)

    Application 1 Acquires locks on the specified target tables and views in Teradata Database2 For an import task, inserts the data from the temporary work tables into

    the target tables or views in Teradata Database

    3 For a delete task, deletes the specified rows from the target table in Teradata Database

    4 Updates the error tables associated with each Teradata MultiLoad task

    Cleanup 1 Forces an automatic restart/rebuild if an AMP went offline and came back online during the application phase

    2 Releases all locks on the target tables and views3 Drops the temporary work tables and all empty error tables from Teradata

    Database

    4 Reports the transaction statistics associated with the import and delete tasks

    18 Teradata MultiLoad Reference

  • Chapter 1: OverviewOperating Features and Capabilities

    session control and data handling of the data transfers. The Teradata SQL statements do the actual maintenance functions on the database tables and views.

    Serialization of Changes

    In certain uses of Teradata MultiLoad, it is possible to have multiple changes to one row in the same job. For example, the row may be inserted and then updated during the batch job, or it may be updated and then deleted. In any case, the correct ordering of these operations is obviously very important. Teradata MultiLoad automatically guarantees that this ordering of operations is maintained correctly.

    Operating Features and Capabilities

    This section describes the operating modes and character sets supported by Teradata MultiLoad. It also discusses the utilitys capabilities.

    Operating Modes

    Teradata MultiLoad runs in the following operating modes:

    Interactive

    Batch

    Character Sets

    Teradata MultiLoad supports the character sets shipped with Teradata; this includes Latin, Japanese, Chinese, and Korean character sets, along with ASCII, EBCDIC, UTF-8, and UTF-16. Teradata MultiLoad supports user-defined session character sets. For additional information about character-set support and definition, see Character Set Specification on page 57.

    Task Status Reporting

    Teradata MultiLoad has three ways to provide information about the status of jobs that are still in progress and those that have just completed:

    Teradata MultiLoad utility messages provide job status reports, including:

    Options messages that list the settings of Teradata MultiLoad task parameters.

    Logoff/disconnect messages that list key run statistics.

    The QrySessn Utility provides real-time, phase-oriented progress reports at selected intervals during the Teradata MultiLoad job.

    Statistics messages present information at the end of the Teradata MultiLoad job.

    The following sections describe each Teradata MultiLoad task status reporting method.

    Options Messages

    Teradata MultiLoad options messages list the options specifications for each task:

    Teradata MultiLoad Reference 19

  • Chapter 1: OverviewOperating Features and Capabilities

    SESSIONS

    CHECKPOINT

    TENACITY

    SLEEP

    ERRLIMIT

    AMPCHECK

    Logoff/Disconnect Messages

    Issued in response to the LOGOFF command, the Teradata MultiLoad logoff/disconnect message lists:

    The time that the LOGOFF command was executed

    Whether the disconnect operation was successful

    Whether the restart log table was dropped or kept, depending on the success or failure of the job

    The total processor time used

    The job start/end time and date

    The highest return code encountered by the job

    QrySessn Utility

    QrySessn is a separate utility that can be used to monitor the progress of a Teradata MultiLoad job. QrySessn reports different sets of status information for each phase of the Teradata MultiLoad job:

    Preliminary

    Acquisition

    Application

    QrySessn also reports on:

    Action values for processing data

    Data counts for the total activity

    I/O accesses

    Optional data counts and row/sector counts, by session

    Phase and CPU time-of-day information

    Row count statistics for:

    Non-unique secondary indexes (NUSIs)

    Primary data

    Rows deleted

    Rows inserted in target tables

    Target table rows processed

    20 Teradata MultiLoad Reference

  • Chapter 1: OverviewOperating Features and Capabilities

    QrySessn can be executed from a system console using the Database Window interface on a system running Teradata Database for UNIX or Teradata Database for Windows.

    For complete information about using the QrySessn utility, see the QrySessn chapter in the Utilities Quick Reference.

    Statistics Messages

    For each import task, a Teradata MultiLoad statistics message reports the total number of:

    Data records sent to Teradata Database, including a subtotal of the number of records from each data source

    Records skipped from each data source because of false WHERE conditions

    Rows inserted, updated, or deleted

    Errors recorded in the first error table for each target table

    Errors recorded in the second error table for each target table, including the number of duplicate rows

    Teradata MultiLoad writes options and logoff/disconnect messages, and the statistics facility report to either:

    The customary output destination for the client system (SYSPRINT/stdout or the redirected stdout).

    or

    An alternate destination specified in a ROUTE MESSAGES command.

    The utility also writes the statistics information in the restart log table so it can be restored after a system restart operation.

    Data Conversion Capabilities

    Teradata MultiLoad can redefine the data type specification of numeric, character, and date input data so it matches the type specification of its destination column in the Teradata MultiLoad table on Teradata Database.

    For example, if an input field with numeric type data is targeted for a column with a character data type specification, Teradata MultiLoad can change the input data specification to character before inserting it into the table.

    The types of data conversions can be specified are:

    Numeric-to-numeric (for example integer-to-decimal)

    Character-to-numeric

    Character-to-date

    Date-to-character

    Note: Redundant conversions, such as integer-to-integer, are legal and necessary to support the zoned decimal format. For more information about the zoned decimal format, data types, and data conversions, see SQL Data Types and Literals.

    Teradata MultiLoad Reference 21

  • Chapter 1: OverviewTeradata MultiLoad Commands

    Checkpoints

    Teradata MultiLoad supports the use of checkpoints. Checkpoints are entries posted to a restart log table at regular intervals during the Teradata MultiLoad data transfer operation. If processing stops while a Teradata MultiLoad job is running, restart the job at the most recent checkpoint.

    For example, assume 1,000,000 records are loading in a table and have specified checkpoints every 50,000 records. Then Teradata MultiLoad pauses and posts an entry to the restart log table whenever multiples of 50,000 records are successfully sent to Teradata Database.

    If the job stops after record 60,000 has been loaded, restart the job at the record immediately following the last checkpointrecord 50,001.

    Enable the checkpoint function by specifying a checkpoint value in the BEGIN MLOAD command. For more information, see BEGIN MLOAD and BEGIN DELETE MLOAD.

    Teradata MultiLoad Commands

    Teradata MultiLoad accepts both Teradata MultiLoad commands and a subset of Teradata SQL statements. These are described in the following sections:

    Teradata MultiLoad Command Input

    The Teradata MultiLoad commands perform the following two types of activities:

    Support

    Task

    Table 2 lists descriptions of the Teradata MultiLoad command input activities.

    Teradata MultiLoad Support Activity Commands

    Table 3 lists the Teradata MultiLoad commands that perform support activities.

    Table 2: Teradata MultiLoad Command Input Activities

    Activity Description

    Support Support commands establish Teradata MultiLoad sessions with Teradata Database and establish the operational support environment for Teradata MultiLoad.

    Support commands are not directly involved in specifying a Teradata MultiLoad task.

    Task The Teradata MultiLoad task commands specify the actual processing that takes place for each Teradata MultiLoad task.

    22 Teradata MultiLoad Reference

  • Chapter 1: OverviewTeradata MultiLoad Commands

    Teradata MultiLoad Task Activity Commands

    Table 4 lists the Teradata MultiLoad commands that perform task activities.

    Table 3: Teradata MultiLoad Support Activity Commands

    Teradata MultiLoad Command Function

    ACCEPT Allows the value of one or more utility variables to be accepted from either a file or an environment variable.

    DATEFORM Specifies the form of the DATE data type specifications for the Teradata MultiLoad job.

    DISPLAY Writes messages to the specified destination.

    ELSE Introduces commands and statements that execute when a preceding IF condition is false. See IF, ELSE, and ENDIF on page 141.

    ENDIF Delimits the group of Teradata MultiLoad commands that were subject to previous IF or ELSE conditions. See IF, ELSE, and ENDIF on page 141.

    IF Introduces a conditional expression whose value initiates execution of subsequent commands. See IF, ELSE, and ENDIF on page 141.

    LOGOFF Disconnects all active sessions and terminates Teradata MultiLoad on the client system.

    LOGON Specifies the LOGON command string to be used in connecting all sessions established by Teradata MultiLoad.

    LOGTABLE Identifies the table to be used to journal checkpoint information required for safe, automatic restart of Teradata MultiLoad when the client or Teradata Database system fails.

    ROUTE MESSAGES Identifies the destination of output produced by Teradata MultiLoad support environment.

    RUN FILE Invokes the specified external source as the current source of commands and statements.

    SET Assigns a data type and a value to a utility variable.

    SYSTEM Suspends operation of Teradata MultiLoad and executes any valid local operating system command.

    Teradata MultiLoad Reference 23

  • Chapter 1: OverviewTeradata MultiLoad Commands

    Teradata SQL Statements

    Teradata SQL statements define and manipulate the data stored in Teradata Database.

    Teradata MultiLoad supports a subset of Teradata SQL statements. As a result, other utilities do not have to be invoked to perform routine database maintenance functions before executing Teradata MultiLoad utility tasks. For example, the supported Teradata SQL statements can be used to:

    Create the table to load

    Establish a database as an explicit table name qualifier

    Add checkpoint specifications to a journal table

    Table 4: Teradata MultiLoad Task Activity Commands

    Teradata MultiLoad Command Function

    BEGIN MLOAD and BEGIN DELETE MLOAD

    Specifies:

    The kind of Teradata MultiLoad task to be executed

    The target tables in Teradata Database

    The parameters for executing the task

    DML LABEL Defines a label and error treatment options for a following group of DML statements.

    END MLOAD Indicates completion of Teradata MultiLoad command entries and initiates execution of the task.

    FIELD Used with the LAYOUT command to define a field of the data source record that is sent to Teradata Database.

    FILLER Used with the LAYOUT command to define a field in the data source record that is not sent to Teradata Database.

    IMPORT Identifies the data source, the layout used to describe the data record, and optional conditions for performing DML operations.

    LAYOUT Introduces the record format of the data source to be used in the Teradata MultiLoad task. This command is followed by a sequence or combination of FIELD and TABLE commands.

    LOGDATA Supplies parameters to the LOGMECH command beyond those needed by the logon mechanism, such as userid and password, to successfully authenticate the user.

    LOGMECH Identifies the appropriate logon mechanism by name.

    PAUSE ACQUISITION Temporarily suspends the acquisition phase of a Teradata MultiLoad job.

    TABLE Used with the LAYOUT command to identify a table whose column names and data descriptions are used as the field names and data descriptions of the data source records.

    24 Teradata MultiLoad Reference

  • Chapter 1: OverviewTeradata MultiLoad Commands

    Table 5 lists the Teradata SQL statements Teradata MultiLoad supports. To use any other Teradata SQL statements, exit Teradata MultiLoad and enter them from another application, such as Basic Teradata Query (BTEQ).

    Table 5: Teradata SQL Statements Supported in Teradata MultiLoad

    Teradata SQL Statement Function

    ALTER TABLE Changes the column configuration or options of an existing table

    CHECKPOINT Adds a checkpoint entry to a journal table

    COLLECT STATISTICS Collects statistical data for one or more columns of a table

    COMMENT Stores or retrieves a comment string associated with a database object

    CREATE DATABASE Creates a new database

    CREATE MACRO Creates a new macro

    CREATE TABLE Creates a new table

    CREATE VIEW Creates a new view

    DATABASE Specifies a new default database for the current session

    DELETE Removes rows from a table

    DELETE DATABASE Removes all tables, views, and macros from a database

    DROP DATABASE Drops the definition for an empty database from the Data Dictionary

    DROP TABLE Removes a table

    GIVE Transfers ownership of a database to another user

    GRANT Grants privileges to a database object

    INSERT Inserts new rows to a table

    MODIFY DATABASE Changes the options of an existing database

    RELEASE MLOAD Removes the access locks from the target tables in Teradata Database

    This inhibits any attempts to restart the Teradata MultiLoad job when a Teradata MultiLoad task has been suspended or aborted.

    Note: A RELEASE MLOAD statement must be entered from another application (e.g., BTEQ). A RELEASE MLOAD statement

    cannot be entered from Teradata MultiLoad.

    RENAME Changes the name of an existing table, view, or macro

    REPLACE MACROREPLACE VIEW

    Redefines an existing macro or view

    Teradata MultiLoad Reference 25

  • Chapter 1: OverviewA Teradata MultiLoad Example

    Caution: Specifying any DML statements (insert/delete/update) before specifying the BEGIN MLOAD command will use the non-fast path and processing will be done in the Transient Journal (very slow and may exceed the maximum perm space). Specifying the DML statement after the BEGIN MLOAD command will use the fast path and processing will be done in the transaction phase (very fast).

    For syntax and a complete description of each Teradata SQL statement, see SQL Data Definition Language and SQL Data Manipulation Language.

    A Teradata MultiLoad Example

    This topic provides an example of a small Teradata MultiLoad job that can be quickly set up and run. The example shows how to:

    Create a data file to use as the input source for a Teradata MultiLoad import task

    Use a Teradata MultiLoad job script to import data into a newly created table

    Select data from the table to verify the import task

    This example is for UNIX or Windows on a network-attached client system. For additional UNIX and Windows examples, and for z/OS examples on channel-attached systems, see the following appendixes:

    Appendix B: Invocation Examples

    Appendix C: INMOD and Notify Exit Routine Examples

    Appendix D: Teradata MultiLoad Job Script Examples

    Dropping the Employee Table

    The table in this example is named Employee. Use the Teradata SQL DROP TABLE command to delete any existing version of the Employee table from the database:

    bteq.logon tdpid/username,passwordDROP TABLE employee;.quit

    REVOKE Rescinds privileges to a database object

    SET QUERY_BAND Identifies type and source of query to determine prioritization of queries

    SET SESSION COLLATION Overrides the collation specification for the current session

    SET SESSION OVERRIDE REPLICATION ON/OFF

    Turns replication services on or off

    UPDATE Changes the column values of an existing row in a table

    Table 5: Teradata SQL Statements Supported in Teradata MultiLoad (continued)

    Teradata SQL Statement Function

    26 Teradata MultiLoad Reference

  • Chapter 1: OverviewA Teradata MultiLoad Example

    Creating the Source Data File

    Create and save a six-record text file named insert.input:

    |10021 |Brown, Jo |200|2312|Development |63000.00 |20|Jan 01 1955|F| |M|16| 0||10001 |Jones, Bill |100|5376|President |83000.00 |15|Jan 01 1960|M| |M|14| 0||10002 |Smith, Jim |100|4912|Sales |73000.00 |10|Jan 01 1970|M| |M|13| 1||10028 |Lee, Sandra |200|5844|Support |77000.00 | 4|Jan 01 1971|F| |M|18| 0||10029 |Berg, Andy |200|2312|Test |67000.00 |10|Jan 01 1967|M| |M|15| 0||10023 |Ayer, John |300|4432|Accounting |52000.00 | 8|Jan 01 1965|M| |M|13| 0|

    Use this file as the input source for a Teradata MultiLoad import task.

    Note: The file example uses field delimiter characters (|) for readability, to help distinguish one field from another.

    Field delimiter characters are not required in files.

    Writing the Teradata MultiLoad Job Script

    Create and save a Teradata MultiLoad job script file named insert.mload that loads the six-record insert.data file into the Employee table:

    .logtable inslogtable;

    .logon tdpid/username,password;

    CREATE TABLE employee ( EmpNo SMALLINT FORMAT 9(5) BETWEEN 10001 AND 32001 NOT NULL, Name VARCHAR(12), DeptNo SMALLINT FORMAT 999 BETWEEN 100 AND 900 , PhoneNo SMALLINT FORMAT 9999 BETWEEN 1000 AND 9999, JobTitle VARCHAR(12), Salary DECIMAL(8,2) FORMAT ZZZ,ZZ9.99 BETWEEN 1.00 AND 999000.00 , YrsExp BYTEINT FORMAT Z9 BETWEEN -99 AND 99 , DOB DATE FORMAT MMMbDDbYYYY, Sex CHAR(1) UPPERCASE, Race CHAR(1) UPPERCASE, MStat CHAR(1) UPPERCASE, EdLev BYTEINT FORMAT Z9 BETWEEN 0 AND 22, HCap BYTEINT FORMAT Z9 BETWEEN -99 AND 99 ) UNIQUE PRIMARY INDEX( EmpNo ) INDEX( Name );

    .begin import mload tables employee;

    .layout inslayout;.field EmpNo 2 char(9);.field Name 12 char(12);.field DeptNo 25 char(3);.field PhoneNo 29 char(4);.field JobTitle 34 char(12);.field Salary 47 char(9);.field YrsExp 57 char(2);.field DOB 60 char(11);.field Sex 72 char(1);.field Race 74 char(1);.field MStat 76 char(1);.field EdLev 78 char(2);.field HCap 81 char(2);

    Teradata MultiLoad Reference 27

  • Chapter 1: OverviewA Teradata MultiLoad Example

    .dml label insdml;insert into employee.*;

    .import infile insert.inputformat textlayout inslayoutapply insdml;

    .end mload;

    .logoff;

    Comments

    1 For syntax and descriptions of the following Teradata MultiLoad utility commands used in the preceding example, see Chapter 3: Teradata MultiLoad Commands.

    2 The CREATE TABLE statement creates a new table on Teradata Database:

    Named employee

    Containing the following columns:

    Indexed by:

    EmpNo (UNIQUE PRIMARY)

    Name

    For a description of the CREATE TABLE statement, see SQL Data Definition Language.

    3 The LAYOUT command and the series of FIELD commands specify each field of the data records that are sent to Teradata Database. (The insert.input data file created in Creating the Source Data File on page 27.)

    The specified layout name, inslayout, is referenced in the subsequent Teradata MultiLoad

    IMPORT command.

    Each FIELD command specifies the name, starting position, and data type description for each field in the input data records. In making the field declarations, note that the

    BEGIN MLOAD

    DML LABEL

    END MLOAD

    FIELD

    IMPORT

    LAYOUT

    LOGOFF

    LOGON

    LOGTABLE

    DeptNo

    DOB

    EdLev

    EmpNo

    HCap

    JobTitle

    MStat

    Name

    PhoneNo

    Race

    Salary

    Sex

    YrsExp

    28 Teradata MultiLoad Reference

  • Chapter 1: OverviewA Teradata MultiLoad Example

    1-character and multi-character delimiter fields are optional. They are not required in the example.

    4 The DML LABEL command introduces the INSERT statement.

    5 The IMPORT command starts the import task, using the insert.input file and the insdml insert statement.

    Running the Teradata MultiLoad Job

    Use the following command to invoke Teradata MultiLoad and run the insert.mload job script:

    mload < insert.mload

    Note: The redirection mechanism is required for Teradata MultiLoad job scripts on network-attached client systems.

    Verifying the Import Task

    Use the following BTEQ commands to verify the Teradata MultiLoad import task by selecting newly imported data from the Employee table:

    bteq.logon tdpid/username,password.width 120SELECT * from employee where salary > 65000.00;.quit

    The response indicates that the Employee table was successfully loaded with the data from the insert.input file:

    *** Query completed. 4 rows found. 13 columns returned. *** Total elapsed time was 6 seconds.

    EmpNo Name DeptNo PhoneNo JobTitle Salary YrsExp DOB Sex Race MStat EdLev HCap----- ---------- ------ ------- --------- --------- ------ ----------- --- ---- ----- ----- ----10028 Lee, Sandra 200 5844 Support 77,000.00 4 JAN 01 1971 F M 18 010001 Jones, Bill 100 5376 President 83,000.00 15 JAN 01 1960 M M 14 010002 Smith, Jim 100 4912 Sales 73,000.00 10 JAN 01 1970 M M 13 110029 Berg, Andy 200 2312 Test 67,000.00 10 JAN 01 1967 M M 15 0

    Other Alternatives

    The Teradata MultiLoad example is a simple, straightforward exercise that can be used to quickly create a job script and run Teradata MultiLoad. Table 6 explains some of the more significant functional alternatives that Teradata MultiLoad provides, and points to where they are described in greater detail.

    Table 6: Alternatives to Using Teradata MultiLoad

    Alternative Description

    Using Channel-attached Client Systems

    The Teradata MultiLoad example assumes UNIX or Windows are being used on a network-attached client system. To run the example using z/OS on a channel-attached client system, use the standard z/OS JCL control statements (DD) to allocate and create the Teradata MultiLoad data sets or files before invoking the utility. For more information about invoking Teradata MultiLoad on channel-attached client systems, see Invoking Teradata MultiLoad on page 31.

    Teradata MultiLoad Reference 29

  • Chapter 1: OverviewA Teradata MultiLoad Example

    Using the FastLoad Utility

    The Teradata MultiLoad example shows the simplest possible Teradata MultiLoad jobloading data into an empty table. Although the FastLoad utility can be used to perform the same task, with the job running quicker than with Teradata MultiLoad, note that FastLoad works only on empty tables. FastLoad does not support inserting, updating, or deleting data rows in existing tables. For these tasks, use Teradata MultiLoad.

    Performing Insert, Update and Delete Operations

    If, instead of loading data into a new table, either additional rows are inserted into an existing table, or specific rows are updated or deleted, use the same Teradata MultiLoad example by:

    Deleting the CREATE TABLE statement from the Teradata MultiLoad job script.

    Specifying a properly formatted existing table in the BEGIN MLOAD command.

    Using the appropriate Teradata SQL INSERT, UPDATE, or DELETE statement after the

    DML LABEL command in the Teradata MultiLoad job script.

    Teradata MultiLoad also provides a delete task where all rows are selected by one delete clause, rather than by matching individual input records. For more information, see Import Tasks on page 63 and Delete Tasks on page 67, and the INSERT, UPDATE, and DELETE commands described in Chapter 3: Teradata MultiLoad Commands.

    Using different input file formats

    The format of the input data source for the Teradata MultiLoad example (insert.input) is TEXT, as specified by the IMPORT command. Teradata MultiLoad also supports input data source files with the FASTLOAD, BINARY, TEXT, UNFORMAT, and VARTEXT formats. For a description of supported input file formats, see the IMPORT command in Chapter 3: Teradata MultiLoad Commands.

    Using INMOD Routines

    In the Teradata MultiLoad example, the utility reads the input data records directly from the specified source file (insert.input). An alternative would be to write an INMOD routine that Teradata MultiLoad could call to obtain input records. For example, the INMOD routine could:

    Read and preprocess records from a file, or read data from other database systems.

    Generate or validate data records, or convert data record fields.

    In this case, use the optional INMOD modulename specification of the IMPORT command to identify the INMOD routine name. For more information about using INMOD routines, see Using INMOD and Notify Exit Routines on page 74, and the IMPORT command described in Chapter 3: Teradata MultiLoad Commands.

    Table 6: Alternatives to Using Teradata MultiLoad (continued)

    Alternative Description

    30 Teradata MultiLoad Reference

  • CHAPTER 2

    Using Teradata MultiLoad

    This chapter provides detailed information about using Teradata MultiLoad. Topics include:

    Invoking Teradata MultiLoad

    Terminating Teradata MultiLoad

    Restarting a Paused Teradata MultiLoad Job

    Programming Considerations

    Using INMOD and Notify Exit Routines

    Writing a Teradata MultiLoad Job Script

    Estimating Space Requirements

    Handling Teradata MultiLoad Errors

    Monitoring Teradata MultiLoad Performance

    Invoking Teradata MultiLoad

    This section describes requirements and options to invoke the Teradata MultiLoad utility.

    File Requirements

    Table 7 lists the data sets/files or input/output devices which Teradata MultiLoad uses to access the input data source.

    When running Teradata MultiLoad in interactive mode, the terminal keyboard functions as the standard input device and the display screen is the standard output/error device. When running Teradata MultiLoad in batch mode, specify a data set or file name for each of these

    Table 7: Data Sets, Files and Devices

    Data Set/File or Device Provides

    Configuration Optional specification of Teradata MultiLoad utility default values

    Standard error Destination for Teradata MultiLoad errors

    Standard input Teradata MultiLoad commands and Teradata SQL statements that make up the Teradata MultiLoad job

    Standard output Destination for Teradata MultiLoad output responses and messages

    Teradata MultiLoad Reference 31

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    functions. The method of doing this varies, depending on the configuration of the client system:

    On network-attached client systems, use the standard redirection mechanism (< infilename and > outfilename) to specify the Teradata MultiLoad files when the utility is invoked.

    On channel-attached client systems, use standard z/OS JCL control statements (DD) to allocate and create the Teradata MultiLoad data sets or files before invoking the utility.

    Interactive Mode

    To invoke Teradata MultiLoad in interactive mode, enter mload at the system command prompt:

    mload

    The following sample message is displayed to begin an interactive Teradata MultiLoad session:

    ==================================================================== =

    = Teradata MultiLoad Utility Release MLOD.13.10.00.000

    == == Platform = z/OS ===================================================================== == Copyright 1990-2010, Teradata Corporation. ALL RIGHTS RESERVED. ====================================================================

    Batch Mode

    This section covers invoking Teradata MultiLoad in batch mode on network-attached and channel-attached systems.

    For a description of how to read the syntax diagrams used in this book, see Appendix A: How to Read Syntax Diagrams.

    Batch Mode on Network-Attached Systems

    Refer to the runtime parameter descriptions in Table 9 on page 35. Use the syntax shown in Figure 1 to invoke Teradata MultiLoad on network-attached client systems:

    32 Teradata MultiLoad Reference

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    Figure 1: Invoke Teradata MultiLoad in Batch Mode on Network-Attached Systems

    Batch Mode on Channel-Attached z/OS Systems

    Refer to the runtime parameter descriptions in Table 8 on page 34. Use the syntax in Figure 2 to invoke Teradata MultiLoad on channel-attached z/OS client systems:

    Figure 2: Invoke Teradata MultiLoad in Batch Mode on Channel-Attached z/OS Client Systems.

    Runtime Parameters

    This section describes the runtime parameters used by Teradata MultiLoad.

    Table 8 lists Teradata MultiLoad runtime parameters for channel-attached configurations.

    2409D014

    mload

    -M

    -N

    -r

    -c

    -e

    -b< infilename > outfilename

    character-set-name

    filename

    max-sessions

    min-sessions

    ?multiload command?-y

    -i scriptencoding

    -u outputencoding

    -V

    2409B015

    // EXEC TDSMLOAD

    BRIEF

    CHARSET=character-set-name

    ERRLOG=filename

    MLPARM= ' '

    MAXSESS=max-sessions

    MINSESS=min-sessions

    "multiload command"

    ,

    RVERSION

    Teradata MultiLoad Reference 33

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    Table 8: Runtime Parameters (Channel-Attached Configurations)

    Parameter Description

    BRIEF Reduced print output runtime parameter that limits Teradata MultiLoad printout to the minimal information required to determine the success of the job:

    Logon/logoff information

    Candidate records

    Insert, update, and delete results

    Error table counts

    CHARSET=character-set-name

    Character set specification for the Teradata MultiLoad job

    Specify any character set installed on the Teradata server, by its character set name. For a listing of character set names, see Character Set Specification on page 57.

    Caution: The character set specification remains in effect for the entire Teradata MultiLoad job, even if Teradata Database resets, causing the

    Teradata MultiLoad job to be restarted. However, the character set

    specification does not remain in effect if the client system fails, or if

    the Teradata MultiLoad job is cancelled. In these cases, when

    resubmitting the job, use the same character set specified on the initial job. If a different character set specification is used when the job is resubmitted, the data loaded by the restarted job will not appear the same as the data loaded by the initial job.

    If a character set specification is not entered, the default is the character set specified for Teradata Database when Teradata MultiLoad is invoked.

    Note: For more information about specifying and using character sets, see Character Set Specification on page 57.

    ERRLOG=filename

    Alternate file specification for Teradata MultiLoad error messages

    Specifying an alternate file name produces a duplicate record of all Teradata MultiLoad error messages.

    On channel-attached client systems, the alternate file specification is limited to eight characters and:

    On z/OS, it must be a DD name defined in the JCL

    There is no default error log file name specification.

    MAXSESS = max-sessions

    Maximum number of Teradata MultiLoad sessions logged on to Teradata Database

    Maximum specification must be greater than zero and no more than the total number of AMPs on the system.

    Default is one session for each AMP.

    MINSESS = min-sessions

    Minimum number of Teradata MultiLoad sessions required to run the job

    Minimum specification must be greater than zero.

    Default is one.

    34 Teradata MultiLoad Reference

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    Table 9 lists Teradata MultiLoad runtime parameters for network-attached configurations.

    Teradata MultiLoad command

    Invocation option that can signify the start of a Teradata MultiLoad job on a network-attached system

    Since only one Teradata MultiLoad command can be specified as the Teradata MultiLoad command specification, it is usually a RUN FILE command that specifies the file containing the Teradata MultiLoad job script.

    Use the DD control statements to specify the input and output files before invoking the utility.

    RVERSION Display version number and stop.

    Table 8: Runtime Parameters (Channel-Attached Configurations) (continued)

    Parameter Description

    Table 9: Runtime Parameters (Network-Attached Configurations)

    Parameter Description

    -b Reduced print output runtime parameter that limits Teradata MultiLoad printout to the minimal information required to determine the success of the job:

    Logon/logoff information

    Candidate records

    Insert, update, and delete results

    Error table counts

    -c character-set-name Character set specification for the Teradata MultiLoad job

    Specify any character set installed on the Teradata server, by its character set name. For a listing of character set names, see Character Set Specification on page 57.

    Caution: The character set specification remains in effect for the entire Teradata MultiLoad job, even if Teradata Database

    resets, causing the Teradata MultiLoad job to be

    restarted. However, the character set specification does not remain in effect if the client system fails, or if the

    Teradata MultiLoad job is cancelled. In these cases, when

    resubmitting the job, use the same character set specified on the initial job. If a different character set is specified when a job is resubmitted, the data loaded by the restarted job will not appear the same as the data loaded by the initial job.

    If a character set specification is not entered, the default is the character set specified for Teradata Database when Teradata MultiLoad is invoked.

    Note: For more information about how to specify and work with character sets, see Character Set Specification on page 57.

    Teradata MultiLoad Reference 35

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    -e filename Alternate file specification for Teradata MultiLoad error messages

    Specifying an alternate file name produces a duplicate record of all Teradata MultiLoad error messages.

    There is no default error log file name specification.

    -i scriptencoding Encoding form of the job script

    If this parameter is not specified and the client character set is UTF-16, Teradata MultiLoad interprets the job script to UTF-16. If character-type data is also specified in the script, Teradata MultiLoad converts the string literals and the corresponding field in the import data to the same character set before comparing or concatenating them. (String literals are specified with .APPLYWHERE.; LAYOUTCONTINUEIF.; FIELDNULLIF.; FIELD||commands.)

    Valid encoding options are:

    UTF-8 or UTF8

    UTF-16BE, or UTF16-BE, or UTF16BE

    UTF-16LE, or UTF16-LE, or UTF16LE

    UTF-16 or UTF16

    The specified encoding character set applies to all script files included by the .RUN FILE commands.

    The UTF-16 or UTF-8 Byte Order Mark (BOM) can be present or absent in the script file.

    When UTF-16 BOM is present and 'UTF-16' is specified, Teradata MultiLoad interprets the script according to the endianness indicated by the UTF-16 BOM. When the UTF-16 BOM is not present, Teradata MultiLoad interprets the script according to the endianness indicated by the encoding option.

    Note: UTF-8 BOM is not supported on the z/OS platform when using access modules or data files.

    < infilename Name of the standard input file that contains Teradata MultiLoad commands and Teradata SQL statements on network-attached client systems

    The infilename specification redirects the standard input (stdin). If an infilename specification is not entered, the default is stdin.

    -M max-sessions Maximum number of Teradata MultiLoad sessions logged on to Teradata Database

    Maximum specification must be greater than zero and no more than the total number of AMPs on the system.

    Default is one session for each AMP.

    Table 9: Runtime Parameters (Network-Attached Configurations) (continued)

    Parameter Description

    36 Teradata MultiLoad Reference

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    -N min-sessions Minimum number of Teradata MultiLoad sessions required to run the job

    Minimum specification must be greater than zero.

    Default is one.

    > outfilename Name of the standard output file for Teradata MultiLoad messages on network-attached systems

    The outfilename specification redirects the standard output (stdout). If an out file name specification is not entered, the default is stdout.

    Caution: If an outfilename specification to redirect stdout is used, do not use the same outfilename as an output or echo destination in the DISPLAY command or ROUTE MESSAGES command. Doing so produces incomplete results because of the conflicting write operations to the same file.

    -r 'Teradata MultiLoad command'

    Invocation option that can signify the start of a Teradata MultiLoad job on a network-attached system

    Sinc eonly specify one Teradata MultiLoad command as the Teradata MultiLoad command specification, it is usually a RUN FILE command that specifies the file containing the Teradata MultiLoad job script.

    Table 9: Runtime Parameters (Network-Attached Configurations) (continued)

    Parameter Description

    Teradata MultiLoad Reference 37

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    Note: For sample JCL listings, commands, and output samples for the invocation options, see the invocation examples in Appendix B: Invocation Examples.

    -u outputencoding Encoding form of the job output

    The parameter is valid only when the UTF-16 client character set is used. If the client character set being used is not UTF-16and this parameter is specified, Teradata MultiLoad reports an error and terminates.

    When this parameter is used, place it in front of other runtime parameters to ensure that the whole job output is printed in the desired encoding form.

    If is not placed ahead of other runtime parameters when invoking the job, a warning message will be printed.

    Available output encoding options are:

    UTF-16BE, or UTF16-BE, or UTF16BE

    UTF-16LE, or UTF16-LE, or UTF16LE

    UTF-16 or UTF16

    UTF-16BE, or UTF16-BE, or UTF16BE instructs Teradata MultiLoad to print the job output in big endian UTF-16 encoding scheme.

    UTF-16LE instructs Teradata MultiLoad to print the job output in little endian UTF-16 encoding scheme. On big endian client systems, UTF-16instructs Teradata MultiLoad to print the job output in big endian UTF-16encoding scheme. On little endian client systems, UTF-16instructs Teradata MultiLoad to print the job output in little endian UTF-16 encoding scheme.

    The UTF-16 BOM is not printed as a part of job output. If Teradata MultiLoad console output needs to be redirected to a log file on network platforms, -u outputencoding must be specified.

    -V Display version number and stop.

    -y Specification for the data encryption option

    When specified at run time, all sessions will be encrypted.

    Table 9: Runtime Parameters (Network-Attached Configurations) (continued)

    Parameter Description

    38 Teradata MultiLoad Reference

  • Chapter 2: Using Teradata MultiLoadInvoking Teradata MultiLoad

    z/OS Example

    The following procedure invokes Teradata MultiLoad on a channel-attached z/OS client system:

    //MLOADRUN JOB 1,'Teradata MultiLoad',

    // MSGCLASS=X,// NOTIFY=MLOAD,//* TYPRUN=SCAN,// CLASS=A/*ROUTE PRINT TSO//**************************************************//* *

    //* Teradata MultiLoad PROC *

    //* *//**************************************************//*//MLOAD PROC PRM=,INPUT=//MLOADSTP EXEC PGM=MLOAD,PARM='&PRM'//STEPLIB DD DISP=SHR,DSN=TERADATA.APPLOAD// DD DISP=SHR,DSN=TERADATA.TRLOAD//SYSPRINT DD SYSOUT=*//SYSTERM DD SYSOUT=*//SYSIN DD DISP=SHR,DSN=&INPUT// PEND//**************************************************//* *

    //* RUN Teradata MultiLoad *

    //* *//**************************************************//MLOADRUN EXEC PROC=MLOAD//MLOADSTP.SYSIN DD DATA,DLM=##.SET X TO 'FSADFDFSDFDS';.DISPLAY '&X' TO FILE OUTPUT; ##//OUTPUT DD SYSOUT=*

    UNIX and Windows Examples

    Following are examples of ways to invoke Teradata MultiLoad on network-attached UNIX and Windows systems:

    mload /home/mluser/tests/out1

    This command specifies both an input file and an output file:

    /home/mluser/tests/test1 is the input file that provides the Teradata MultiLoad job script.

    /home/mluser/tests/out1 is the destination file for output data.

    mload

  • Chapter 2: Using Teradata MultiLoadTerminating Teradata MultiLoad

    This command specifies neither an input nor an output device. In this case, a terminal provides both the command input and the output data destination.

    mload -r '.RUN FILE mld.startup;'

    This command uses the-r invocation option to specify the Teradata MultiLoad RUN FILE

    command. In this case, the Teradata MultiLoad job script is in the mld.startup file.

    Terminating Teradata MultiLoad

    This section covers methods of termination and other topics related to terminating Teradata MultiLoad.

    The following are ways to terminate Teradata MultiLoad.

    Normal Termination

    Abort Termination

    Either way ends the Teradata MultiLoad sessions and logs off Teradata Database. A normal termination, however, does so in an orderly, controlled fashion, and returns messages indicating the status of the Teradata MultiLoad job. An abort termination does not.

    Warning: If a Teradata MultiLoad job is aborted during the data acquisition phase and inadvertently restart

    the job with different data, Teradata MultiLoad does not recognize that this new data is not valid. Make sure the same data is used to avoid corrupting the target table.

    Caution: Make sure to terminate any pending or paused jobs prior to upgrading to a new release of Teradata Database. Database upgrades can effect changes to the Teradata MultiLoad

    worktable, if a pending job created using a different release restarts after an upgrade, errors might result.

    Normal Termination

    Including the Teradata MultiLoad LOGOFF command in a Teradata MultiLoad job script terminates the utility normally on both network-attached and channel-attached client systems. The following syntax diagram illustrated the command.

    Teradata MultiLoad logs off all sessions with Teradata Database and returns a status message indicating:

    The total processor time that was used

    The job start and stop date/time

    The highest return code (termination return code) that was encountered:

    2409A033

    .LOGOFF

    retcode

    ;

    40 Teradata MultiLoad Reference

  • Chapter 2: Using Teradata MultiLoadTerminating Teradata MultiLoad

    0 if the job completed normally

    4 if a warning condition occurred

    8 if a user error occurred

    12 if a fatal error occurred

    16 if no message destination is available

    Teradata MultiLoad also:

    Either maintains or drops the restart log table, depending on the success or failure of the job.

    If specified, returns the optional retcode value to the client operating system.

    For more information about return codes and the conditions that maintain or drop the restart log table, see LOGOFF on page 162.

    Abort Termination

    The procedure for aborting a Teradata MultiLoad job depends on whether the utility is running on a network-attached or a channel-attached client system.

    To abort a Teradata MultiLoad job running on a network-attached client system

    Press the Control + C key combination three times on the workstation keyboard.

    Note: Some session(s) of the aborted Teradata MultiLoad job may remain active until the gateway time-out period expires. Error 2574 Operation not allowed: %DBID.%FSTR is

    being MLoaded. may occur if the same Teradata MultiLoad job is resubmitted within the

    time-out period. If this happens, wait until the gateway time out has expi