Datastage Parallel Job Advanced Developers Guide
Datastage Parallel Job Advanced Developers Guide
The software delivered to Licensee may contain third-party software code. See Legal Notices (legalnotices.pdf) for
more information.
How to Use this Guide
Documentation Conventions
This manual uses the following conventions:
Convention Usage
Bold In syntax, bold indicates commands, function names, keywords,
and options that must be input exactly as shown. In text, bold
indicates keys to press, function names, and menu selections.
itemA | itemB A vertical bar separating items indicates that you can choose
only one item. Do not type the vertical bar.
... Three periods indicate that more of the same type of item can
optionally follow.
Convention Usage
This line The continuation character is used in source code examples to
➥ continues indicate a line that is too long to fit on the page, but must be
entered as a single line on screen.
DataStage Documentation
DataStage documentation includes the following:
DataStage Director Guide: This guide describes the DataStage
Director and how to validate, schedule, run, and monitor
DataStage parallel jobs.
DataStage Manager Guide: This guide describes the DataStage
Manager and describes how to use and maintain the DataStage
Repository.
DataStage Designer Guide: This guide describes the DataStage
Designer, and gives a general description of how to create, design,
and develop a DataStage application.
DataStage Server: Server Job Developer’s Guide: This guide
describes the tools that are used in building a server job, and it
supplies programmer’s reference information..
DataStage Enterprise Edition: Parallel Job Developer’s
Guide: This guide describes the tools that are used in building a
parallel job, and it supplies programmer’s reference information.
DataStage Enterprise Edition: Parallel Job Advanced
Developer’s Guide: This guide gives more specialized
information about parallel job design.
DataStage Enterprise MVS Edition: Mainframe Job
Developer’s Guide: This guide describes the tools that are used
in building a mainframe job, and it supplies programmer’s
reference information..
DataStage Administrator Guide: This guide describes
DataStage setup, routine housekeeping, and administration.
DataStage Install and Upgrade Guide. This guide contains
instructions for installing DataStage on Windows and UNIX
platforms, and for upgrading existing installations of DataStage.
DataStage NLS Guide. This Guide contains information about
using the NLS features that are available in DataStage when NLS
is installed.
These guides are also available online in PDF format. You can read
them using the Adobe Acrobat Reader supplied with DataStage. See
Install and Upgrade Guide for details on installing the manuals and
the Adobe Acrobat Reader.
You can use the Acrobat search facilities to search the whole
DataStage document set. To use this feature, select Edit ➤ Search
then choose the All PDF documents in option and specify the
DataStage docs directory (by default this is C:\Program
Files\Ascential\DataStage\Docs).
Extensive online help is also supplied. This is particularly useful when
you have become familiar with DataStage, and need to look up
specific information.
Chapter 1
Introduction
Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Chapter 2
Job Design Tips
DataStage Designer Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Processing Large Volumes of Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Modular Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Designing for Good Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Combining Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4
Sorting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Default and Explicit Type Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Using Transformer Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7
Using Sequential File Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Using Database Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8
Database Sparse Lookup vs. Join . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
DB2 Database Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9
Oracle Database Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
Teradata Database Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11
Chapter 3
Improving Performance
Understanding a Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Score Dumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Example Score Dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Tips for Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Performance Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
JOB MONITOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Iostat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Load Average . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
Runtime Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5
OS/RDBMS Specific Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Selectively Rewriting the flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6
Identifying Superfluous Repartitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Identifying Buffering Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7
Resolving Bottlenecks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Choosing the Most Efficient Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Partitioner Insertion, Sort Insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8
Combinable Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
Ensuring Data is Evenly Partitioned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10
Platform Specific Tuning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
Tru64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11
HP-UX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
AIX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Disk Space Requirements of Post-Release 7.0.1 Datasets . . . . . . . . . . . . . . . 3-12
Chapter 4
Link Buffering
Buffering Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Controlling Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Buffering Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
Overriding Default Buffering Behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Operators with Special Buffering Requirements. . . . . . . . . . . . . . . . . . . . . 4-5
Chapter 5
Specifying Your Own Parallel Stages
Defining Custom Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Defining Build Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10
Build Stage Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21
How Your Code is Executed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23
Inputs and Outputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24
Example Build Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25
Defining Wrapped Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31
Example Wrapped Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-40
Chapter 6
Environment Variables
Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
APT_BUFFER_FREE_RUN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6
APT_BUFFER_MAXIMUM_MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
APT_BUFFER_MAXIMUM_TIMEOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
APT_BUFFER_DISK_WRITE_INCREMENT . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
APT_BUFFERING_POLICY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
APT_SHARED_MEMORY_BUFFERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7
Building Custom Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
DS_OPERATOR_BUILDOP_DIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
OSH_BUILDOP_CODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
OSH_BUILDOP_HEADER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
OSH_BUILDOP_OBJECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
OSH_BUILDOP_XLC_BIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-8
OSH_CBUILDOP_XLC_BIN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
APT_COMPILER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
APT_COMPILEOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
APT_LINKER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
APT_LINKOPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9
DB2 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
APT_DB2INSTANCE_HOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
APT_DB2READ_LOCK_TABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
APT_DBNAME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
APT_RDBMS_COMMIT_ROWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
DB2DBDFT. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-10
APT_DEBUG_OPERATOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
APT_DEBUG_MODULE_NAMES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
APT_DEBUG_PARTITION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
APT_DEBUG_SIGNALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11
APT_DEBUG_STEP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
APT_DEBUG_SUBPROC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
APT_EXECUTION_MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12
APT_PM_DBX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_PM_GDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_PM_LADEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_PM_SHOW_PIDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_PM_XLDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_PM_XTERM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13
APT_SHOW_LIBLOAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Decimal Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_DECIMAL_INTERM_PRECISION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_DECIMAL_INTERM_SCALE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_DECIMAL_INTERM_ROUND_MODE . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
Disk I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_BUFFER_DISK_WRITE_INCREMENT . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_CONSISTENT_BUFFERIO_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14
APT_EXPORT_FLUSH_COUNT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
APT_IO_MAP/APT_IO_NOMAP and
APT_BUFFERIO_MAP/APT_BUFFERIO_NOMAP . . . . . . . . . . . . . . . . . 6-15
APT_PHYSICAL_DATASET_BLOCK_SIZE. . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
General Job Administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
APT_CHECKPOINT_DIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15
APT_CLOBBER_OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
APT_CONFIG_FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
APT_DISABLE_COMBINATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
APT_EXECUTION_MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16
APT_ORCHHOME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
APT_STARTUP_SCRIPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
APT_NO_STARTUP_SCRIPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17
APT_STARTUP_STATUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
APT_THIN_SCORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-18
Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28
APT_DUMP_SCORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
APT_ERROR_CONFIGURATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29
APT_MSG_FILELINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
APT_PM_PLAYER_MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30
APT_PM_PLAYER_TIMING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
APT_RECORD_COUNTS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
OSH_DUMP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
OSH_ECHO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
OSH_EXPLAIN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
OSH_PRINT_SCHEMAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-31
SAS Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_HASH_TO_SASHASH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_NO_SASOUT_INSERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_NO_SAS_TRANSFORMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_SAS_ACCEPT_ERROR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_SAS_CHARSET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32
APT_SAS_CHARSET_ABORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_COMMAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SASINT_COMMAND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_DEBUG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_DEBUG_IO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_DEBUG_LEVEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_DEBUG_VERBOSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33
APT_SAS_NO_PSDS_USTRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
APT_SAS_S_ARGUMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
APT_SAS_SCHEMASOURCE_DUMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
APT_SAS_SHOW_INFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
APT_SAS_TRUNCATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
Sorting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34
APT_NO_SORT_INSERTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35
APT_SORT_INSERTION_CHECK_ONLY . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35
Chapter 7
DataStage Development Kit (Job Control Interfaces)
DataStage Development Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
The dsapi.h Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Data Structures, Result Data, and Threads . . . . . . . . . . . . . . . . . . . . . . . . . 7-2
Writing DataStage API Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3
Building a DataStage API Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
Redistributing Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
API Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-4
DSAddEnvVar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-7
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8
DSAddProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-9
DSCloseJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10
DSCloseProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11
DSDeleteEnvVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12
DSDeleteProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13
DSFindFirstLogEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15
DSFindNextLogEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-16
DSGetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-17
DSGetJobInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-19
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-20
DSGetLastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-21
DSGetLastErrorMsg. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
Rermarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22
DSGetLinkInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24
DSGetLogEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25
DSGetNewestLogId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27
DSGetParamInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28
DSGetProjectInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30
DSGetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31
DSGetReposInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33
DSGetReposUsage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-35
DSGetStageInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-36
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-36
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-36
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-37
DSGetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-38
DSListEnvVars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-39
DSListProjectProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-40
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-41
DSLockJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-42
DSLogEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-43
DSMakeJobReport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-44
DSOpenJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-45
DSOpenProject. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-46
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-46
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-46
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-46
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-46
DSRunJob. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-47
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-47
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-47
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-47
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-47
DSSetEnvVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-49
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-50
DSSetGenerateOpMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-51
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-51
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-51
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-51
DSSetJobLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-52
DSSetParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-54
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-54
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-54
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-54
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-55
DSSetProjectProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-56
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-56
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-56
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-57
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-57
DSSetServerParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-58
DSStopJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-59
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-59
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-59
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-59
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-59
DSUnlockJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-60
DSWaitForJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-61
Data Structures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-62
DSCUSTINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-63
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-63
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-63
DSJOBINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-64
DSLINKINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-67
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-67
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-67
DSLOGDETAIL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-68
DSLOGEVENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-69
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-69
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-69
DSPARAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-70
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-70
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-70
DSPARAMINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-72
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-72
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-72
DSPROJECTINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-74
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-74
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-74
DSREPOSINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-75
DSREPOSUSAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-76
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-76
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-76
DSSTAGEINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-77
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-77
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-77
DSLINKINFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-79
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-79
Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-79
Error Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-80
DataStage BASIC Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-87
DSAttachJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-90
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-90
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-90
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-90
DSCheckRoutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-91
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-91
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-91
DSDetachJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-92
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-92
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-92
DSExecute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-93
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-93
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-93
DSGetCustInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-94
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-94
DSIPCPageProps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-95
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-95
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-95
DSGetJobInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-96
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-96
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-99
Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-99
DSGetJobMetaBag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-100
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-100
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-100
DSGetLinkInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-101
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-101
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-102
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-102
DSGetLinkMetaData. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-103
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-103
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-103
DSGetLogEntry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-104
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-104
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-104
DSGetLogSummary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-105
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-105
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-106
DSGetNewestLogId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-107
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-107
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-107
DSGetParamInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-108
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-108
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-109
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-109
DSGetProjectInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-111
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-111
DSGetStageInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-112
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-112
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-114
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-114
DSGetStageLinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-115
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-115
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-115
DSGetStagesOfType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-116
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-116
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-116
DSGetStagesTypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-117
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-117
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-117
DSGetProjectInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-118
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-118
DSLogEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-119
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-119
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-119
DSLogFatal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-120
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-120
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-120
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-120
DSLogInfo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-121
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-121
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-121
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-121
DSLogToController . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-122
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-122
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-122
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-122
DSLogWarn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-123
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-123
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-123
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-123
DSMakeJobReport. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-124
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-124
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-124
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-124
DSMakeMsg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-125
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-125
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-125
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-125
DSPrepareJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-126
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-126
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-126
DSRunJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-127
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-127
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-127
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-127
DSSendMail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-128
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-128
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-129
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-129
DSSetGenerateOpMetaData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-130
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-130
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-130
DSSetJobLimit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-131
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-131
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-131
DSSetParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-132
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-132
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-132
DSSetUserStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-133
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-133
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-133
DSStopJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-134
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-134
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-134
DSTransformError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-135
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-135
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-135
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-135
DSTranslateCode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-136
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-136
Remarks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-136
Example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-136
DSWaitForFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-137
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-137
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-137
DSWaitForJob . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-138
Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-138
Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-138
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-138
Job Status Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-139
Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-140
Commands for Controlling DataStage Jobs . . . . . . . . . . . . . . . . . . . . . . 7-140
Commands for Administering DataStage . . . . . . . . . . . . . . . . . . . . . . . . 7-151
Commands for Searching Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-157
XML Schemas and Sample Stylesheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-162
Appendix A
Header Files
C++ Classes – Sorted By Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-1
C++ Macros – Sorted By Header File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A-6
This manual is intended for the DataStage Enterprise Edition user who
has mastered the basics of parallel job design and now wants to
progress further.
The manual covers the following topics:
Job Design Tips. This chapter contains miscellaneous tips about
designing parallel jobs, from use of the DataStage Designer
interface to handling large volumes of data.
Improving Performance. This chapter describes methods by which
you can evaluate the performance of your parallel job designs and
come up with strategies for improving them.
Link Buffering. This chapter contains an in-depth description of
when and how DataStage buffers data within a job, and how you
can change the automatic settings if required.
Specifying Your Own Parallel Stages. This chapter describe the
interface DataStage provides for defining your own parallel job
stage types.
Environment Variables. This chapter list all the environment
variables that are available for affecting the set up and operation
of parallel jobs.
DataStage Development Kit (Job Control Interfaces). This chapter
lists the various interfaces that enable you to run and control
DataStage jobs without using the DataStage Director client.
Terminology
Because of the technical nature of some of the descriptions in this
manual, we sometimes talks about details of the engine that drives
parallel jobs. This involves the use of terms that may be unfamiliar to
ordinary parallel job users.
Operators. These underlie the stages in a DataStage job. A single
stage may correspond to a single operator, or a number of
operators, depending on the properties you have set, and whether
you have chosen to partition or collect or sort data on the input
link to a stage. At compilation, DataStage evaluates your job
design and will sometimes optimize operators out if they are
judged to be superfluous, or insert other operators if they are
needed for the logic of the job.
OSH. This is the scripting language used internally by the
DataStage Enterprise Edition engine.
Players. Players are the workhorse processes in a parallel job.
There is generally a player for each operator on each node. Players
are the children of section leaders; there is one section leader per
processing node. Section leaders are started by the conductor
process running on the conductor node (the conductor node is
defined in the configuration file).
This chapter gives some hints and tips for the good design of parallel
jobs.
Modular Development
You should aim to use modular development techniques in your job
designs in order to maximize the reuse of parallel jobs and
components and save yourself time.
Use job parameters in your design and supply values at run time.
This allows a single job design to process different data in
different circumstances, rather than producing multiple copies of
the same job with slightly different arguments.
Using job parameters allows you to exploit the DataStage
Director’s multiple invocation capability. You can run several
invocations of a job at the same time with different runtime
arguments.
Use shared containers to share common logic across a number of
jobs. Remember that shared containers are inserted when a job is
compiled. If the shared container is changed, the jobs using it will
need recompiling (you can use the Usage Analysis tool in the
DataStage Manager to help you identify the jobs, and the multiple
job compile tool to recompile them).
Combining Data
The two major ways of combining data in a DataStage job are via a
Lookup stage or a Join stage. How do you decide which one to use?
Lookup and Join stages perform equivalent operations: combining
two or more input datasets based on one or more specified keys.
When one unsorted input is very large or sorting is not feasible,
Lookup is preferred. When all inputs are of manageable size or are
pre-sorted, Join is the preferred solution.
The Lookup stage is most appropriate when the reference data for all
Lookup stages in a job is small enough to fit into available physical
memory. Each lookup reference requires a contiguous block of
physical memory. The Lookup stage requires all but the first input (the
primary input) to fit into physical memory.
If the reference to a lookup is directly from a DB2 or Oracle table and
the number of input rows is significantly smaller than the reference
rows, 1:100 or more, a Sparse Lookup may be appropriate.
If performance issues arise while using Lookup, consider using the
Join stage. The Join stage must be used if the datasets are larger than
available memory resources.
Sorting Data
Look at job designs and try to reorder the job flow to combine
operations around the same sort keys if possible, and coordinate your
sorting strategy with your hashing strategy. It is sometimes possible
to rearrange the order of business logic within a job flow to leverage
the same sort order, partitioning, and groupings.
If data has already been partitioned and sorted on a set of key
columns, specify the “don’t sort, previously sorted” option for the key
columns in the Sort stage. This reduces the cost of sorting and takes
greater advantage of pipeline parallelism.
When writing to parallel data sets, sort order and partitioning are
preserved. When reading from these data sets, try to maintain this
sorting if possible by using Same partitioning method.
The stable sort option is much more expensive than non-stable sorts,
and should only be used if there is a need to maintain row order other
than as needed to perform the sort.
The performance of individual sorts can be improved by increasing
the memory usage per partition using the Restrict Memory Usage
(MB) option of the Sort stage. The default setting is 20 MB per
partition. Note that sort memory usage can only be specified for
standalone Sort stages, it cannot be changed for inline (on a link)
sorts.
Destination Field
Source
timestamp
Field
decimal
uint32
uint64
uint16
string
dfloat
sfloat
uint8
int32
int64
int16
time
date
raw
int8 int8
d, d d d d d d d d d, d d, m m m
m m m
uint8 d d d d d d d d d d d
int16 d, d d d d d d d d d d,
m m
uint16 d d d d d d d d d d d
int32 d, d d d d d d d d d d, m m
m m
uint32 d d d d d d d d d d m m
int64 d, d d d d d d d d d d
m
uint64 d d d d d d d d d d d
sfloat d, d d d d d d d d d d
m
dfloat d, d d d d d d d d d, d, d, m m
m m m m
decimal d, d d d d, d d, d, d d, d, d,
m m m m m m m
string d, d d, d d d, d d d d, d, d, m m m
m m m m m m
raw m m d
date m m m m m m m
time m m m m d d,
m
timestamp m m m m m m d
You should also note the following points about type conversion:
When converting from variable-length to fixed-length strings
using default conversions, parallel jobs pad the remaining length
with NULL (ASCII zero) characters.
The default value is 2. Setting this too low on a large system can
result in so many players that the job fails due to insufficient
resources.
requestedsessions. This is a number between 1 and the number of
vprocs in the database. The default is the maximum number of
available sessions.
Understanding a Flow
In order to resolve any performance issues it is essential to have an
understanding of the flow of DataStage jobs.
Score Dumps
To help understand a job flow we suggest you take a score dump. Do
this by setting the APT_DUMP_SCORE environment variable true and
running the job (APT _DUMP_SCORE can be set in the Administrator
client, under the Parallel ➤ Reporting branch). This causes a report to
be produced which shows the operators, processes and data sets in
the job. The report includes information about:
Where and how data is repartitioned.
Whether DataStage had inserted extra operators in the flow.
The degree of parallelism each operator runs with, and on which
nodes.
Information about where data is buffered.
The dump score information is included in the job log when you run a
job.
The score dump is particularly useful in showing you where
DataStage is inserting additional components in the job flow. In
particular DataStage will add partition and sort operators where the
logic of the job demands it. Sorts in particular can be detrimental to
performance and a score dump can help you to detect superfluous
operators and amend the job design to remove them.
Performance Monitoring
There are various tools you can you use to aid performance
monitoring, some provided with DataStage and some general UNIX
tools.
JOB MONITOR
You access the DataStage job monitor through the DataStage Director
(see "Monitoring Jobs" in DataStage Director Guide). You can also use
certain dsjob commands from the command line to access monitoring
functions (see "Retrieving Information" on page 7-145 for details).
The Job Monitor provides a useful snapshot of a job’s performance at
a moment of execution, but does not provide thorough performance
metrics. That is, a Job Monitor snapshot should not be used in place
of a full run of the job, or a run with a sample set of data. Due to
buffering and to some job semantics, a snapshot image of the flow
may not be a representative sample of the performance over the
course of the entire job.
The CPU summary information provided by the Job Monitor is useful
as a first approximation of where time is being spent in the flow.
However, it does not include any sorts or similar that may be inserted
automatically in a parallel job. For these components, the score dump
can be of assistance. See "Score Dumps" on page 3-1.
A worst-case scenario occurs when a job flow reads from a data set,
and passes immediately to a sort on a link. The job will appear to
hang, when, in fact, rows are being read from the data set and passed
to the sort.
Iostat
The UNIX tool Iostat is useful for examining the throughput of various
disk resources. If one or more disks have high throughput,
understanding where that throughput is coming from is vital. If there
are spare CPU cycles, IO is often the culprit.
The specifics of Iostat output vary slightly from system to system.
Here is an example from a Linux machine which slows a relatively
light load:
(The first set of output is cumulative data since the machine was
booted)
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
dev8-0 13.50 144.09 122.33 346233038 293951288
...
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
dev8-0 4.00 0.00 96.00 0 96
Load Average
Ideally, a performant job flow should be consuming as much CPU as is
available. The load average on the machine should be two to three
times the value as the number of processors on the machine (for
example, an 8-way SMP should have a load average of roughly 16-24).
Some operating systems, such as HPUX, show per-processor load
average. In this case, load average should be 2-3, regardless of
number of CPUs on the machine.
If the machine is not CPU-saturated, it indicates a bottleneck may exist
elsewhere in the flow. A useful strategy in this case is to over-partition
your data, as more partitions cause extra processes to be started,
utilizing more of the available CPU power.
If the flow cause the machine to be fully loaded (all CPUs at 100%),
then the flow is likely to be CPU limited, and some determination
needs to be made as to where the CPU time is being spent (setting the
APT_PM_PLAYER _TIMING environment variable can be helpful here -
see the following section).
The commands top or uptime can provide the load average.
Runtime Information
When you set the APT_PM_PLAYER_TIMING environment variable,
information is provided for each operator in a job flow. This
information is written to the job log when the job is run.
An example output is:
##I TFPM 000324 08:59:32(004) <generator,0> Calling runLocally: step=1,
node=rh73dev04, op=0, ptn=0
##I TFPM 000325 08:59:32(005) <generator,0> Operator completed. status:
APT_StatusOk elapsed: 0.04 user: 0.00 sys: 0.00 suser: 0.09 ssys:
0.02 (total CPU: 0.11)
##I TFPM 000324 08:59:32(006) <peek,0> Calling runLocally: step=1,
node=rh73dev04, op=1, ptn=0
##I TFPM 000325 08:59:32(012) <peek,0> Operator completed. status:
APT_StatusOk elapsed: 0.01 user: 0.00 sys: 0.00 suser: 0.09 ssys:
0.02 (total CPU: 0.11)
##I TFPM 000324 08:59:32(013) <peek,1> Calling runLocally: step=1,
node=rh73dev04a, op=1, ptn=1
##I TFPM 000325 08:59:32(019) <peek,1> Operator completed. status:
APT_StatusOk elapsed: 0.00 user: 0.00 sys: 0.00 suser: 0.09 ssys:
0.02 (total CPU: 0.11)¨
Performance Analysis
Once you have carried out some performance monitoring, you can
analyze your results.
Bear in mind that, in a parallel job flow, certain operators may
complete before the entire flow has finished, but the job isn’t
successful until the slowest operator has finished all its processing.
to a data set can be helpful if the data’s point of origin is a flat file or
RDBMS.
This pattern should be followed, removing any potentially suspicious
operators while trying to keep the rest of the flow intact. Removing
any custom stages should be at the top of the list.
broken up. For example, replacing an Oracle write stage with a copy
stage vastly improves performance, and writing that same data to a
data set, then loading via an Oracle stage, also goes quickly. When the
two are put together, performance is poor.
"Buffering" on page 3-10 details specific, common buffering
configurations aimed at resolving various bottlenecks.
Resolving Bottlenecks
Combinable Operators
Combined operators generally improve performance at least slightly
(in some cases the difference is dramatic). There may also be
situations where combining operators actually hurts performance,
however. Identifying such operators can be difficult without trial and
error.
The most common situation arises when multiple operators are
performing disk I/O (for example, the various file stages and sort). In
these sorts of situations, turning off combination for those specific
stages may result in a performance increase if the flow is I/O bound.
Combinable operators often provide a dramatic performance increase
when a large number of variable length fields are used in a flow.
Disk I/O
Total disk throughput is often a fixed quantity that DataStage has no
control over. It can, however, be beneficial to follow some rules.
If data is going to be read back in, in parallel, it should never be
written as a sequential file. A data set or file set stage is a much
more appropriate format.
Buffering
Buffering is intended to slow down input to match the consumption
rate of the output. When the downstream operator reads very slowly,
or not at all, for a length of time, upstream operators begin to slow
down. This can cause a noticeable performance loss if the buffer’s
optimal behavior is something other than rate matching.
By default, each link has a 3 MB in-memory buffer. Once that buffer
reaches half full, the operator begins to push back on the upstream
operator’s rate. Once the 3 MB buffer is filled, data is written to disk in
1 MB chunks.
Tru64
In some cases improved performance can been achieved by setting
the virtual memory “eager” setting (vm_aggressive_swap kernel
parameter). This will aggressively swap processes out of memory to
free up physical memory for the running processes.
HP-UX
HP-UX has a limitation when running in 32-bit mode, which limits
memory mapped I/O to 2 GB per machine. This can be an issue when
dealing with large lookups. The Memory Windows options can
provide a work around for this memory limitation. Ascential Product
Support can provide this document on request.
AIX
If you are running DataStage Enterprise Edition on an RS/6000 SP or a
network of workstations, verify your setting of the network parameter
thewall (see "Configuring for Enterprise Edition" in DataStage Install
and Upgrade Guide for details).
Buffering Assumptions
This section describes buffering in more detail, and in particular the
design assumptions underlying its default behavior.
Buffering in DataStage is designed around the following assumptions:
Buffering is primarily intended to remove the potential for
deadlock in flows with fork-join structure.
Controlling Buffering
DataStage offers two ways of controlling the operation of buffering:
you can use environment variables to control buffering on all links of
all stages in all jobs, or you can make individual settings on the links
of particular stages via the stage editors.
Buffering Policy
You can set this via the APT_BUFFERING_POLICY environment
variable, or via the Buffering mode field on the Inputs or Outputs
Page Advanced tab for individual stage editors.
The environment variable has the following possible values:
The default setting for Buffer free run is 0.5 for the environment
variable, (50% for Buffer free run on the Advanced tab), which
means that half of the internal memory buffer can be consumed
before pushback occurs. This biases the buffer operator to avoid
allowing buffered data to be written to disk.
If your stage needs to buffer large data sets, we recommend that you
initially set Buffer free run to a very large value such as 1000, and then
adjust according to the needs of your application. This will allow the
buffer operator to freely use both memory and disk space in order to
accept incoming data without pushback.
Ascential Software recommends that you set the Buffer free run
property only for those links between stages that require a non-
default value; this means altering the setting on the Inputs page or
Outputs page Advanced tab of the stage editors, not the
environment variable.
Where:
– property_name is the name of the property (usually ‘schema’)
– format_properties are formatting information supplied on the
Format page (if the stage has one).
The settings you use depend on the type of property you are
specifying:
– Specify a category to have the property appear under this
category in the stage editor. By default all properties appear in
the Options category.
– Specify that the property will be hidden and not appear in the
stage editor. This is primarily intended to support the case
where the underlying operator needs to know the JobName.
This can be passed using a mandatory String property with a
default value that uses a DS Macro. However, to prevent the
user from changing the value, the property needs to be hidden.
– If you are specifying a List category, specify the possible values
for list members in the List Value field.
Code that is executed at the end of the stage (after all records have
been processed).
Code that is executed every time the stage processes a record.
Compilation and build details for actually building the stage.
The Code for the Build stage is specified in C++. There are a number of
macros available to make the job of coding simpler (see "Build Stage
Macros" on page 5-21). There are also a number of header files
available containing many useful functions, see Appendix A.
When you have specified the information, and request that the stage
is generated, DataStage generates a number of files and then
compiles these to build an operator which the stage executes. The
generated files include:
Header files (ending in .h)
Source files (ending in .c)
Object files (ending in .so)
The following shows a build stage in diagrammatic form:
Build Stage
The settings you use depend on the type of property you are
specifying:
– Specify a category to have the property appear under this
category in the stage editor. By default all properties appear in
the Options category.
– If you are specifying a List category, specify the possible values
for list members in the List Value field.
– If the property is to be a dependent of another property, select
the parent property in the Parents field.
– Specify an expression in the Template field to have the actual
value of the property generated at compile time. It is usually
based on values in other properties and columns.
– Specify an expression in the Conditions field to indicate that
the property is only valid if the conditions are met. The
specification of this property is a bar '|' separated list of
conditions that are AND'ed together. For example, if the
specification was a=b|c!=d, then this property would only be
valid (and therefore only available in the GUI) when property a
is equal to b, and property c is not equal to d.
Click OK when you are happy with the extended properties.
7 Click on the Build page. The tabs here allow you to define the
actual operation that the stage will perform.
Informational Macros
Use these macros in your code to determine the number of inputs,
outputs, and transfers as follows:
inputs(). Returns the number of inputs to the stage.
outputs(). Returns the number of outputs from the stage.
transfers(). Returns the number of transfers in the stage.
Flow-Control Macros
Use these macros to override the default behavior of the Per-Record
loop in your stage definition:
endLoop(). Causes the operator to stop looping, following
completion of the current loop and after writing any auto outputs
for this loop.
nextLoop() Causes the operator to immediately skip to the start of
next loop, without writing any outputs.
failStep() Causes the operator to return a failed status and
terminate the job.
Transfer Macros
These macros allow you to explicitly control the transfer of individual
records.
Each of the macros takes an argument as follows:
input is the index of the input (0 to n). If you have defined a name
for the input port you can use this in place of the index in the form
portname.portid_.
d Writes one record for each output, except where any of the
following is true:
– The output has Auto Write set to false.
– The discardRecord() macro was called for the output during
the current loop iteration.
4 If you have specified code in the Post-loop sub-tab, executes it.
5 Returns a status, which is written to the DataStage Job Log.
Using Inputs with Auto Read Enabled for Some and Disabled
for Others
You define one (or possibly more) inputs as Auto Read, and the rest
with Auto Read disabled. You code the stage in such a way as the
processing of records from the Auto Read input drives the processing
of the other inputs. Each time round the loop, your code should call
inputDone() on the Auto Read input and call exitLoop() to complete
the actions of the stage.
This method is fine where you process a record from the Auto Read
input every time around the loop, and then process records from one
or more of the other inputs depending on the results of processing the
Auto Read record.
To demonstrate the use of properties, the stage also lets you define a
minimum divisor. If the number you are dividing by is smaller than
the minimum divisor you specify when adding the stage to a job, then
the record is also rejected.
The input to the stage is defined as auto read, while the two outputs
have auto write disabled. The code has to explicitly write the data to
one or other of the output links. In the case of a successful division the
data written is the original record plus the result of the division and
any remainder. In the case of a rejected record, only the original
record is written.
The input record has two columns: dividend and divisor. Output 0 has
four columns: dividend, divisor, result, and remainder. Output 1 (the
reject link) has two columns: dividend and divisor.
If the divisor column of an input record contains zero or is less than
the specified minimum divisor, the record is rejected, and the code
uses the macro transferAndWriteRecord(1) to transfer the data to port
1 and write it. If the divisor is not zero, the code uses doTransfersTo(0)
to transfer the input record to Output 0, assigns the division results to
result and remainder and finally calls writeRecord(0) to write the
record to output 0.
The following screen shots show how this stage is defined in
DataStage using the Stage Type dialog box:
Details about the outputs are given on the Output sub-tab of the
Interfaces tab.
Note When you use the stage in a job, make sure that you use
table definitions compatible with the tables defined in
the input and output sub-tabs.
Details about the transfers carried out by the stage are defined on
the Transfer sub-tab of the Interfaces tab.
5 The code itself is defined on the Logic tab. In this case all the
processing is done in the Per-Record loop and so is entered on the
Per-Record sub-tab.
6 As this example uses all the compile and build defaults, all that
remains is to click Generate to build the stage.
32 x 32 Bitmap button and browse for the large bitmap file. Click
the Reset Bitmap Info button to revert to using the default
DataStage icon for this stage.
The settings you use depend on the type of property you are
specifying:
– Specify a category to have the property appear under this
category in the stage editor. By default all properties appear in
the Options category.
– If you are specifying a List category, specify the possible values
for list members in the List Value field.
– If the property is to be a dependent of another property, select
the parent property in the Parents field.
– Specify an expression in the Template field to have the actual
value of the property generated at compile time. It is usually
based on values in other properties and columns.
– Specify an expression in the Conditions field to indicate that
the property is only valid if the conditions are met. The
specification of this property is a bar '|' separated list of
conditions that are AND'ed together. For example, if the
specification was a=b|c!=d, then this property would only be
valid (and therefore only available in the GUI) when property a
is equal to b, and property c is not equal to d.
Click OK when you are happy with the extended properties.
7 Go to the Wrapped page. This allows you to specify information
about the command to be executed by the stage and how it will be
handled.
Details about inputs to the stage are defined on the Inputs sub-
tab:
– Link. The link number, this is assigned for you and is read-
only. When you actually use your stage, links will be assigned
in the order in which you add them. In our example, the first
link will be taken as link 0, the second as link 1 and so on. You
can reassign the links using the stage editor’s Link Ordering
tab on the General page.
– Table Name. The meta data for the link. You define this by
loading a table definition from the Repository. Type in the
name, or browse for a table definition. Alternatively, you can
specify an argument to the UNIX command which specifies a
table definition. In this case, when the wrapped stage is used in
a job design, the designer will be prompted for an actual table
definition to use.
In the case of a file, you should also specify whether the file to be
read is given in a command line argument, or by an environment
variable.
Details about outputs from the stage are defined on the Outputs
sub-tab:
– Link. The link number, this is assigned for you and is read-
only. When you actually use your stage, links will be assigned
in the order in which you add them. In our example, the first
link will be taken as link 0, the second as link 1 and so on. You
can reassign the links using the stage editor’s Link Ordering
tab on the General page.
– Table Name. The meta data for the link. You define this by
loading a table definition from the Repository. Type in the
name, or browse for a table definition.
– Stream. Here you can specify whether the UNIX command
will write its output to standard out, or another stream, or
whether it outputs to a file. Click on the browse button to open
the Wrapped Stream dialog box.
In the case of a file, you should also specify whether the file to
be written is specified in a command line argument, or by an
environment variable.
3 The fact that the sort command expects two files as input is
defined on the Input sub-tab on the Interfaces tab of the
Wrapper page.
4 The fact that the sort command outputs to a file is defined on the
Output sub-tab on the Interfaces tab of the Wrapper page.
Note When you use the stage in a job, make sure that you use
table definitions compatible with the tables defined in
the input and output sub-tabs.
5 Because all exit codes other than 0 are treated as errors, and
because there are no special environment requirements for this
command, you do not need to alter anything on the Environment
tab of the Wrapped page. All that remains is to click Generate to
build the stage.
There are many environment variables that affect the design and
running of parallel jobs in DataStage. Commonly used ones are
exposed in the DataStage Administrator client, and can be set or
unset using the Administrator (see"Setting Environment Variables" in
DataStage Administrator Guide). There are additional environment
variables, however. This chapter describes all the environment
variables that apply to parallel jobs. They can be set or unset as you
would any other UNIX system variables, or you can add them to the
User Defined section in the DataStage Administrator environment
variable tree.
The available environment variables are grouped according to
function. They are summarized in the following table.
The final section in this chapter gives some guidance to setting the
environment variables..
APT_BUFFER_MAXIMUM_MEMORY
APT_BUFFER_MAXIMUM_TIMEOUT
APT_BUFFER_DISK_WRITE_INCREMENT
APT_BUFFERING_POLICY
APT_SHARED_MEMORY_BUFFERS
OSH_BUILDOP_CODE
OSH_BUILDOP_HEADER
OSH_BUILDOP_XLC_BIN
OSH_CBUILDOP_XLC_BIN
Compiler APT_COMPILER
APT_COMPILEOPT
APT_LINKER
APT_LINKOPT
APT_DB2READ_LOCK_TABLE
APT_DBNAME
APT_RDBMS_COMMIT_ROWS
DB2DBDFT
Debugging APT_DEBUG_OPERATOR
APT_DEBUG_MODULE_NAMES
APT_DEBUG_PARTITION
APT_DEBUG_SIGNALS
APT_DEBUG_STEP
APT_DEBUG_SUBPROC
APT_EXECUTION_MODE
APT_PM_DBX
APT_PM_GDB
APT_PM_LADEBUG
APT_PM_SHOW_PIDS
APT_PM_XLDB
APT_PM_XTERM
APT_SHOW_LIBLOAD
APT_DECIMAL_INTERM_SCALE
APT_DECIMAL_INTERM_ROUND_MODE
APT_CONSISTENT_BUFFERIO_SIZE
APT_IO_MAP/APT_IO_NOMAP and
APT_BUFFERIO_MAP/APT_BUFFERIO_NOMAP
APT_PHYSICAL_DATASET_BLOCK_SIZE
APT_CLOBBER_OUTPUT
APT_CONFIG_FILE
APT_DISABLE_COMBINATION
APT_EXECUTION_MODE
APT_ORCHHOME
APT_STARTUP_SCRIPT
APT_NO_STARTUP_SCRIPT
APT_STARTUP_STATUS
APT_THIN_SCORE
APT_MONITOR_TIME
APT_NO_JOBMON
APT_PERFORMANCE_DATA
Miscellaneous APT_COPY_TRANSFORM_OPERATOR
APT_DATE_CENTURY_BREAK_YEAR
APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
APT_IMPORT_REJECT_STRING_FIELD_OVERRUNS
APT_INSERT_COPY_BEFORE_MODIFY
APT_OLD_BOUNDED_LENGTH
APT_OPERATOR_REGISTRY_PATH
APT_PM_NO_SHARED_MEMORY
APT_PM_NO_NAMED_PIPES
APT_PM_SOFT_KILL_WAIT
APT_PM_STARTUP_CONCURRENCY
APT_RECORD_COUNTS
APT_SAVE_SCORE
APT_STACK_TRACE
APT_WRITE_DS_VERSION
OSH_PRELOAD_LIBS
Network APT_IO_MAXIMUM_OUTSTANDING
APT_IOMGR_CONNECT_ATTEMPTS
APT_PM_CONDUCTOR_HOSTNAME
APT_PM_NO_TCPIP
APT_PM_NODE_TIMEOUT
APT_PM_SHOWRSH
APT_PM_USE_RSH_LOCALLY
NLS APT_COLLATION_SEQUENCE
APT_COLLATION_STRENGTH
APT_ENGLISH_MESSAGES
APT_IMPEXP_CHARSET
APT_INPUT_CHARSET
APT_OS_CHARSET
APT_OUTPUT_CHARSET
APT_STRING_CHARSET
APT_ORACLE_LOAD_OPTIONS
APT_ORACLE_NO_OPS
APT_ORACLE_PRESERVE_BLANKS
APT_ORA_IGNORE_CONFIG_FILE_PARALLELISM
APT_ORA_WRITE_FILES
APT_ORAUPSERT_COMMIT_ROW_INTERVAL
APT_ORAUPSERT_COMMIT_TIME_INTERVAL
Partitioning APT_NO_PART_INSERTION
APT_PARTITION_COUNT
APT_PARTITION_NUMBER
APT_FILE_EXPORT_BUFFER_SIZE
APT_IMPORT_PATTERN_USES_FILESET
APT_MAX_DELIMITED_READ_SIZE
APT_PREVIOUS_FINAL_DELIMITER_COMPATIBLE
APT_STRING_PADCHAR
Reporting APT_DUMP_SCORE
APT_ERROR_CONFIGURATION
APT_MSG_FILELINE
APT_PM_PLAYER_MEMORY
APT_PM_PLAYER_TIMING
APT_RECORD_COUNTS
OSH_DUMP
OSH_ECHO
OSH_EXPLAIN
OSH_PRINT_SCHEMAS
APT_NO_SASOUT_INSERT
APT_NO_SAS_TRANSFORMS
APT_SAS_ACCEPT_ERROR
APT_SAS_CHARSET
APT_SAS_CHARSET_ABORT
APT_SAS_COMMAND
APT_SASINT_COMMAND
APT_SAS_DEBUG
APT_SAS_DEBUG_IO
APT_SAS_DEBUG_LEVEL
APT_SAS_DEBUG_VERBOSE
APT_SAS_NO_PSDS_USTRING
APT_SAS_S_ARGUMENT
APT_SAS_SCHEMASOURCE_DUMP
APT_SAS_TRUNCATION
Sorting APT_NO_SORT_INSERTION
APT_SORT_INSERTION_CHECK_ONLY
APT_TERA_NO_ERR_CLEANUP
APT_TERA_NO_PERM_CHECKS
APT_TERA_NO_SQL_CONVERSION
APT_TERA_SYNC_DATABASE
APT_TERA_SYNC_USER
APT_LATENCY_COEFFICIENT
APT_DEFAULT_TRANSPORT_BLOCK_SIZE
APT_MAX_TRANSPORT_BLOCK_SIZE/
APT_MIN_TRANSPORT_BLOCK_SIZE
Buffering
These environment variable are all concerned with the buffering
DataStage performs on stage links to avoid deadlock situations. These
settings can also be made on the Inputs page or Outputs page
Advanced tab of the parallel stage editors.
APT_BUFFER_FREE_RUN
This environment variable is available in the DataStage Administrator,
under the Parallel category. It specifies how much of the available in-
memory buffer to consume before the buffer resists. This is expressed
as a decimal representing the percentage of Maximum memory buffer
size (for example, 0.5 is 50%). When the amount of data in the buffer is
less than this value, new data is accepted automatically. When the
data exceeds it, the buffer first tries to write some of the data it
contains before accepting more.
The default value is 50% of the Maximum memory buffer size. You can
set it to greater than 100%, in which case the buffer continues to store
APT_BUFFER_MAXIMUM_MEMORY
Sets the default value of Maximum memory buffer size. The default
value is 3145728 (3 MB). Specifies the maximum amount of virtual
memory, in bytes, used per buffer.
APT_BUFFER_MAXIMUM_TIMEOUT
DataStage buffering is self tuning, which can theoretically lead to long
delays between retries. This environment variable specified the
maximum wait before a retry in seconds, and is by default set to 1.
APT_BUFFER_DISK_WRITE_INCREMENT
Sets the size, in bytes, of blocks of data being moved to/from disk by
the buffering operator. The default is 1048576 (1 MB). Adjusting this
value trades amount of disk access against throughput for small
amounts of data. Increasing the block size reduces disk access, but
may decrease performance when data is being read/written in smaller
units. Decreasing the block size increases throughput, but may
increase the amount of disk access.
APT_BUFFERING_POLICY
This environment variable is available in the DataStage Administrator,
under the Parallel category. Controls the buffering policy for all virtual
data sets in all steps. The variable has the following settings:
AUTOMATIC_BUFFERING (default). Buffer a data set only if
necessary to prevent a data flow deadlock.
FORCE_BUFFERING. Unconditionally buffer all virtual data sets.
Note that this can slow down processing considerably.
NO_BUFFERING. Do not buffer data sets. This setting can cause
data flow deadlock if used inappropriately.
APT_SHARED_MEMORY_BUFFERS
Typically the number of shared memory buffers between two
processes is fixed at 2. Setting this will increase the number used. The
likely result of this is POSSIBLY both increased latency and increased
performance. This setting can significantly increase memory use.
DS_OPERATOR_BUILDOP_DIR
Identifies the directory in which generated buildops are created. By
default this identifies a directory called buildop under the current
project directory. If the directory is changed, the corresponding entry
in APT_OPERATOR_REGISTRY_PATH needs to change to match the
buildop folder.
OSH_BUILDOP_CODE
Identifies the directory into which buildop writes the generated .C file
and build script. It defaults to the current working directory. The -C
option of buildop overrides this setting.
OSH_BUILDOP_HEADER
Identifies the directory into which buildop writes the generated .h file.
It defaults to the current working directory. The -H option of buildop
overrides this setting.
OSH_BUILDOP_OBJECT
Identifies the directory into which buildop writes the dynamically
loadable object file, whose extension is .so on Solaris, .sl on HP-UX, or
.o on AIX. Defaults to the current working directory.
The -O option of buildop overrides this setting.
OSH_BUILDOP_XLC_BIN
AIX only. Identifies the directory specifying the location of the shared
library creation command used by buildop.
On older AIX systems this defaults to /usr/lpp/xlC/bin/
makeC++SharedLib_r for thread-safe compilation. On newer AIX
systems it defaults to /usr/ibmcxx/bin/makeC++SharedLib_r. For non-
thread-safe compilation, the default path is the same, but the name of
the file is makeC++SharedLib.
OSH_CBUILDOP_XLC_BIN
AIX only. Identifies the directory specifying the location of the shared
library creation command used by cbuildop. If this environment
variable is not set, cbuildop checks the setting of
OSH_BUILDOP_XLC_BIN for the path. On older AIX systems
OSH_CBUILDOP_XLC_BIN defaults to /usr/lpp/xlC/bin/
makeC++SharedLib_r for thread-safe compilation. On newer AIX
systems it defaults to /usr/ibmcxx/bin/makeC++SharedLib_r. For non-
threadsafe compilation, the default path is the same, but the name of
the command is makeC++SharedLib.
Compiler
These environment variables specify details about the C++ compiler
used by DataStage in connection with parallel jobs.
APT_COMPILER
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Compiler branch. Specifies the full path to the
C++ compiler.
APT_COMPILEOPT
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Compiler branch. Specifies extra options to be
passed to the C++ compiler when it is invoked.
APT_LINKER
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Compiler branch. Specifies the full path to the
C++ linker.
APT_LINKOPT
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Compiler branch. Specifies extra options to be
passed to the C++ linker when it is invoked.
DB2 Support
These environment variables are concerned with setting up access to
DB2 databases from DataStage.
APT_DB2INSTANCE_HOME
Specifies the DB2 installation directory. This variable is set by
DataStage to values obtained from the DB2Server table, representing
the currently selected DB2 server.
APT_DB2READ_LOCK_TABLE
If this variable is defined and the open option is not specified for the
DB2 stage, DataStage performs the following open command to lock
the table:
lock table 'table_name' in share mode
APT_DBNAME
Specifies the name of the database if you choose to leave out the
Database option for DB2 stages. If APT_DBNAME is not defined as
well, DB2DBDFT is used to find the database name. These variables
are set by DataStage to values obtained from the DB2Server table,
representing the currently selected DB2 server.
APT_RDBMS_COMMIT_ROWS
Specifies the number of records to insert into a data set between
commits. The default value is 2048.
DB2DBDFT
For DB2 operators, you can set the name of the database by using the
-dbname option or by setting APT_DBNAME. If you do not use either
method, DB2DBDFT is used to find the database name. These
variables are set by DataStage to values obtained from the DB2Server
table, representing the currently selected DB2 server.
Debugging
These environment variables are concerned with the debugging of
DataStage parallel jobs.
APT_DEBUG_OPERATOR
Specifies the operators on which to start debuggers. If not set, no
debuggers are started. If set to an operator number (as determined
from the output of APT_DUMP_SCORE), debuggers are started for
that single operator. If set to -1, debuggers are started for all
operators.
APT_DEBUG_MODULE_NAMES
This comprises a list of module names separated by white space that
are the modules to debug, i.e., where internal IF_DEBUG statements
will be run. The subproc operator module (module name is
"subproc") is one example of a module that uses this facility.
APT_DEBUG_PARTITION
Specifies the partitions on which to start debuggers. One instance, or
partition, of an operator is run on each node running the operator. If
set to a single number, debuggers are started on that partition; if not
set or set to -1, debuggers are started on all partitions.
See the description of APT_DEBUG_OPERATOR for more information
on using this environment variable.
For example, setting APT_DEBUG_STEP to 0,
APT_DEBUG_OPERATOR to 1, and APT_DEBUG_PARTITION to -1
starts debuggers for every partition of the second operator in the first
step.
APT_DEBUG_SIGNALS
You can use the APT_DEBUG_SIGNALS environment variable to
specify that signals such as SIGSEGV, SIGBUS, etc., should cause a
APT_DEBUG_STEP
Specifies the steps on which to start debuggers. If not set or if set to -
1, debuggers are started on the processes specified by
APT_DEBUG_OPERATOR and APT_DEBUG_PARTITION in all steps. If
set to a step number, debuggers are started for processes in the
specified step.
APT_DEBUG_SUBPROC
Display debug information about each subprocess operator.
APT_EXECUTION_MODE
This environment variable is available in the DataStage Administrator
under the Parallel branch. By default, the execution mode is parallel,
with multiple processes. Set this variable to one of the following
values to run an application in sequential execution mode:
ONE_PROCESS one-process mode
MANY_PROCESS many-process mode
NO_SERIALIZE many-process mode, without serialization
In ONE_PROCESS mode:
The application executes in a single UNIX process. You need only
run a single debugger session and can set breakpoints anywhere
in your code.
Data is partitioned according to the number of nodes defined in
the configuration file.
Each operator is run as a subroutine and is called the number of
times appropriate for the number of partitions on which it must
operate.
In MANY_PROCESS mode the framework forks a new process for
each instance of each operator and waits for it to complete rather than
calling operators as subroutines.
In both cases, the step is run entirely on the Conductor node rather
than spread across the configuration.
APT_PM_DBX
Set this environment variable to the path of your dbx debugger, if a
debugger is not already included in your path. This variable sets the
location; it does not run the debugger.
APT_PM_GDB
Linux only. Set this environment variable to the path of your xldb
debugger, if a debugger is not already included in your path. This
variable sets the location; it does not run the debugger.
APT_PM_LADEBUG
Tru64 only. Set this environment variable to the path of your dbx
debugger, if a debugger is not already included in your path. This
variable sets the location; it does not run the debugger.
APT_PM_SHOW_PIDS
If this variable is set, players will output an informational message
upon startup, displaying their process id.
APT_PM_XLDB
Set this environment variable to the path of your xldb debugger, if a
debugger is not already included in your path. This variable sets the
location; it does not run the debugger.
APT_PM_XTERM
If DataStage invokes dbx, the debugger starts in an xterm window;
this means DataStage must know where to find the xterm program.
The default location is /usr/bin/X11/xterm. You can override this
default by setting the APT_PM_XTERM environment variable to the
appropriate path. APT_PM_XTERM is ignored if you are using xldb.
APT_SHOW_LIBLOAD
If set, dumps a message to stdout every time a library is loaded. This
can be useful for testing/verifying the right library is being loaded.
Note that the message is output to stdout, NOT to the error log.
Decimal Support
APT_DECIMAL_INTERM_PRECISION
Specifies the default maximum precision value for any decimal
intermediate variables required in calculations. Default value is 38.
APT_DECIMAL_INTERM_SCALE
Specifies the default scale value for any decimal intermediate
variables required in calculations. Default value is 10.
APT_DECIMAL_INTERM_ROUND_MODE
Specifies the default rounding mode for any decimal intermediate
variables required in calculations. The default is round_inf.
Disk I/O
These environment variables are all concerned with when and how
DataStage parallel jobs write information to disk.
APT_BUFFER_DISK_WRITE_INCREMENT
For systems where small to medium bursts of I/O are not desirable,
the default 1MB write to disk size chunk size may be too small.
APT_BUFFER_DISK_WRITE_INCREMENT controls this and can be set
larger than 1048576 (1 MB). The setting may not exceed
max_memory * 2/3.
APT_CONSISTENT_BUFFERIO_SIZE
Some disk arrays have read ahead caches that are only effective when
data is read repeatedly in like-sized chunks. Setting
APT_EXPORT_FLUSH_COUNT
Allows the export operator to flush data to disk more often than it
typically does (data is explicitly flushed at the end of a job, although
the OS may choose to do so more frequently). Set this variable to an
integer which, in number of records, controls how often flushes
should occur. Setting this value to a low number (such as 1) is useful
for real time applications, but there is a small performance penalty
associated with setting this to a low value.
APT_PHYSICAL_DATASET_BLOCK_SIZE
Specify the block size to use for reading and writing to a data set
stage. The default is 128 KB.
APT_CHECKPOINT_DIR
This environment variable is available in the DataStage Administrator
under the Parallel branch. By default, when running a job, DataStage
stores state information in the current working directory. Use
APT_CHECKPOINT_DIR to specify another directory.
APT_CLOBBER_OUTPUT
This environment variable is available in the DataStage Administrator
under the Parallel branch. By default, if an output file or data set
already exists, DataStage issues an error and stops before overwriting
it, notifying you of the name conflict. Setting this variable to any value
permits DataStage to overwrite existing files or data sets without a
warning message.
APT_CONFIG_FILE
This environment variable is available in the DataStage Administrator
under the Parallel branch. Sets the path name of the configuration file.
(You may want to include this as a job parameter, so that you can
specify the configuration file at job run time).
APT_DISABLE_COMBINATION
This environment variable is available in the DataStage Administrator
under the Parallel branch. Globally disables operator combining.
Operator combining is DataStage’s default behavior, in which two or
more (in fact any number of) operators within a step are combined
into one process where possible.
You may need to disable combining to facilitate debugging. Note that
disabling combining generates more UNIX processes, and hence
requires more system resources and memory. It also disables internal
optimizations for job efficiency and run times.
APT_EXECUTION_MODE
This environment variable is available in the DataStage Administrator
under the Parallel branch. By default, the execution mode is parallel,
with multiple processes. Set this variable to one of the following
values to run an application in sequential execution mode:
ONE_PROCESS one-process mode
MANY_PROCESS many-process mode
NO_SERIALIZE many-process mode, without serialization
In ONE_PROCESS mode:
The application executes in a single UNIX process. You need only
run a single debugger session and can set breakpoints anywhere
in your code.
Data is partitioned according to the number of nodes defined in
the configuration file.
APT_ORCHHOME
Must be set by all DataStage Enterprise Edition users to point to the
top-level directory of the DataStage Enterprise Edition installation.
APT_STARTUP_SCRIPT
As part of running an application, DataStage creates a remote shell on
all DataStage processing nodes on which the job runs. By default, the
remote shell is given the same environment as the shell from which
DataStage is invoked. However, you can write an optional startup
shell script to modify the shell configuration of one or more
processing nodes. If a startup script exists, DataStage runs it on
remote shells before running your application.
APT_STARTUP_SCRIPT specifies the script to be run. If it is not
defined, DataStage searches ./startup.apt, $APT_ORCHHOME/etc/
startup.apt and $APT_ORCHHOME/etc/startup, in that order.
APT_NO_STARTUP_SCRIPT disables running the startup script.
APT_NO_STARTUP_SCRIPT
Prevents DataStage from executing a startup script. By default, this
variable is not set, and DataStage runs the startup script. If this
variable is set, DataStage ignores the startup script. This may be
useful when debugging a startup script. See also
APT_STARTUP_SCRIPT.
APT_STARTUP_STATUS
Set thi sto cause messages to be generated as parallel job startup
moves from phase to phase. This can be useful as a diagnostic if
parallel job startup is failing.
APT_THIN_SCORE
Setting this variable decreases the memory usage of steps with 100
operator instances or more by a noticable amount. To use this
optimization, set APT_THIN_SCORE=1 in your environment. There are
no performance benefits in setting this variable unless you are
running out of real memory at some point in your flow or the
additional memory is useful for sorting or buffering. This variable
does not affect any specific operators which consume large amounts
of memory, but improves general parallel job memory handling.
Job Monitoring
These environment variables are concerned with the Job Monitor on
DataStage.
APT_MONITOR_SIZE
This environment variable is available in the DataStage Administrator
under the Parallel branch. Determines the minimum number of
records the DataStage Job Monitor reports. The default is 5000
records.
APT_MONITOR_TIME
This environment variable is available in the DataStage Administrator
under the Parallel branch. Determines the minimum time interval in
seconds for generating monitor information at runtime. The default is
5 seconds. This variable takes precedence over APT_MONITOR_SIZE.
APT_NO_JOBMON
Turn off job monitoring entirely.
APT_PERFORMANCE_DATA
Set this variable to turn on performance data output generation.
APT_PERFORMANCE_DATA can be either set with no value, or be set
Miscellaneous
APT_COPY_TRANSFORM_OPERATOR
If set, distributes the shared object file of the sub-level transform
operator and the shared object file of user-defined functions (not
extern functions) via distribute-component in a non-NFS MPP.
APT_DATE_CENTURY_BREAK_YEAR
Four digit year which marks the century two-digit dates belong to. It is
set to 1900 by defult.
APT_IMPEXP_ALLOW_ZERO_LENGTH_FIXED_NULL
When set, allows zero length null_field value with fixed length fields.
This should be used with care as poorly formatted data will cause
incorrect results. By default a zero length null_field value will cause
an error.
APT_IMPORT_REJECT_STRING_FIELD_OVERRUNS
When set, DataStage will reject any string or ustring fields read that
go over their fixed size. By default these records are truncated.
APT_INSERT_COPY_BEFORE_MODIFY
When defined, turns on automatic insertion of a copy operator before
any modify operator (WARNING: if this variable is not set and the
operator immediately preceding 'modify' in the data flow uses a
modify adapter, the 'modify' operator will be removed from the data
flow).
Only set this if you write your own custom operators AND use modify
within those operators.
APT_OLD_BOUNDED_LENGTH
Some parallel datasets generated with DataStage 7.0.1 and later
releases require more disk space when the columns are of type
APT_OPERATOR_REGISTRY_PATH
Used to locate operator .apt files, which define what operators are
available and which libraries they are found in.
APT_PM_NO_SHARED_MEMORY
By default, shared memory is used for local connections. If this
variable is set, named pipes rather than shared memory are used for
local connections. If both APT_PM_NO_NAMED_PIPES and
APT_PM_NO_SHARED_MEMORY are set, then TCP sockets are used
for local connections.
APT_PM_NO_NAMED_PIPES
Specifies not to use named pipes for local connections. Named pipes
will still be used in other areas of DataStage, including subprocs and
setting up of the shared memory transport protocol in the process
manager.
APT_PM_SOFT_KILL_WAIT
Delay between SIGINT and SIGKILL during abornal job shutdown.
Gives time for processes to run cleanups if they catch SIGINT. Defaults
to ZERO.
APT_PM_STARTUP_CONCURRENCY
Setting this to a small integer determines the number of simultaneous
section leader startups to be allowed. Setting this to 1 forces
sequential startup. The default is defined by SOMAXCONN in sys/
socket.h (currently 5 for Solaris, 10 for AIX).
APT_RECORD_COUNTS
Causes DataStage to print, for each operator Player, the number of
records consumed by getRecord() and produced by putRecord().
Abandoned input records are not necessarily accounted for. Buffer
operators do not print this information.
APT_SAVE_SCORE
Sets the name and path of the file used by the performance monitor to
hold temporary score data. The path must be visible from the host
machine. The performance monitor creates this file, therefore it need
not exist when you set this variable.
APT_SHOW_COMPONENT_CALLS
This forces DataStage to display messages at job check time as to
which user overloadable functions (such as checkConfig and
describeOperator) are being called. This will not produce output at
runtime and is not guaranteed to be a complete list of all user-
overloadable functions being called, but an effort is made to keep this
synchronized with any new virtual functions provided.
APT_STACK_TRACE
This variable controls the number of lines printed for stack traces. The
values are:
unset. 10 lines printed
0. infinite lines printed
N. N lines printed
none. no stack trace
The last setting can be used to disable stack traces entirely.
APT_WRITE_DS_VERSION
By default, DataStage saves data sets in the Orchestrate Version 4.1
format. APT_WRITE_DS_VERSION lets you save data sets in formats
compatible with previous versions of Orchestrate.
The values of APT_WRITE_DS_VERSION are:
v3_0. Orchestrate Version 3.0
v3. Orchestrate Version 3.1.x
v4. Orchestrate Version 4.0
OSH_PRELOAD_LIBS
Specifies a colon-separated list of names of libraries to be loaded
before any other processing. Libraries containing custom operators
must be assigned to this variable or they must be registered. For
example, in Korn shell syntax:
$ export OSH_PRELOAD_LIBS="orchlib1:orchlib2:mylib1"
Network
These environment variables are concerned with the operation of
DataStage parallel jobs over a network.
APT_IO_MAXIMUM_OUTSTANDING
Sets the amount of memory, in bytes, allocated to a DataStage job on
every physical node for network communications. The default value is
2097152 (2MB).
When you are executing many partitions on a single physical node,
this number may need to be increased.
APT_IOMGR_CONNECT_ATTEMPTS
Sets the number of attempts for a TCP connect in case of a connection
failure. This is necessary only for jobs with a high degree of
parallelism in an MPP environment. The default value is 2 attempts (1
retry after an initial failure).
APT_PM_CONDUCTOR_HOSTNAME
The network name of the processing node from which you invoke a
job should be included in the configuration file as either a node or a
fastname. If the network name is not included in the configuration file,
DataStage users must set the environment variable
APT_PM_CONDUCTOR_HOSTNAME to the name of the node invoking
the DataStage job.
APT_PM_NO_TCPIP
This turns off use of UNIX sockets to communicate between player
processes at runtime. If the job is being run in an MPP (non-shared
memory) environment, do not set this variable, as UNIX sockets are
your only communications option.
APT_PM_NODE_TIMEOUT
This controls the number of seconds that the conductor will wait for a
section leader to start up and load a score before deciding that
something has failed. The default for starting a section leader process
is 30. The default for loading a score is 120.
APT_PM_SHOWRSH
Displays a trace message for every call to RSH.
APT_PM_USE_RSH_LOCALLY
If set, startup will use rsh even on the conductor node.
NLS Support
These environment variables are concerned with DataStage’s
implementation of NLS.
Warning You should not change the settings of any of these
environment variables other than APT_COLLATION
_STRENGTH if NLS is enabled on your server.
APT_COLLATION_SEQUENCE
This variable is used to specify the global collation sequence to be
used by sorts, compares, etc. This value can be overriden at the stage
level.
APT_COLLATION_STRENGTH
Set this to specify the defines the specifics of the collation algorithm.
This can be used to ignore accents, punctuation or other details.
It is set to one of Identical, Primary, Secondary, Tertiary, or Quartenary.
Setting it to Default unsets the environment variable. For an
explanation of possible settings, see:
http://oss.software.ibm.com/icu/userguide/Collate_Concepts.html
APT_ENGLISH_MESSAGES
If set to 1, outputs every message issued with its English equivalent.
APT_IMPEXP_CHARSET
Controls the character encoding of ustring data imported and
exported to and from DataStage, and the record and field properties
applied to ustring fields. Its syntax is:
APT_IMPEXP_CHARSET icu_character_set
APT_INPUT_CHARSET
Controls the character encoding of data input to schema and
configuration files. Its syntax is:
APT_INPUT_CHARSET icu_character_set
APT_OS_CHARSET
Controls the character encoding DataStage uses for operating system
data such as the names of created files and the parameters to system
calls. Its syntax is:
APT_OS_CHARSET icu_character_set
APT_OUTPUT_CHARSET
Controls the character encoding of DataStage output messages and
operators like peek that use the error logging system to output data
input to the osh parser. Its syntax is:
APT_OUTPUT_CHARSET icu_character_set
APT_STRING_CHARSET
Controls the character encoding DataStage uses when performing
automatic conversions between string and ustring fields. Its syntax is:
APT_STRING_CHARSET icu_character_set
Oracle Support
These environment variables are concerned with the interaction
between DataStage and Oracle databases.
APT_ORACLE_LOAD_DELIMITED
If this is defined, the orawrite operator creates delimited records when
loading into Oracle sqlldr. This method preserves leading and trailing
blanks within string fields (VARCHARS in the database). The value of
this variable is used as the delimiter. If this is defined without a value,
the default delimiter is a comma. Note that you cannot load a string
which has embedded double quotes if you use this.
APT_ORACLE_LOAD_OPTIONS
You can use the environment variable APT_ORACLE_LOAD_OPTIONS
to control the options that are included in the Oracle load control
file.You can load a table with indexes without using the Index Mode or
Disable Constraints properties by setting the
APT_ORACLE_LOAD_OPTIONS environment variable appropriately.
You need to set the Direct option and/or the PARALLEL option to
FALSE, for example:
APT_ORACLE_LOAD_OPTIONS='OPTIONS(DIRECT=FALSE,PARALLEL=TRUE)'
In this example the stage would still run in parallel, however, since
DIRECT is set to FALSE, the conventional path mode rather than the
direct path mode would be used.
If loading index organized tables (IOTs), you should not set both
DIRECT and PARALLEL to true as direct parallel path load is not
allowed for IOTs.
For more details about loading Oracle tables with indexes, see
"Loading Tables" in Parallel Job Developer’s Guide.
APT_ORACLE_NO_OPS
Set this if you do not have Oracle Parallel server installed on an AIX
system. It disables the OPS checking mechanism on the Oracle
Enterprise stage.
APT_ORACLE_PRESERVE_BLANKS
Set this to set the PRESERVE BLANKS option in the control file. This
preserves leading and trailing spaces. When PRESERVE BLANKS is
not set Oracle removes the spaces and considers fields with only
spaces to be NULL values.
APT_ORA_IGNORE_CONFIG_FILE_PARALLELISM
By default DataStage determines the number of processing nodes
available for a parallel write to Oracle from the configuration file. Set
APT_ORA_IGNORE_CONFIG_FILE_PARALLELISM to use the number
of data files in the destination table’s tablespace instead.
APT_ORA_WRITE_FILES
Set this to prevent the invocation of the Oracle loader when write
mode is selceted on an Oracle Enterprise destination stage. Instead,
the sqlldr commands are written to a file, the name of which is
specified by this environment variable. The file can be invoked once
the job has finished to run the loaders sequentially. This can be useful
in tracking down export and pipe-safety issues related to the loader.
APT_ORAUPSERT_COMMIT_ROW_INTERVAL
APT_ORAUPSERT_COMMIT_TIME_INTERVAL
These two environment variables work together to specify how often
target rows are committed when using the Upsert method to write to
Oracle.
Commits are made whenever the time interval period has passed or
the row interval is reached, whichever comes first. By default,
commits are made every 2 seconds or 5000 rows.
Partitioning
The following environment variables are concerned with how
DataStage automatically partitions data.
APT_NO_PART_INSERTION
DataStage automatically inserts partition components in your
application to optimize the performance of the stages in your job. Set
this variable to prevent this automatic insertion.
APT_PARTITION_COUNT
Read only. DataStage sets this environment variable to the number of
partitions of a stage. The number is based both on information listed
in the configuration file and on any constraints applied to the stage.
The number of partitions is the degree of parallelism of a stage. For
APT_PARTITION_NUMBER
Read only. On each partition, DataStage sets this environment
variable to the index number (0, 1, ...) of this partition within the stage.
A subprocess can then examine this variable when determining which
partition of an input file it should handle.
APT_DELIMITED_READ_SIZE
By default, the DataStage will read ahead 500 bytes to get the next
delimiter. For streaming inputs (socket, FIFO, etc.) this is sub-optimal,
since the DataStage may block (and not output any records).
DataStage, when reading a delimited record, will read this many bytes
(minimum legal value for this is 2) instead of 500. If a delimiter is NOT
available within N bytes, N will be incremented by a factor of 2 (when
this environment variable is not set, this changes to 4).
APT_FILE_IMPORT_BUFFER_SIZE
The value in kilobytes of the buffer for reading in files. The default is
128 (i.e., 128 KB). It can be set to values from 8 upward, but is clamped
to a minimum value of 8. That is, if you set it to a value less than 8,
then 8 is used. Tune this upward for long-latency files (typically from
heavily loaded file servers).
APT_FILE_EXPORT_BUFFER_SIZE
The value in kilobytes of the buffer for writing to files. The default is
128 (i.e., 128 KB). It can be set to values from 8 upward, but is clamped
to a minimum value of 8. That is, if you set it to a value less than 8,
then 8 is used. Tune this upward for long-latency files (typically from
heavily loaded file servers).
APT_IMPORT_PATTERN_USES_FILESET
When this is set, DataStage will turn any file pattern into a fileset
before processing the files. This allows the files to be processed in
parallel as apposed to sequentially. By default file pattern will cat the
files together to be used as the input.
APT_MAX_DELIMITED_READ_SIZE
By default, when reading, DataStage will read ahead 500 bytes to get
the next delimiter. If it is not found, DataStage looks ahead
4*500=2000 (1500 more) bytes, and so on (4X) up to 100,000 bytes.
This variable controls the upper bound which is by default 100,000
bytes. Note that this variable should be used instead of
APT_DELIMITED_READ_SIZE when a larger than 500 bytes read-
ahead is desired.
APT_PREVIOUS_FINAL_DELIMITER_COMPATIBLE
Set this to revert to the pre-release 7.5 behavior of the final delimiter
whereby, when writing data, a space is inserted after every field in a
record including the last one. (The new behavior is that the a space is
written after every field except the last one).
APT_STRING_PADCHAR
Overrides the pad character of 0x0 (ASCII null), used by default when
DataStage extends, or pads, a string field to a fixed length.
Reporting
These environment variables are concerned with various aspects of
DataStage jobs reporting their progress.
APT_DUMP_SCORE
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. Configures DataStage to print
a report showing the operators, processes, and data sets in a running
job.
APT_ERROR_CONFIGURATION
Controls the format of DataStage output messages.
Warning Changing these settings can seriously interfere with
DataStage logging.
This variable’s value is a comma-separated list of keywords (see table
below). Each keyword enables a corresponding portion of the
message. To disable that portion of the message, precede it with a “!”.
Default formats of messages displayed by DataStage include the
keywords severity, moduleId, errorIndex, timestamp, opid, and
message.
The following table lists keywords, the length (in characters) of the
associated components in the message, and the keyword’s meaning.
The characters "##" precede all messages. The keyword lengthprefix
appears in three locations in the table. This single keyword controls
the display of all length prefixes.
1 Newline character
APT_MSG_FILELINE
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. Set this to have DataStage log
extra internal information for parallel jobs.
APT_PM_PLAYER_MEMORY
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. Setting this variable causes
each player process to report the process heap memory allocation in
the job log when returning.
APT_PM_PLAYER_TIMING
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. Setting this variable causes
each player process to report its call and return in the job log. The
message with the return is annotated with CPU times for the player
process.
APT_RECORD_COUNTS
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. Causes DataStage to print to
the job log, for each operator player, the number of records input and
output. Abandoned input records are not necessarily accounted for.
Buffer operators do not print this information.
OSH_DUMP
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. If set, it causes DataStage to
put a verbose description of a job in the job log before attempting to
execute it.
OSH_ECHO
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. If set, it causes DataStage to
echo its job specification to the job log after the shell has expanded all
arguments.
OSH_EXPLAIN
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. If set, it causes DataStage to
place a terse description of the job in the job log before attempting to
run it.
OSH_PRINT_SCHEMAS
This environment variable is available in the DataStage Administrator
under the Parallel ➤ Reporting branch. If set, it causes DataStage to
print the record schema of all data sets and the interface schema of all
operators in the job log.
SAS Support
These environment variables are concerned with DataStage
interaction with SAS.
APT_HASH_TO_SASHASH
The DataStage hash partitioner contains support for hashing SAS
data. In addition, DataStage provides the sashash partitioner which
uses an alternative non-standard hashing algorithm. Setting the
APT_HASH_TO_SASHASH environment variable causes all
appropriate instances of hash to be replaced by sashash. If the
APT_NO_SAS_TRANSFORMS environment variable is set,
APT_HASH_TO_SASHASH has no affect.
APT_NO_SASOUT_INSERT
This variable selectively disables the sasout operator insertions. It
maintains the other SAS-specific transformations.
APT_NO_SAS_TRANSFORMS
DataStage automatically performs certain types of SAS-specific
component transformations, such as inserting an sasout operator and
substituting sasRoundRobin for RoundRobin. Setting the
APT_NO_SAS_TRANSFORMS variable prevents DataStage from
making these transformations.
APT_SAS_ACCEPT_ERROR
When a SAS procedure causes SAS to exit with an error, this variable
prevents the SAS-interface operator from terminating. The default
behavior is for DataStage to terminate the operator with an error.
APT_SAS_CHARSET
When the -sas_cs option of a SAS-interface operator is not set and a
SAS-interface operator encounters a ustring, DataStage interrogates
this variable to determine what character set to use. If this variable is
not set, but APT_SAS_CHARSET_ABORT is set, the operator will abort;
otherwise the -impexp_charset option or the APT_IMPEXP_CHARSET
environment variable is accessed. Its syntax is:
APT_SAS_CHARSET icu_character_set | SAS_DBCSLANG
APT_SAS_CHARSET_ABORT
Causes a SAS-interface operator to abort if DataStage encounters a
ustring in the schema and neither the -sas_cs option nor the
APT_SAS_CHARSET environment variable is set.
APT_SAS_COMMAND
Overrides the $PATH directory for SAS with an absolute path to the
basic SAS executable. An example path is:
/usr/local/sas/sas8.2/sas
APT_SASINT_COMMAND
Overrides the $PATH directory for SAS with an absolute path to the
International SAS executable. An example path is:
/usr/local/sas/sas8.2int/dbcs/sas
APT_SAS_DEBUG
Set this to set debug in the SAS process coupled to the SAS stage.
Messages appear in the SAS log, which may then be copied into the
DataStage log. Use APT_SAS_DEBUG=1, APT_SAS_DEBUG_IO=1, and
APT_SAS_DEBUG_VERBOSE=1 to get all debug messages.
APT_SAS_DEBUG_IO
Set this to set input/output debug in the SAS process coupled to the
SAS stage. Messages appear in the SAS log, which may then be
copied into the DataStage log.
APT_SAS_DEBUG_LEVEL
Its syntax is:
APT_SAS_DEBUG_LEVEL=[0-3]
APT_SAS_DEBUG_VERBOSE
Set this to set verbose debug in the SAS process coupled to the SAS
stage. Messages appear in the SAS log, which may then be copied
into the DataStage log.
APT_SAS_NO_PSDS_USTRING
Set this to prevent DataStage from automatically converting SAS char
types to ustrings in an SAS parallel data set.
APT_SAS_S_ARGUMENT
By default, DataStage executes SAS with -s 0. When this variable is
set, its value is be used instead of 0. Consult the SAS documentation
for details.
APT_SAS_SCHEMASOURCE_DUMP
When using SAS Schema Source, sauses the command line to be
written to the log when executing SAS. You use it to inspect the data
contained in a -schemaSource. Set this if you ar egetting an error
when specifying the SAS data set containing the schema source.
APT_SAS_SHOW_INFO
Displays the standard SAS output from an import or export
transaction. The SAS output is normally deleted since a transaction is
usually successful.
APT_SAS_TRUNCATION
Its syntax is:
APT_SAS_TRUNCATION ABORT | NULL | TRUNCATE
Sorting
The following environment variables are concerned with how
DataStage automatically sorts data.
APT_NO_SORT_INSERTION
DataStage automatically inserts sort components in your job to
optimize the performance of the operators in your data flow. Set this
variable to prevent this automatic insertion.
APT_SORT_INSERTION_CHECK_ONLY
When sorts are inserted automatically by DataStage, if this is set, the
sorts will just check that the order is correct, they won't actually sort.
This is a better alternative to shutting partitioning and sorting off
insertion off using APT_NO_PART_INSERTION and
APT_NO_SORT_INSERTION.
Teradata Support
The following environment variables are concerned with DataStage
interaction with Teradata databases.
APT_TERA_64K_BUFFERS
DataStage assumes that the terawrite operator writes to buffers
whose maximum size is 32 KB. Enable the use of 64 KB buffers by
setting this variable. The default is that it is not set.
APT_TERA_NO_ERR_CLEANUP
Setting this variable prevents removal of error tables and the partially
written target table of a terawrite operation that has not successfully
completed. Set this variable for diagnostic purposes only. In some
cases, setting this variable forces completion of an unsuccessful write
operation.
APT_TERA_NO_SQL_CONVERSION
Set this to prevent the SQL statements you are generating from being
converted to the character set specified for your stage (character sets
can be specified at project, job, or stage level). The SQL statements
are converted to LATIN1 instead.
APT_TERA_NO_PERM_CHECKS
Set this to bypass permission checking on the several system tables
that need to be readable for the load process. This can speed up the
start time of the load process slightly.
APT_TERA_SYNC_DATABASE
Specifies the database used for the terasync table. By default, the
database used for the terasync table is specified as part of
APT_TERA_SYNC_USER. If you want the database to be different, set
this variable. You must then give APT_TERA_SYNC_USER read and
write permission for this database.
APT_TERA_SYNC_PASSWORD
Specifies the password for the user identified by
APT_TERA_SYNC_USER.
APT_TERA_SYNC_USER
Specifies the user that creates and writes to the terasync table.
Transport Blocks
The following environment variables are all concerned with the block
size used for the internal transfer of data as jobs run. Some of the
settings only apply to fixed length records The following variables are
used only for fixed-length records.:
APT_MIN_TRANSPORT_BLOCK_SIZE
APT_MAX_TRANSPORT_BLOCK_SIZE
APT_DEFAULT_TRANSPORT_BLOCK_SIZE
APT_LATENCY_COEFFICIENT
APT_AUTO_TRANSPORT_BLOCK_SIZE
APT_AUTO_TRANSPORT_BLOCK_SIZE
This environment variable is available in the DataStage Administrator,
under the Parallel category. When set, Orchestrate calculates the block
size for transferring data internally as jobs run. It uses this algorithm:
if (recordSize * APT_LATENCY_COEFFICIENT
< APT_MIN_TRANSPORT_BLOCK_SIZE)
blockSize = minAllowedBlockSize
else if (recordSize * APT_LATENCY_COEFFICIENT
> APT_MAX_TRANSPORT_BLOCK_SIZE)
blockSize = maxAllowedBlockSize
else blockSize = recordSize * APT_LATENCY_COEFFICIENT
APT_LATENCY_COEFFICIENT
Specifies the number of writes to a block which transfers data
between players. This variable allows you to control the latency of
data flow through a step. The default value is 5. Specify a value of 0 to
have a record transported immediately. This is only used for fixed
length records.
Note Many operators have a built-in latency and are not affected
by this variable.
APT_DEFAULT_TRANSPORT_BLOCK_SIZE
Specify the default block size for transferring data between players. It
defaults to 131072 (128 KB).
APT_MAX_TRANSPORT_BLOCK_SIZE/
APT_MIN_TRANSPORT_BLOCK_SIZE
Specify the minimum and maximum allowable block size for
transferring data between players.
APT_MIN_TRANSPORT_BLOCK_SIZE cannot be less than 8192 which
is its default value. APT_MAX_TRANSPORT_BLOCK_SIZE cannot be
greater than 1048576 which is its default value. These variables are
only meaningful when used in combination with
APT_LATENCY_COEFFICIENT and
APT_AUTO_TRANSPORT_BLOCK_SIZE.
Performance Tuning
APT_BUFFER_MAXIMUM_MEMORY (see page 6-7).
APT_BUFFER_FREE_RUN (see page 6-6)
TMPDIR. This defaults to /tmp. It is used for miscellaneous internal
temporary data, including FIFO queues and Transformer
temporary storage. As a minor optimization, it can be better to
ensure that it is set to a file system separate to the DataStage
install directory.
before making a new DataStage API call. Alternatively, the calls can be
used in multiple threads.
DataStage API stores errors for each thread: a call to the
DSGetLastError function returns the last error generated within the
calling thread.
Redistributing Applications
If you intend to run your DataStage API application on a computer
where DataStage Server is installed, you do not need to include
DataStage API DLLs or libraries as these are installed as part of
DataStage Server.
If you want to run the application from a computer used as a
DataStage client, you should redistribute the following library with
your application:
vmdsapi.dll
If you intend to run the program from a computer that has neither
DataStage Server nor any DataStage client installed, in addition to the
library mentioned above, you should also redistribute the following:
dsclnt32.dll
dsrpc32.dll
You should locate these files where they will be in the search path of
any user who uses the application, for example, in the
%SystemRoot%\System32 directory.
API Functions
This section details the functions provided in the DataStage API.
These functions are described in alphabetical order. The following
table briefly describes the functions categorized by usage:
DSAddEnvVar
Add an environment variable to the specified project. It is added to the
User Defined category.
Syntax
int DSAddEnvVar(
DSPROJECT hProject,
char *EnvVarName,
char *Type,
char *PromptText,
char *Value
);
Parameters
hProject is the value returned from DSOpenProject
EnvVarName is the name of the environment variable
Type is DSA_ENVVAR_TYPE_STRING for string type environment
variables or DSA_ENVVAR_TYPE_ENCRYPTED for encrypted
environment variables.
PromptText is the user-visible text describing the environment
variable.
Value is value to set the environment variable to or “”.
Return Values
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_BADENVVARNAME invalid environment variable name
DSJE_BADENVVARTYPE invalid type
DSJE_BADENVVARPROMPT no prompt supplied
DSJE_READENVVARDEFNS failed to read environment variable
definitions
DSJE_READENVVARVALUES failed to read environment variable
values
DSJE_WRITEENVVARDEFNS failed to write environment variable
definitions
DSJE_WRITEENVVARVALUES failed to write environment variable
values
DSJE_DUPENVVARNAME environment variable already exists
Remarks
To use this method, the program needs to have previously attached to
a project using DSOpenProject. This returns a handle to the project,
hProject.
DSAddProject
Creates a new project. The user who runs the code containing this
function must be a DataStage Administrator.
Syntax
int DSAddProject(
char *ProjectName,
char *ProjectLocation
);
Parameters
ProjectName is the name of the project to create.
ProjectLocation is the pathname of the directory to create the project
in. To create a project in the default project directory (server install
path/Projects/projectName), this argument should be set to “”.
Return Values
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_NOTADMINUSER user is not an administrator
DSJE_ISADMINFAILED failed to determine whether user is
an administrator
DSJE_BADPROJNAME invalid project name supplied
DSJE_GETDEFAULTPATHFAILED failed to determine default
project directory
DSJE_BADPROJLOCATION invalid pathname supplied
DSJE_INVALIDPROJECTLOCATION invalid pathname supplied
DSJE_OPENFAILED failed to open UV.ACCOUNT file
DSJE_READUFAILED failed to lock project create lock
record
DSJE_ADDPROJECTBLOCKED another user is adding a project
DSJE_ADDPROJECTFAILED failed to add project
DSJE_LICENSEPROJECTFAILED failed to license project
DSJE_RELEASEFAILED failed to release project create lock
record
DSCloseJob
Closes a job that was opened using DSOpenJob.
Syntax
int DSCloseJob(
DSJOB JobHandle
);
Parameter
JobHandle is the value returned from DSOpenJob.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is:
DSJE_BADHANDLEInvalid JobHandle.
Remarks
If the job is locked when DSCloseJob is called, it is unlocked.
If the job is running when DSCloseJob is called, the job is allowed to
finish, and the function returns a value of DSJE_NOERROR
immediately.
DSCloseProject
Closes a project that was opened using the DSOpenProject function.
Syntax
int DSCloseProject(
DSPROJECT ProjectHandle
);
Parameter
ProjectHandle is the value returned from DSOpenProject.
Return Value
This function always returns a value of DSJE_NOERROR.
Remarks
Any open jobs in the project are closed, running jobs are allowed to
finish, and the function returns immediately.
DSDeleteEnvVar
Delete a user-defined environment variable in a specified project.
Syntax
int DSDeleteEnvVar(
DSPROJECT hProject,
char *EnvVar
);
Parameters
hProject is the value returned from DSOpenProject
EnvVarName is the name of the environment variable
Return Values
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_READENVVARDEFNS failed to read environment variable
definitions
DSJE_READENVVARVALUES failed to read environment variable
values
DSJE_BADENVVAR environment variable does not exist
DSJE_WRITEENVVARDEFNS failed to write environment variable
definitions
DSJE_WRITEENVVARVALUES failed to write environment variable
values
DSJE_NOTUSERDEFINED environment variable is not user-
defined and therefore cannot be deleted
If the function fails, then the return value is one of the following:
DSDeleteProject
Deletes a project. The user who runs the code containing this function
must be a DataStage Administrator. Note that any jobs scheduled to
be run that are included in this project will also be deleted.
Syntax
int DSDeleteProject(
char *ProjectName
);
Parameter
ProjectName is the name of the project to delete.
Return Value
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_NOTADMINUSER user is not an administrator
DSJE_ISADMINFAILED failed to determine whether user is an
administrator
DSJE_OPENFAILED failed to open UV.ACCOUNT file
DSJE_READUFAILED failed to lock project record
DSJE_RELEASEFAILED failed to release project record
DSJE_LISTSCHEDULEFAILED failed to get list of scheduled jobs
for project
DSJE_CLEARSCHEDULEFAILED failed to clear scheduled jobs for
project
DSJE_DELETEPROJECTBLOCKED project locked by another user
DSJE_NOTAPROJECT failed to log to project
DSJE_ACCOUNTPATHFAILED failed to get account path
DSJE_LOGTOFAILED failed to log to UV account
DSJE_DELPROJFAILED failed to delete project definition
DSJE_DELPROJFILESFAILED failed to delete project files
DSFindFirstLogEntry
Retrieves all the log entries that meet the specified criteria, and writes
the first entry to a data structure. Subsequent log entries can then be
read using the DSFindNextLogEntry function.
Syntax
int DSFindFirstLogEntry(
DSJOB JobHandle,
int EventType,
time_t StartTime,
time_t EndTime,
int MaxNumber,
DSLOGEVENT *Event
);
Parameters
JobHandle is the value returned from DSOpenJob.
EventType is one of the following keys:
DSJ_LOGWARNING Warning
DSJ_LOGFATAL Fatal
Return Values
If the function succeeds, the return value is DSJE_NOERROR, and
summary details of the first log entry are written to Event.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOMORE There are no events matching the filter criteria.
Remarks
The retrieved log entries are cached for retrieval by subsequent calls
to DSFindNextLogEntry. Any cached log entries that are not
processed by a call to DSFindNextLogEntry are discarded at the
next DSFindFirstLogEntry call (for any job), or when the project is
closed.
Note The log entries are cached by project handle. Multiple
threads using the same open project handle must
coordinate access to DSFindFirstLogEntry and
DSFindNextLogEntry.
DSFindNextLogEntry
Retrieves the next log entry from the cache.
Syntax
int DSFindNextLogEntry(
DSJOB JobHandle,
DSLOGEVENT *Event
);
Parameters
JobHandle is the value returned from DSOpenJob.
Event is a pointer to a data structure to use to hold the next log entry.
Return Values
If the function succeeds, the return value is DSJE_NOERROR and
summary details of the next available log entry are written to Event.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOMORE All events matching the filter criteria have been
returned.
Remarks
This function retrieves the next log entry from the cache of entries
produced by a call to DSFindFirstLogEntry.
Note The log entries are cached by project handle. Multiple
threads using the same open project handle must
coordinate access to DSFindFirstLogEntry and
DSFindNextLogEntry.
DSGetProjectList
Obtains information reported at the end of execution of certain
parallel stages. The information collected, and available to be
interrogated, is specified at design time. For example, transformer
stage information is specified in the Triggers tab of the Transformer
stage Properties dialog box.
Syntax
int DSGetCustInfo(
DSJOB JobHandle,
char *StageName,
char *CustinfoName
int InfoType,
DSSTAGEINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
StageName is a pointer to a null-terminated string specifying the
name of the stage to be interrogated.
CustinfoName is a pointer to a null-terminated string specifiying the
name of the variable to be interrogated (as set up on the Triggers
tab).
InfoType is one of the following keys:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There are no instances of the requested information in
the stage.
Token Description
DSJE_BADCUSTINFO CustinfoName does not refer to a known custinfo item.
DSGetJobInfo
Retrieves information about the status of a job.
Syntax
int DSGetJobInfo(
DSJOB JobHandle,
int InfoType,
DSJOBINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
InfoType is a key indicating the information to be returned and can
have any of the following values:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There are no instances of the requested information in
the job.
Remarks
For controlled jobs, this function can be used either before or after a
call to DSRunJob.
DSGetLastError
Returns the calling thread’s last error code value.
Syntax
int DSGetLastError(void);
Return Values
The return value is the last error code value. The "Return Values"
section of each reference page notes the conditions under which the
function sets the last error code.
Remarks
Use DSGetLastError immediately after any function whose return
value on failure might contain useful data, otherwise a later,
successful function might reset the value back to 0 (DSJE_NOERROR).
Note Multiple threads do not overwrite each other’s error codes.
DSGetLastErrorMsg
Retrieves the text of the last reported error from the DataStage server.
Syntax
char *DSGetLastErrorMsg(
DSPROJECT ProjectHandle
);
Parameter
ProjectHandle is either the value returned from DSOpenProject or
NULL.
Return Values
The return value is a pointer to a series of null-terminated strings, one
for each line of the error message associated with the last error
generated by the DataStage Server in response to a DataStage API
function call. Use DSGetLastError to determine what the error
number is.
The following example shows the buffer contents with <null>
representing the terminating NULL character:
line1<null>line2<null>line3<null><null>
Rermarks
If ProjectHandle is NULL, this function retrieves the error message
associated with the last call to DSOpenProject or
DSGetProjectList, otherwise it returns the last message associated
with the specified project.
The error text is cleared following a call to DSGetLastErrorMsg.
Note The text retrieved by a call to DSGetLastErrorMsg relates
to the last error generated by the server and not necessarily
the last error reported back to a thread using DataStage API.
Multiple threads using DataStage API must cooperate in
order to obtain the correct error message text.
DSGetLinkInfo
Retrieves information relating to a specific link of the specified active
stage of a job.
Syntax
int DSGetLinkInfo(
DSJOB JobHandle,
char *StageName,
char *LinkName,
int InfoType,
DSLINKINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
StageName is a pointer to a null-terminated character string
specifying the name of the active stage to be interrogated.
LinkName is a pointer to a null-terminated character string specifying
the name of a link (input or output) attached to the stage.
InfoType is a key indicating the information to be returned and is one
of the following values:
Value Description
DSJ_LINKLASTERR Last error message reported by the link.
Return Value
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There is no instance of the requested information
available.
DSJE_BADLINK LinkName does not refer to a known link for the stage in
question.
Remarks
This function can be used either before or after a call to DSRunJob.
DSGetLogEntry
Retrieves detailed information about a specific entry in a job log.
Syntax
int DSGetLogEntry(
DSJOB JobHandle,
int EventId,
DSLOGDETAIL *Event
);
Parameters
JobHandle is the value returned from DSOpenJob.
EventId is the identifier for the event to be retrieved, see "Remarks"
Event is a pointer to a data structure to hold details of the log entry.
Return Values
If the function succeeds, the return value is DSJE_NOERROR and the
event structure contains the details of the requested event.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
Remarks
Entries in the log file are numbered sequentially starting from 0. The
latest event ID can be obtained through a call to
DSGetNewestLogId. When a log is cleared, there always remains a
single entry saying when the log was cleared.
DSGetNewestLogId
Obtains the identifier of the newest entry in the jobs log.
Syntax
int DSGetNewestLogId(
DSJOB JobHandle,
int EventType
);
Parameters
JobHandle is the value returned from DSOpenJob.
EventType is a key specifying the type of log entry whose identifier
you want to retrieve and can be one of the following:
DSJ_LOGWARNING Warning
DSJ_LOGFATAL Fatal
Return Values
If the function succeeds, the return value is the positive identifier of
the most recent entry of the requested type in the job log file.
If the function fails, the return value is –1. Use DSGetLastError to
retrieve one of the following error codes:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
Remarks
Use this function to determine the ID of the latest entry in a log file
before starting a job run. Once the job has started or finished, it is then
possible to determine which entries have been added by the job run.
DSGetParamInfo
Retrieves information about a particular parameter within a job.
Syntax
int DSGetParamInfo(
DSJOB JobHandle,
char *ParamName,
DSPARAMINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
ParamName is a pointer to a null-terminated string specifying the
name of the parameter to be interrogated.
ReturnInfo is a pointer to a DSPARAMINFO data structure where the
requested information is stored. For more information, see "Data
Structures" on page 7-62.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_SERVER_ERROR Internal error. DataStage Server returned invalid data.
Remarks
Unlike the other information retrieval functions, DSGetParamInfo
returns all the information relating to the specified item in a single
call. The DSPARAMINFO data structure contains all the information
required to request a new parameter value from a user and partially
validate it. See "Data Structures" on page 7-62.
This function can be used either before or after a DSRunJob call has
been issued:
If called after a successful call to DSRunJob, the information
retrieved refers to that run of the job.
DSGetProjectInfo
Obtains a list of jobs in a project.
Syntax
int DSGetProjectInfo(
DSPROJECT ProjectHandle,
int InfoType,
DSPROJECTINFO *ReturnInfo
);
Parameters
ProjectHandle is the value returned from DSOpenProject.
InfoType is a key indicating the information to be returned.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There are no compiled jobs defined within the project.
Remarks
The DSPROJECTINFO data structure contains a union with an
element for each of the possible return values from a call to
DSGetProjectInfo.
Note The returned list contains the names of all jobs known to
the project, whether they can be opened or not.
.
DSGetProjectList
Obtains a list of all projects on the host system
Syntax
char* DSGetProjectList(void);
Return Values
If the function succeeds, the return value is a pointer to a series of
null-terminated strings, one for each project on the host system,
ending with a second null character. The following example shows the
buffer contents with <null> representing the terminating null
character:
project1<null>project2<null><null>
If the function fails, the return value is NULL. And the DSGetLast-
Error function retrieves the following error code:
DSJE_SERVER_ERRORUnexpected/unknown server error occurred.
Remarks
This function can be called before any other DataStage API function.
Note DSGetProjectList opens, uses, and closes its own
communications link with the server, so it may take some
time to retrieve the project list.
DSGetReposInfo
Provides searching capabilities for design-time objects.
Syntax
int DSGetReposInfo (
DSPROJECT hProject,
int ObjectType,
int InfoType,
const char *SearchCriteria,
const char *StartingCategory,
int Subcategories,
DSREPOSINFO *ReturnInfo
);
Parameters
hProject is the value returned from DSOpenProject for the project
whose jobs you want to search.
ObjectType must currently be set to DSS_JOBS to indicate that you
want to search for jobs.
InfoType is one or more of the following keys:
Return Value
On success, DSGetReposInfo returns the number of objects that
have been found.
On failure an error code is returned as follows:
DSJE_BADTYPE ObjectType or InfoType values was not
recognised
DSJE_REPERROR An error occurred while trying to access the
reposotory. Call DSGetLastErrorMsg to get the error message
associated with the error code
DSJE_NO_DATASTAGE The attached project does not appear to
be a valid DataStage project
DSGetReposUsage
Returns a list of objects based on the required relationship.
Syntax
int DSGetReposUsage(
DSPROJECT hProject,
int RelationshipType,
const char *ObjectName,
int Recursive,
DSREPOSUSAGE *ReturnInfo
);
Parameters
hProject is the value returned from DSOpenProject for the project
whose jobs you want to search.
RelationshipType is one of the following keys:
ObjectName, the jobs that that job is used in are found and so on. For
all other relationship types the parameter is ignored.
ReturnInfo is a pointer to a structure containing the returned values
(see"DSREPOSUSAGE" on page 7-76). The order in which jobs appear
in the ReturnInfo structure is defined by the RelationshipType. For the
DSS_JOB_USES_JOB RelationshipType, the jobs will apear in the
order in which they appear in the jobs dependency list. This list is on
the Dependencies tab on the Job Properties dialog.
Return Value
On success, DSGetReposUsage returns the number of objects that
have been found.
On failure an error code is returned as follows:
DSJE_REPERROR An error occurred while trying to access the
repository. Call nDSGetLastErrorMsg to get the error
message associated with the error code.
DSJE_NO_DATASTAGE The attached project does not appear
to be a valid DataStage project.
DSJE_UNKNOWN_JOBNAME When the RelationshipType is
DSS_JOB_USES_JOB or DSS_JOB_USEDBY_JOB the supplied job
name cannot be found in the project.
DSGetStageInfo
Obtains information about a particular stage within a job.
Syntax
int DSGetStageInfo(
DSJOB JobHandle,
char *StageName,
int InfoType,
DSSTAGEINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
StageName is a pointer to a null-terminated string specifying the
name of the stage to be interrogated.
InfoType is one of the following keys:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There are no instances of the requested information in
the stage.
Remarks
This function can be used either before or after a DSRunJob function
has been issued.
The DSSTAGEINFO data structure contains a union with an element
for each of the possible return values from the call to
DSGetStageInfo.
DSGetProjectList
Obtains information about variables used in transformer stages.
Syntax
int DSGetVarInfo(
DSJOB JobHandle,
char *StageName,
char *VarName
int InfoType,
DSSTAGEINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
StageName is a pointer to a null-terminated string specifying the
name of the stage to be interrogated.
VarName is a pointer to a null-terminated string specifiying the name
of the variable to be interrogated.
InfoType is one of the following keys:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_NOT_AVAILABLE There are no instances of the requested information in
the stage.
DSListEnvVars
Obtain a list of environment variables and their values in a specified
project.
Syntax
char *DSListEnvVars(
DSPROJECT hProject
);
Parameter
hProject is the value returned from DSOpenProject for the project
whose environment variables you want to list.
Return Values
If the function succeeds, the return value is a pointer to a series of
null-terminated strings, one for each environment variable, ending
with a second null character. Each string is of the format
EnvVarName=EnvVarValue.
If the function fails, the return value is NULL and the DSGetLastError
function can be used to retrieve an error code as follows:
DSJE_READENVVARDEFNS failed to read environment variable
definitions
DSJE_READENVVARVALUES failed to read environment variable
values
DSJE.ISPARALLELLICENCED failed to determine if Enterprise
Edition installed
Remarks
To use this method, the program needs to have previously attached to
a project using DSOpenProject. This returns a handle to the project,
hProject.
Environment variables in the parallel category will only be listed if
Enterprise Edition is installed.
DSListProjectProperties
Obtain a list of the values of project properties for specified project.
Properties supported are:
Whether generated OSH is visible in parallel jobs.
Whether runtime column propagation is enabled in parallel jobs.
The base directory name for parallel jobs.
Advanced runtime options for parallel jobs.
Custom deployment commands for parallel jobs.
Deployment job template directory.
Whether job administration is enabled in the DataStage Director
or not.
Syntax
char *DSListProjectProperties(
DSPROJECT hProject
);
Parameter
hProject is the value returned from DSOpenProject for the project
whose properties you want to list.
Return Values
If the function succeeds, the return value is a pointer to a series of
null-terminated strings, one for each variable, ending with a second
null character. Each string is of the format
PropertyName=PropertyValue where PropertyName will be one of the
following:
These tokens are defined in dsapi.h (see "The dsapi.h Header File" on
page 7-2).
If the function fails, the return value is NULL and the DSGetLastError
function can be used to retrieve one of the following error code:
DSJE_READPROJPROPERTY failed to read property
DSJE_ISPARALLELLICENCED failed to determine if Enterprise
Edition installed
DSJE_OSHVISIBLEFLAG failed to get value for OSHVisible
Remarks
To use this method, the program needs to have previously attached to
a project using DSOpenProject. This returns a handle to the project,
hProject.
If Enterprise Edition is not installed, only the setting of the
DSA_PRJ_JOBADMIN_ENABLED will be returned.
DSListProjectProperties
DSLockJob
Locks a job. This function must be called before setting a job’s run
parameters or starting a job run.
Syntax
int DSLockJob(
DSJOB JobHandle
);
Parameter
JobHandle is the value returned from DSOpenJob.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
Remarks
Locking a job prevents any other process from modifying the job
details or status. This function must be called before any call of
DSSetJobLimit, DSSetParam, or DSRunJob.
If you try to lock a job you already have locked, the call succeeds. If
you have the same job open on several DataStage API handles,
locking the job on one handle locks the job on all the handles.
DSLogEvent
Adds a new entry to a job log file.
Syntax
int DSLogEvent(
DSJOB JobHandle,
int EventType,
char *Reserved,
char *Message
);
Parameters
JobHandle is the value returned from DSOpenJob.
EventType is one of the following keys specifying the type of event to
be logged:
DSJ_LOGWARNING Warning
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
Remarks
Messages that contain more that one line of text should contain a
newline character (\n) to indicate the end of a line.
DSMakeJobReport
Generates a report describing the complete status of a valid attached
job.
Syntax
int DSMakeJobReport(
DSJOB JobHandle,
int ReportType,
char *LineSeparator,
DSREPORTINFO *ReturnInfo
);
Parameters
JobHandle is the value returned from DSOpenJob.
ReportType is one of the following values specifying the type of report
to be generated:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
DSOpenJob
Opens a job. This function must be called before any other function
that manipulates the job.
Syntax
DSJOB DSOpenJob(
DSPROJECT ProjectHandle,
char *JobName
);
Parameters
ProjectHandle is the value returned from DSOpenProject.
JobName is a pointer to a null-terminated string that specifies the
name of the job that is to be opened. This may be in either of the
following formats:
Return Values
If the function succeeds, the return value is a handle to the job.
If the function fails, the return value is NULL. Use DSGetLastError to
retrieve one of the following:
Token Description
DSJE_OPENFAIL Server failed to open job.
Remarks
The DSOpenJob function must be used to return a job handle before
a job can be addressed by any of the DataStage API functions. You can
gain exclusive access to the job by locking it with DSLockJob.
The same job may be opened more than once and each call to
DSOpenJob will return a unique job handle. Each handle must be
separately closed.
DSOpenProject
Opens a project. It must be called before any other DataStage API
function, except DSGetProjectList or DSGetLastError.
Syntax
DSPROJECT DSOpenProject(
char *ProjectName
);
Parameter
ProjectName is a pointer to a null-terminated string that specifies the
name of the project to open.
Return Values
If the function succeeds, the return value is a handle to the project.
If the function fails, the return value is NULL. Use DSGetLastError to
retrieve one of the following:
Token Description
DSJE_BAD_VERSION The DataStage server is an older version than
the DataStage API.
Remarks
The DSGetProjectList function can return the name of a project that
does not contain valid DataStage jobs, but this is detected when
DSOpenProject is called. A process can only have one project open
at a time.
DSRunJob
Starts a job run.
Syntax
int DSRunJob(
DSJOB JobHandle,
int RunMode
);
Parameters
JobHandle is a value returned from DSOpenJob.
RunMode is a key determining the run mode and should be one of the
following values:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
DSJE_BADSTATE Job is not in the right state (must be
compiled and not running).
DSJE_BADTYPE RunMode is not recognized.
DSJE_SERVER_ERROR Internal error. DataStage Server returned
invalid data.
Remarks
The job specified by JobHandle must be locked, using DSLockJob,
before the DSRunJob function is called.
DSSetEnvVar
Set the value for an environment variable in a specified project.
Syntax
int DSSetEnvVar(
DSPROJECT hProject,
char *EnvVarName,
char *Value
);
Parameters
hProject is the value returned from DSOpenProject.
EnvVarName is the name of the environment variable.
Value is the value to set the environment variable to.
Return Values
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_READENVVARDEFNS failed to read environment variable
definitions
DSJE_READENVVARVALUES failed to read environment variable
values
DSJE_BADENVVAR environment variable does not exist
DSJE_WRITEENVVARVALUES failed to write environment variable
values
DSJE_ENCODEFAILED failed to encode an encrypted value
DSJE_BADBOOLEANVALUE invalid value given for a boolean
environment variable
DSJE_BADNUMERICVALUE invalid value given for an integer
environment variable
DSJE_BADLISTVALUE invalid value given for an
environment variable with a fixed list of values
DSJE_PXNOTINSTALLED Environment variable is specific to
Enterprise Edition which is not installed
DSJE_ISPARALLELLICENCED failed to determine if Enterprise
Edition installed
Remarks
You can only set values for environment variables in the parallel
category if Enterprise Edition is installed.
If setting a list type environment variable (for example,
APT_EXECUTION _MODE) , then you should set it to one of the
permissable internal values, rather than one of the list members as
they are shown in the DataStage Administrator client. For example, if
you wanted to set APT_EXECUTION_MODE so that parallel jobs
executed in one process mode, you would set the environment
variable value to ‘ONE_PROCESS’, not ‘One process’ as offered in the
Administrator client. Internal values are given in "Environment
Variables," in the Parallel Job Advanced Developer’s Guide.
If you are setting a boolean type environment variable, set teh value
to 1 for TRUE and 0 for FALSE.
DSSetGenerateOpMetaData
Use this to specify whether the job generates operational meta data or
not. This overrides the default setting for the project. In order to
generate operational meta data the Process MetaBroker must be
installed on your DataStage machine.
Syntax
int DSSetGenerateOpMetaData (
JobHandle,
value
);
Parameters
JobHandle is a value returned from DSOpenJob.
value is TRUE (1) to generate operational meta data, FALSE (0) to not
generate operational meta data.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
DSJE_BADTYPE value is not recognized.
DSSetJobLimit
Sets row or warning limits for a job.
Syntax
int DSSetJobLimit(
DSJOB JobHandle,
int LimitType,
int LimitValue
);
Parameters
JobHandle is a value returned from DSOpenJob.
LimitType is one of the following keys specifying the type of limit:
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
Remarks
The job specified by JobHandle must be locked, using DSLockJob,
before the DSSetJobLimit function is called.
Any job limits that are not set explicitly before a run will use the
default values. Make two calls to DSSetJobLimit in order to set both
types of limit.
Set the value to 0 to indicate that there should be no limit for the job.
DSSetParam
Sets job parameter values before running a job. Any parameter that is
not explicitly set uses the default value.
Syntax
int DSSetParam(
DSJOB JobHandle,
char *ParamName,
DSPARAM *Param
);
Parameters
JobHandle is the value returned from DSOpenJob.
ParamName is a pointer to a null-terminated string that specifies the
name of the parameter to set.
Param is a pointer to a structure that specifies the name, type, and
value of the parameter to set.
Note The type specified in Param need not match the type
specified for the parameter in the job definition, but it must
be possible to convert it. For example, if the job defines the
parameter as a string, it can be set by specifying it as an
integer. However, it will cause an error with unpredictable
results if the parameter is defined in the job as an integer
and a nonnumeric string is passed by DSSetParam.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
DSJE_BADVALUE Param does not specify a value that is appropriate for the
parameter type as specified in the job definition.
Remarks
The job specified by JobHandle must be locked, using DSLockJob,
before the DSSetParam function is called.
DSSetProjectProperty
Sets the value of a property in a specified project. The user who runs
the code containing this function must be a DataStage Administrator.
Syntax
int DSSetProjectProperty(
DSPROJECT hProject,
char *Property,
char *Value
);
Parameters
hProject is the value returned from DSOpenProject
Propertyis the name of the property to set. The following properties
are supported:
Return Values
If the function succeeds, then the return value is DSJE_NOERROR
If the function fails, then the return value is one of the following:
DSJE_NOTADMINUSER user is not an administrator
DSJE_ISADMINFAILED failed to determine whether user is
an administrator
DSJE_READPROJPROPERTY failed to read property
DSJE_WRITEPROJPROPERTY failed to write property
DSJE_PROPNOTSUPPORTED property not supported
DSJE_BADPROPERTY unknown property name
DSJE_BADPROPVALUE invalid value for this property
DSJE_PXNOTINSTALLED Enterprise Edition not installed
DSJE_ISPARALLELLICENCED failed to determine if Enterprise
Edition installed
DSJE_OSHVISIBLEFLAG failed to set value for OSHVisible
Remarks
To use this method, the program needs to have previously attached to
a project using DSOpenProject. This returns a handle to the project,
hProject.
DSSetServerParams
Sets the logon parameters to use for opening a project or retrieving a
project list.
Syntax
void DSSetServerParams(
char *ServerName,
char *UserName,
char *Password
);
Parameters
ServerName is a pointer to either a null-terminated character string
specifying the name of the server to connect to, or NULL.
UserName is a pointer to either a null-terminated character string
specifying the user name to use for the server session, or NULL.
Password is a pointer to either a null-terminated character string
specifying the password for the user specified in UserName, or NULL.
Return Values
This function has no return value.
Remarks
By default, DSOpenProject and DSGetProjectList attempt to
connect to a DataStage Server on the same computer as the client
process, then create a server process that runs with the same user
identification and access rights as the client process.
DSSetServerParams overrides this behavior and allows you to
specify a different server, user name, and password.
Calls to DSSetServerParams are not cumulative. All parameter
values, including NULL pointers, are used to set the parameters to be
used on the subsequent DSOpenProject or DSGetProjectList call.
DSStopJob
Aborts a running job.
Syntax
int DSStopJob(
DSJOB JobHandle
);
Parameter
JobHandle is the value returned from DSOpenJob.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is:
DSJE_BADHANDLEInvalid JobHandle.
Remarks
The DSStopJob function should be used only after a DSRunJob
function has been issued. The stop request is sent regardless of the
job’s current status. To ascertain if the job has stopped, use the
DSWaitForJob function or the DSJobStatus macro.
DSUnlockJob
Unlocks a job, preventing any further manipulation of the job’s run
state and freeing it for other processes to use.
Syntax
int DSUnlockJob(
DSJOB JobHandle
);
Parameter
JobHandle is the value returned from DSOpenJob.
Return Values
If the function succeeds, the return value is DSJ_NOERROR.
If the function fails, the return value is:
DSJE_BADHANDLE Invalid JobHandle.
Remarks
The DSUnlockJob function returns immediately without waiting for
the job to finish. Attempting to unlock a job that is not locked does not
cause an error. If you have the same job open on several handles,
unlocking the job on one handle unlocks it on all handles.
DSWaitForJob
Waits to the completion of a job run.
Syntax
int DSWaitForJob(
DSJOB JobHandle
);
Parameter
JobHandle is the value returned from DSOpenJob.
Return Values
If the function succeeds, the return value is DSJE_NOERROR.
If the function fails, the return value is one of the following:
Token Description
DSJE_BADHANDLE Invalid JobHandle.
DSJE_WRONGJOB Job for this JobHandle was not started from a call to
DSRunJob by the current process.
Remarks
This function is only valid if the current job has issued a DSRunJob
call on the given JobHandle. It returns if the job was started since the
last DSRunJob, and has since finished. The finishing status can be
found by calling DSGetJobInfo.
Data Structures
The DataStage API uses the data structures described in this section
to hold data passed to, or returned from, functions. (See"Data
Structures, Result Data, and Threads" on page 7-2). The data
structures are summarized below, with full descriptions in the
following sections:
DSCUSTINFO
The DSCUSTINFO structure represents various information values
about a link to or from an active stage within a DataStage job.
Syntax
typedef struct _DSCUSTINFO {
int infoType:/
union {
char *custinfoValue;
char *custinfoDesc;
} info;
} DSCUSTINFO;
Members
infoType is a key indicating the type of information and is one of the
following values:
DSJOBINFO
The DSJOBINFO structure represents information values about a
DataStage job.
Syntax
typedef struct _DSJOBINFO {
int infoType;
union {
int jobStatus;
char *jobController;
time_t jobStartTime;
int jobWaveNumber;
char *userStatus;
char *paramList;
char *stageList;
char *jobname;
int jobcontrol;
int jobPid;
time_t jobLastTime;
char *jobInvocations;
int jobInterimStatus;
char *jobInvocationid;
char *jobDesc;
char *stageList2;
char *jobElapsed;
char *jobFullDesc;
int jobDMIService;
int jobMultiInvokable;
} info;
} DSJOBINFO;
Members
infoType is one of the following keys indicating the type of
information:
DSJ_JOBLASTTIMESTAMP The date and time on the server when the job last
finished.
jobController is the name of the job controlling the job reference and
is returned when infoType is set to DSJ_JOBCONTROLLER. Note that
this may be several job names, separated by periods, if the job is
controlled by a job which is itself controlled, and so on.
jobStartTime is the date and time when the last or current job run
started and is returned when infoType is set to
DSJ_JOBSTARTTIMESTAMP.
jobWaveNumber is the wave number of the last or current job run and
is returned when infoType is set to DSJ_JOBWAVENO.
userStatus is the value, if any, set by the job as its user defined status,
and is returned when infoType is set to DSJ_USERSTATUS.
paramList is a pointer to a buffer that contains a series of null-
terminated strings, one for each job parameter name, that ends with a
second null character. It is returned when infoType is set to
DSJ_PARAMLIST. The following example shows the buffer contents
with <null> representing the terminating null character:
first<null>second<null><null>
DSLINKINFO
The DSLINKINFO structure represents various information values
about a link to or from an active stage within a DataStage job.
Syntax
typedef struct _DSLINKINFO {
int infoType:/
union {
DSLOGDETAIL lastError;
int rowCount;
char *linkName;
char *linkSQLState;
char *linkDBMSCode;
char *linkDesc;
char *linkedStage;
char *rowCountList;
} info;
} DSLINKINFO;
Members
infoType is a key indicating the type of information and is one of the
following values:
DSJ_LINKROWCOUNT The number of rows that have been passed down a link.
lastError is a data structure containing the error log entry for the last
error message reported from a link and is returned when infoType is
set to DSJ_LINKLASTERR.
rowCount is the number of rows that have been passed down a link so
far and is returned when infoType is set to DSJ_LINKROWCOUNT.
DSLOGDETAIL
The DSLOGDETAIL structure represents detailed information for a
single entry from a job log file.
Syntax
typedef struct _DSLOGDETAIL {
int eventId;
time_t timestamp;
int type;
char *reserved;
char *fullMessage;
} DSLOGDETAIL;
Members
eventId is a a number, 0 or greater, that uniquely identifies the log
entry for the job.
timestamp is the date and time at which the entry was added to the
job log file.
type is a key indicting the type of the event, and is one of the following
values:
DSJ_LOGWARNING Warning
DSLOGEVENT
The DSLOGEVENT structure represents the summary information
for a single entry from a job’s event log.
Syntax
typedef struct _DSLOGEVENT {
int eventId;
time_t timestamp;
int type;
char *message;
} DSLOGEVENT;
Members
eventId is a a number, 0 or greater, that uniquely identifies the log
entry for the job.
timestamp is the date and time at which the entry was added to the
job log file.
type is a key indicating the type of the event, and is one of the
following values:
DSJ_LOGWARNING Warning
DSPARAM
The DSPARAM structure represents information about the type and
value of a DataStage job parameter.
Syntax
typedef struct _DSPARAM {
int paramType;
union {
char *pString;
char *pEncrypt;
int pInt;
float pFloat;
char *pPath;
char *pListValue;
char *pDate;
char *pTime;
} paramValue;
} DSPARAM;
Members
paramType is a key specifying the type of the job parameter. Possible
values are as follows:
DSJ_PARAMTYPE_INTEGER An integer.
DSPARAMINFO
The DSPARAMINFO structure represents information values about a
parameter of a DataStage job.
Syntax
typedef struct _DSPARAMINFO {
DSPARAM defaultValue;
char *helpText;
char *paramPrompt;
int paramType;
DSPARAM desDefaultValue;
char *listValues;
char *desListValues;
int promptAtRun;
} DSPARAMINFO;
Members
defaultValue is the default value, if any, for the parameter.
helpText is a description, if any, for the parameter.
paramPrompt is the prompt, if any, for the parameter.
paramType is a key specifying the type of the job parameter. Possible
values are as follows:
DSJ_PARAMTYPE_INTEGER An integer.
desDefaultValue is the default value set for the parameter by the job’s
designer.
DSPROJECTINFO
The DSPROJECTINFO structure represents information values for a
DataStage project.
Syntax
typedef struct _DSPROJECTINFO {
int infoType;
union {
char *jobList;
} info;
} DSPROJECTINFO;
Members
infoType is a key value indicating the type of information to retrieve.
Possible values are as follows.
DSREPOSINFO
The DSREPOSINFO structure gives information about design-time
objects that have been searched for.
Syntax
struct _DSREPOSJOBINFO;
typedef struct _DSREPOSJOBINFO DSREPOSJOBINFO;
struct _DSREPOSJOBINFO
{
char* jobname; /* Includes category */
int jobtype; /* InfoType constant */
DSREPOSJOBINFO* nextjob; /* ptr next job or NULL */
};
typedef struct _DSREPOSINFO
{
int infoType;
union
{
DSREPOSJOBINFO* jobs; /*linkedlist of found jobs */
} info;
} DSREPOSINFO;
Members
infoType is a key value indicating the type of information to retrieve.
Possible values are as follows.
DSREPOSUSAGE
The DSREPOSUSAGE structure gives information about objects
meeting a specified relationship.
DSREPOSUSAGE
Syntax
struct _DSREPOSUSAGEJOB;
typedef struct _DSREPOSUSAGEJOB DSREPOSUSAGEJOB;
struct _DSREPOSUSAGEJOB
{
char *jobname; /* Job and cat name */
int jobtype; /* type of job */
DSREPOSUSAGEJOB *nextjob; /* next sibling job */
DSREPOSUSAGEJOB *childjob;
};
typedef struct _DSREPOSUSAGE
{
int infoType;
union
{
DSREPOSUSAGEJOB *jobs; /*linkedlist of jobs*/
} info
} DSREPOSUSAGE;
Members
infoType is a key value indicating the type of information to retrieve.
Possible values are as follows.
DSSTAGEINFO
The DSSTAGEINFO structure represents various information values
about an active stage within a DataStage job.
Syntax
typedef struct _DSSTAGEINFO {
int infoType;
union {
DSLOGDETAIL lastError;
char *typeName;
int inRowNum;
char *linkList;
char *stagename;
char *varlist;
char *stageStartTime;
char *stageEndTime;
char *linkTypes;
char *stageDesc;
char *instList;
char *cpuList;
time_t stageElapsed;
char *pidList;
int stageStatus;
char *custInfoList
} info;
} DSSTAGEINFO;
Members
infoType is a key indicating the information to be returned and is one
of the following:
lastError is a data structure containing the error message for the last
error (if any) reported from any link of the stage. It is returned when
infoType is set to DSJ_STAGELASTERR.
typeName is the stage type name and is returned when infoType is set
to DSJ_STAGETYPE.
inRowNum is the primary link’s input row number and is returned
when infoType is set to DSJ_STAGEINROWNUM.
linkList is a pointer to a buffer that contains a series of null-terminated
strings, one for each link in the stage, ending with a second null
character, as shown in the following example (<null> represents the
terminating null character):
first<null>second<null><null>
DSLINKINFO
The DSLINKINFO structure represents various information values
about a link to or from an active stage within a DataStage job.
Syntax
typedef struct _DSVARINFO {
int infoType:/
union {
char *varValue;
char *varDesc;
} info;
} DSVARINFO;
Members
infoType is a key indicating the type of information and is one of the
following values:
Error Codes
The following table lists DataStage API error codes in alphabetical
order:
The following table lists DataStage API error codes in numerical order:
The following table lists some common errors that may be returned
from the lower-level communication layers:
DSAttachJob
Attaches to a job in order to run it in job control sequence. A handle is
returned which is used for addressing the job. There can only be one
handle open for a particular job at any one time.
Syntax
JobHandle = DSAttachJob (JobName, ErrorMode)
Remarks
A job cannot attach to itself.
The JobName parameter can specify either an exact version of the job
in the form job%Reln.n.n, or the latest version of the job in the form
job. If a controlling job is itself released, you will get the latest
released version of job. If the controlling job is a development
version, you will get the latest development version of job.
Example
This is an example of attaching to Release 11 of the job Qsales:
Qsales_handle = DSAttachJob ("Qsales%Rel1",
➥ DSJ.ERRWARN)
DSCheckRoutine
Checks if a BASIC routine is cataloged, either in the VOC as a callable
item, or in the catalog space.
Syntax
Found = DSCheckRoutine(RoutineName)
Example
rtn$ok = DSCheckRoutine(“DSU.DSSendMail”)
If(NOT(rtn$ok)) Then
* error handling here
End.
DSDetachJob
Gives back a JobHandle acquired by DSAttachJob if no further
control of a job is required (allowing another job to become its
controller). It is not necessary to call this function, otherwise any
attached jobs will always be detached automatically when the
controlling job finishes.
Syntax
ErrCode = DSDetachJob (JobHandle)
Example
The following command detaches the handle for the job qsales:
Deterr = DSDetachJob (qsales_handle)
DSExecute
Executes a DOS or DataStage Engine command from a before/after
subroutine.
Syntax
Call DSExecute (ShellType, Command, Output, SystemReturnCode)
Remarks
Do not use DSExecute from a transform; the overhead of running a
command for each row processed by a stage will degrade
performance of the job.
DSGetCustInfo
Obtains information reported at the end of execution of certain
parallel stages. The information collected, and available to be
interrogated, is specified at design time. For example, transformer
stage information is specified in the Triggers tab of the Transformer
stage Properties dialog box.
Syntax
Result = DSGetCustInfo (JobHandle, StageName, CustInfoName, InfoType)
DSIPCPageProps
Returns the size (in KB) of the Send/Recieve buffer of an IPC (or Web
Service) stage.
Syntax
Result = DSGetIPCStageProps (JobName, StageName)
or
Call DSGetIPCStageProps (Result, JobName, StageName)
JobName is the name of the job in the current project for which
information is required. If JobName does not exist in the current
project, Result will be set to an empty string.
StageName is the name of an IPC stage in the specified job for which
information is required. If StageName does not exist, or is not an IPC
stage within JobName, Result will be set to an empty string.
Result is an array containing the following fields:
the size (in kilobytes) of the Send/Receive buffer of the IPC (or Web
Service) stage StageName within JobName.
the seconds timeout value of the IPC (or Web Service) stage
StageName within JobName.
Example
The following returns the size and timeout of the stage “IPC1” in the
job “testjob”:
buffersize = DSGetIPCStageProps (testjob, IPC1)
DSGetJobInfo
Provides a method of obtaining information about a job, which can be
used generally as well as for job control. It can refer to the current job
or a controlled job, depending on the value of JobHandle.
Syntax
Result = DSGetJobInfo (JobHandle, InfoType)
Remarks
When referring to a controlled job, DSGetJobInfo can be used either
before or after a DSRunJob has been issued. Any status returned
following a successful call to DSRunJob is guaranteed to relate to
that run of the job.
Examples
The following command requests the job status of the job qsales:
q_status = DSGetJobInfo(qsales_handle, DSJ.JOBSTATUS)
The following command requests the actual name of the current job:
whatname = DSGetJobInfo (DSJ.ME, DSJ.JOBNAME)
DSGetJobMetaBag
Returns a dynamic array containing the MetaBag properties
associated with the named job.
Syntax
Result = DSGetJobMetaBag(JobName, Owner)
or
Call DSGetJobMetaBag(Result, JobName, Owner)
JobName is the name of the job in the current project for which
information is required. If JobName does not exist in the current
project Result will be set to an empty string.
Owner is an owner name whose metabag properties are to be
returned. If Owner is not a valid owner within the current job, Result
will be set to an empty string. If Owner is an empty string, a field
mark delimited string of metabag property owners within the current
job will be returned in Result.
Result returns a dynamic array of metabag property sets, as follows:
RESULT<1> = MetaPropertyName01 @VM MetaPropertyValue01
RESULT<..> = MetaPropertyName.. @VM MetaPropertyValue..
RESULT<N>= MetaPropertyNameN @VM MetaPropertyValueN
Example
The following returns the metabag properties for owner mbowner in
the job “testjob”:
linksmdata = DSGetJobMetaBag (testjob, mbowner)
DSGetLinkInfo
Provides a method of obtaining information about a link on an active
stage, which can be used generally as well as for job control. This
routine may reference either a controlled job or the current job,
depending on the value of JobHandle.
Syntax
Result = DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)
Remarks
When referring to a controlled job, DSGetLinkInfo can be used
either before or after a DSRunJob has been issued. Any status
returned following a successful call to DSRunJob is guaranteed to
relate to that run of the job.
Example
The following command requests the number of rows that have
passed down the order_feed link in the loader stage of the job qsales:
link_status = DSGetLinkInfo(qsales_handle, "loader",
➥ "order_feed", DSJ.LINKROWCOUNT)
DSGetLinkMetaData
Returns a dynamic array containing the column metadata of the
specified stage.
Syntax
Result = DSGetLinkMetaData(JobName, LinkName)
or
Call DSGetLinkMetaData(Result, JobName, LinkName)
JobName is the name of the job in the current project for which
information is required. If the JobName does not exist in the current
project then the function will return an empty string.
LinkName is the name of the link in the specified job for which
information is required. If the LinkName does not exist in the specified
job then the function will return an empty string.
Result returns a dynamic array of nine fields, each field will contain N
values where N is the number of columns on the link.
Result<1,1…N> is the column name
Result<2,1…N> is 1 for primary key columns otherwise 0
Result<3,1…N> is the column sql type. See ODBC.H.
Result<4,1…N> is the column precision
Result<5,1…N> is the column scale
Result<6,1…N> is the column desiplay width
Result<7,1…N> is 1 for nullable columns otherwise 0
Result<8,1…N> is the column descriptions
Result<9,1…N> is the column derivation
Example
The following returns the meta data of the link ilink1 in the job
“testjob”:
linksmdata = DSGetLinkMetaData (testjob, ilink1)
DSGetLogEntry
Reads the full event details given in EventId.
Syntax
EventDetail = DSGetLogEntry (JobHandle, EventId)
Example
The following commands first get the EventID for the required log
event and then reads full event details of the log event identified by
LatestLogid into the string LatestEventString:
latestlogid =
➥ DSGetNewestLogId(qsales_handle,DSJ.LOGANY)
LatestEventString =
➥ DSGetLogEntry(qsales_handle,latestlogid)
DSGetLogSummary
Returns a list of short log event details. The details returned are
determined by the setting of some filters. (Care should be taken with
the setting of the filters, otherwise a large amount of information can
be returned.)
Syntax
SummaryArray = DSGetLogSummary (JobHandle, EventType, StartTime,
EndTime, MaxNumber)
Example
The following command produces an array of reject link active events
recorded for the qsales job between 18th August 1998, and 18th
September 1998, up to a maximum of MAXREJ entries:
RejEntries = DSGetLogSummary (qsales_handle,
➥ DSJ.LOGREJECT, "1998-08-18 00:00:00", "1998-09-18
➥ 00:00:00", MAXREJ)
DSGetNewestLogId
Gets the ID of the most recent log event in a particular category, or in
any category.
Syntax
EventId = DSGetNewestLogId (JobHandle, EventType)
Example
The following command obtains an ID for the most recent warning
message in the log for the qsales job:
Warnid = DSGetNewestLogId (qsales_handle,
➥ DSJ.LOGWARNING)
DSGetParamInfo
Provides a method of obtaining information about a parameter, which
can be used generally as well as for job control. This routine may
reference either a controlled job or the current job, depending on the
value of JobHandle.
Syntax
Result = DSGetParamInfo (JobHandle, ParamName, InfoType)
Remarks
When referring to a controlled job, DSGetParamInfo can be used
either before or after a DSRunJob has been issued. Any status
returned following a successful call to DSRunJob is guaranteed to
relate to that run of the job.
Example
The following command requests the default value of the quarter
parameter for the qsales job:
DSGetProjectInfo
Provides a method of obtaining information about the current project.
Syntax
Result = DSGetProjectInfo (InfoType)
DSGetStageInfo
Provides a method of obtaining information about a stage, which can
be used generally as well as for job control. It can refer to the current
job, or a controlled job, depending on the value of JobHandle.
Syntax
Result = DSGetStageInfo (JobHandle, StageName, InfoType)
Remarks
When referring to a controlled job, DSGetStageInfo can be used
either before or after a DSRunJob has been issued. Any status
returned following a successful call to DSRunJob is guaranteed to
relate to that run of the job.
Example
The following command requests the last error message for the
loader stage of the job qsales:
stage_status = DSGetStageInfo(qsales_handle, "loader",
➥ DSJ.STAGELASTERR)
DSGetStageLinks
Returns a field mark delimited list containing the names of all of the
input/output links of the specified stage.
Syntax
Result = DSGetStageLinks(JobName, StageName, Key)
or
Call DSGetStageLinks(Result, JobName, StageName, Key)
JobName is the name of the job in the current project for which
information is required. If the JobName does not exist in the current
project, then the function will return an empty string.
StageName is the name of the stage in the specified job for which
information is required. If the StageName does not exist in the
specified job then the function will return an empty string.
Key depending on the value of Key the returned list will contain all of
the stages links (Key=0), only the stage’s input links (Key=1) or only
the stage’s output links (Key=2).
Result returns a field mark delimited list containing the names of the
links.
Example
The following returns a list of all the input links on the stage called
“join1” in the job “testjob”:
linkslist = DSGetStageLinks (testjob, join1, 1)
DSGetStagesOfType
Returns a field mark delimited list containing the names of all of the
stages of the specified type in a named job..
Syntax
Result = DSGetStagesOfType (JobName, StageType)
or
Call DSGetStagesOfType (Result, JobName, StageType)
JobName is the name of the job in the current project for which
information is required. If the JobName does not exist in the current
project then the function will return an empty string.
StageType is the name of the stage type, as shown by the Manager
stage type properties form eg CTransformerStage or ORAOCI8. If the
StageType does not exist in the current project or there are no stages
of that type in the specifed job, then the function will return an empty
string.
Result returns a field mark delimited list containing the names of all of
the stages of the specified type in a named job.
Example
The following returns a list of all the aggregator stages in the parallel
job “testjob”:
stagelist = DSGetStagesOfType (testjob, PxAggregator)
DSGetStagesTypes
Returns a field mark delimited string of all active and passive stage
types that exist within a named job..
Syntax
Result = DSGetStageTypes(JobName )
or
Call DSGetStageTypes(Result, JobName )
JobName is the name of the job in the current project for which
information is required. If JobName does not exist in the current
project, Result will be set to an empty string.
Result is a sorted, field mark delimited string of stage types within
JobName.
Example
The following returns a list of all the types of stage in the job
“testjob”:
stagetypelist = DSGetStagesOfType (testjob)
DSGetProjectInfo
Provides a method of obtaining information about variables used in
transformer stages.
Syntax
Result = DSGetVarInfo (JobHandle, StageName, VarName, InfoType)
DSLogEvent
Logs an event message to a job other than the current one. (Use
DSLogInfo, DSLogFatal, or DSLogWarn to log an event to the
current job.)
Syntax
ErrCode = DSLogEvent (JobHandle, EventType, EventMsg)
Example
The following command, when included in the msales job, adds the
message “monthly sales complete” to the log for the qsales job:
Logerror = DsLogEvent (qsales_handle, DSJ.LOGINFO,
➥ "monthly sales complete")
DSLogFatal
Logs a fatal error message in a job's log file and aborts the job.
Syntax
Call DSLogFatal (Message, CallingProgName)
Remarks
DSLogFatal writes the fatal error message to the job log file and
aborts the job. DSLogFatal never returns to the calling before/after
subroutine, so it should be used with caution. If a job stops with a fatal
error, it must be reset using the DataStage Director before it can be
rerun.
In a before/after subroutine, it is better to log a warning message
(using DSLogWarn) and exit with a nonzero error code, which allows
DataStage to stop the job cleanly.
DSLogFatal should not be used in a transform. Use
DSTransformError instead.
Example
Call DSLogFatal("Cannot open file", "MyRoutine")
DSLogInfo
Logs an information message in a job's log file.
Syntax
Call DSLogInfo (Message, CallingProgName)
Remarks
DSLogInfo writes the message text to the job log file as an
information message and returns to the calling routine or transform. If
DSLogInfo is called during the test phase for a newly created routine
in the DataStage Manager, the two arguments are displayed in the
results window.
Unlimited information messages can be written to the job log file.
However, if a lot of messages are produced the job may run slowly
and the DataStage Director may take some time to display the job log
file.
Example
Call DSLogInfo("Transforming: ":Arg1, "MyTransform")
DSLogToController
This routine may be used to put an info message in the log file of the
job controlling this job, if any. If there isn't one, the call is just ignored.
Syntax
Call DSLogToController(MsgString)
Remarks
If the current job is not under control, a silent exit is performed.
Example
Call DSLogToController(“This is logged to parent”)
DSLogWarn
Logs a warning message in a job's log file.
Syntax
Call DSLogWarn (Message, CallingProgName)
Remarks
DSLogWarn writes the message to the job log file as a warning and
returns to the calling before/after subroutine. If the job has a warning
limit defined for it, when the number of warnings reaches that limit,
the call does not return and the job is aborted.
DSLogWarn should not be used in a transform. Use
DSTransformError instead.
Example
If InputArg > 100 Then
Call DSLogWarn("Input must be =< 100; received
":InputArg,"MyRoutine")
End Else
* Carry on processing unless the job aborts
End
DSMakeJobReport
Generates a report describing the complete status of a valid attached
job.
Syntax
ReportText = DSMakeJobReport(JobHandle, ReportLevel, LineSeparator)
Remarks
If a bad job handle is given, or any other error is encountered,
information is added to the ReportText.
Example
h$ = DSAttachJob(“MyJob”, DSJ.ERRNONE)
rpt$ = DSMakeJobReport(h$,0,”CRLF”)
DSMakeMsg
Insert arguments into a message template. Optionally, it will look up a
template ID in the standard DataStage messages file, and use any
returned message template instead of that given to the routine.
DSMakeMsg
Syntax
FullText = DSMakeMsg(Template, ArgList)
Remarks
This routine is called from job control code created by the
JobSequence Generator. It is basically an interlude to call
DSRMessage which hides any runtime includes.
It will also perform local job parameter substitution in the message
text. That is, if called from within a job, it looks for substrings such as
"#xyz#" and replaces them with the value of the job parameter named
"xyz".
Example
t$ = DSMakeMsg(“Error calling DSAttachJob(%1)<L>%2”,
➥jb$:@FM:DSGetLastErrorMsg())
DSPrepareJob
Used to ensure that a compiled job is in the correct state to be run or
validated.
Syntax
JobHandle = DSPrepareJob(JobHandle)
Example
h$ = DSPrepareJob(h$)
DSRunJob
Starts a job running. Note that this call is asynchronous; the request is
passed to the run-time engine, but you are not informed of its
progress.
Syntax
ErrCode = DSRunJob (JobHandle, RunMode)
Remarks
If the controlling job is running in validate mode, then any calls of
DSRunJob will act as if RunMode was DSJ.RUNVALIDATE,
regardless of the actual setting.
A job in validate mode will run its JobControl routine (if any) rather
than just check for its existence, as is the case for before/after routines.
This allows you to examine the log of what jobs it started up in
validate mode.
After a call of DSRunJob, the controlled job’s handle is unloaded. If
you require to run the same job again, you must use DSDetachJob
and DSAttachJob to set a new handle. Note that you will also need
to use DSWaitForJob, as you cannot attach to a job while it is
running.
Example
The following command starts the job qsales in standard mode:
RunErr = DSRunJob(qsales_handle, DSJ.RUNNORMAL)
DSSendMail
This routine is an interface to a sendmail program that is assumed to
exist somewhere in the search path of the current user (on the server).
It hides the different call interfaces to various sendmail programs, and
provides a simple interface for sending text. For example:
Syntax
Reply = DSSendMail(Parameters)
Remarks
The routine looks for a local file, in the current project directory, with a
well-known name. That is, a template to describe exactly how to run
the local sendmail command.
Example
code = DSSendMail("From:me@here\nTo:You@there\nSubject:Hi
ya\nBody:Line1\nLine2")
DSSetGenerateOpMetaData
Use this to specify whether the job generates operational meta data or
not. This overrides the default setting for the project. In order to
generate operational meta data the Process MetaBroker must be
installed on your DataStage machine.
Syntax
ErrCode = DSSetGenerateOpMetaData (JobHandle, value)
Example
The following command causes the job qsales to generate operational
meta data whatever the project default specifies:
GenErr = DSSetGenerateOpMetaData(qsales_handle, TRUE)
DSSetJobLimit
By default a controlled job inherits any row or warning limits from the
controlling job. These can, however, be overridden using the
DSSetJobLimit function.
Syntax
ErrCode = DSSetJobLimit (JobHandle, LimitType, LimitValue)
Example
The following command sets a limit of 10 warnings on the qsales job
before it is stopped:
LimitErr = DSSetJobLimit(qsales_handle,
➥ DSJ.LIMITWARN, 10)
DSSetParam
Specifies job parameter values before running a job. Any parameter
not set will be defaulted.
Syntax
ErrCode = DSSetParam (JobHandle, ParamName, ParamValue)
Example
The following commands set the quarter parameter to 1 and the
startdate parameter to 1/1/97 for the qsales job:
paramerr = DSSetParam (qsales_handle, "quarter", "1")
paramerr = DSSetParam (qsales_handle, "startdate",
➥ "1997-01-01")
DSSetUserStatus
Applies only to the current job, and does not take a JobHandle
parameter. It can be used by any job in either a JobControl or After
routine to set a termination code for interrogation by another job. In
fact, the code may be set at any point in the job, and the last setting is
the one that will be picked up at any time. So to be certain of getting
the actual termination code for a job the caller should use
DSWaitForJob and DSGetJobInfo first, checking for a successful
finishing status.
This routine is defined as a subroutine not a function because there
are no possible errors.
Syntax
Call DSSetUserStatus (UserStatus)
Example
The following command sets a termination code of “sales job done”:
Call DSSetUserStatus("sales job done")
DSStopJob
This routine should only be used after a DSRunJob has been issued.
It immediately sends a stop request to the run-time engine. The call is
asynchronous. If you need to know that the job has actually stopped,
you must call DSWaitForJob or use the Sleep statement and poll for
DSGetJobStatus. Note that the stop request gets sent regardless of
the job's current status.
Syntax
ErrCode = DSStopJob (JobHandle)
Example
The following command requests that the qsales job is stopped:
stoperr = DSStopJob(qsales_handle)
DSTransformError
Logs a warning message to a job log file. This function is called from
transforms only.
Syntax
Call DSTransformError (Message, TransformName)
Remarks
DSTransformError writes the message (and other information) to
the job log file as a warning and returns to the transform. If the job has
a warning limit defined for it, when the number of warnings reaches
that limit, the call does not return and the job is aborted.
In addition to the warning message, DSTransformError logs the
values of all columns in the current rows for all input and output links
connected to the current stage.
Example
Function MySqrt(Arg1)
If Arg1 < 0 Then
Call DSTransformError("Negative value:"Arg1, "MySqrt")
Return("0") ;*transform produces 0 in this case
End
Result = Sqrt(Arg1) ;* else return the square root
Return(Result)
DSTranslateCode
Converts a job control status or error code into an explanatory text
message.
Syntax
Ans = DSTranslateCode(Code)
Code is:
If Code > 0, it's assumed to be a job status.
If Code < 0, it's assumed to be an error code.
(0 should never be passed in, and will return "no error")
Ans is the message associated with the code.
Remarks
If Code is not recognized, then Ans will report it.
Example
code$ = DSGetLastErrorMsg()
ans$ = DSTranslateCode(code$)
DSWaitForFile
Suspend a job until a named file either exists or does not exist.
Syntax
Reply = DSWaitForFile(Parameters)
Examples
Reply = DSWaitForFile("C:\ftp\incoming.txt timeout:2H")
DSWaitForJob
This function is only valid if the current job has issued a DSRunJob
on the given JobHandle(s). It returns if the/a job has started since the
last DSRunJob has since finished.
Syntax
ErrCode = DSWaitForJob (JobHandle)
Remarks
DSWaitForJob will wait for either a single job or multiple jobs.
Example
To wait for the return of the qsales job:
WaitErr = DSWaitForJob(qsales_handle)
Starting a Job
You can start, stop, validate, and reset jobs using the –run option.
dsjob –run
[ –mode [ NORMAL | RESET | VALIDATE ] ]
[ –param name=value ]
[ –warn n ]
[ –rows n ]
[ –wait ]
[ –stop ]
[ –jobstatus]
[–userstatus]
[–local]
[–opmetadata [TRUE | FALSE]]
[-disableprjhandler]
[-disablejobhandler]
[useid] project job|job_id
–mode specifies the type of job run. NORMAL starts a job run, RESET
resets the job and VALIDATE validates the job. If –mode is not
specified, a normal job run is started.
–param specifies a parameter value to pass to the job. The value is in
the format name=value, where name is the parameter name, and
value is the value to be set. If you use this to pass a value of an
environment variable for a job (as you may do for parallel jobs), you
need to quote the environment variable and its value, for example -
param '$APT_CONFIG_FILE=chris.apt' otherwise the current
value of the environment variable will be used.
–warn n sets warning limits to the value specified by n (equivalent to
the DSSetJobLimit function used with DSJ_LIMITWARN specified as
the LimitType parameter).
–rows n sets row limits to the value specified by n (equivalent to the
DSSetJobLimit function used with DSJ_LIMITROWS specified as the
LimitType parameter).
–wait waits for the job to complete (equivalent to the DSWaitForJob
function).
–stop terminates a running job (equivalent to the DSStopJob
function).
–jobstatus waits for the job to complete, then returns an exit code
derived from the job status.
–userstatus waits for the job to complete, then returns an exit code
derived from the user status if that status is defined. The user status is
a string, and it is converted to an integer exit code. The exit code 0
indicates that the job completed without an error, but that the user
status string could not be converted. If a job returns a negative user
status value, it is interpreted as an error.
-local use this when running a DataStage job from withing a
shellscript on a UNIX server. Provided the script is run in the project
directory, the job will pick up the settings for any environment
variables set in the script and any setting specific to the user
environment.
-opmetadata use this to have the job generate operational meta data
as it runs. If MetaStage, or the Process Meta Data MetaBroker, is not
installed on the machine, then the option has no effect. If you specify
TRUE, operational meta data is generated, whatever the default
setting for the project. If you specify FALSE, the job will not generate
operational meta data, whatever the default setting for the project.
Stopping a Job
You can stop a job using the –stop option.
dsjob –stop [useid] project job|job_id
Listing Projects
The following syntax displays a list of all known projects on the
server:
dsjob –lprojects
Listing Jobs
The following syntax displays a list of all jobs in the specified project:
dsjob –ljobs project
Listing Stages
The following syntax displays a list of all stages in a job:
dsjob –lstages [useid] project job|job_id
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job containing the stages to list. To identify a
job invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145)
This syntax is equivalent to the DSGetJobInfo function with
DSJ_STAGELIST specified as the InfoType parameter.
Listing Links
The following syntax displays a list of all the links to or from a stage:
dsjob –llinks [useid] project job|job_id stage
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job containing stage. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
stage is the name of the stage containing the links to list.
This syntax is equivalent to the DSGetStageInfo function with
DSJ_LINKLIST specified as the InfoType parameter.
Listing Parameters
The following syntax display a list of all the parameters in a job and
their values:
dsjob –lparams [useid] project job|job_id
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job whose parameters are to be listed. To
identify a job invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
This syntax is equivalent to the DSGetJobInfo function with
DSJ_PARAMLIST specified as the InfoType parameter.
Listing Invocations
The following syntax displays a list of the invocations of a job:
dsjob -linvocations
my_ID is the alias you want to set for the job. If you omit my_ID, the
command will return the current alias for the specified job. An alias
must be unique within the project, if the alias already exists an error
message is displayed
project is the name of the project containing job.
job is the name of the job. To identify a job invocation, use the format
job.invocation_id.
Retrieving Information
The dsjob command can be used to retrieve and display the available
information about specific projects, jobs, stages, or links. The different
versions of the syntax are described in the following sections.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job. To identify a job invocation, use the format
job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
The following information is displayed:
The current status of the job
The name of any controlling job for the job
The date and time when the job started
The wave number of the last or current run (internal DataStage
reference number)
User status
This syntax is equivalent to the DSGetJobInfo function.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job containing stage. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
stage is the name of the stage.
The following information is displayed:
The last error message reported from any link to or from the stage
The stage type name, for example, Transformer or Aggregator
The primary links input row number
This syntax is equivalent to the DSGetStageInfo function.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job containing stage. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
stage is the name of the stage containing link.
link is the name of the stage.
The following information is displayed:
The last error message reported by the link
The number of rows that have passed down a link
This syntax is equivalent to the DSGetLinkInfo function.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the name of the project containing job.
job is the name of the job containing parameter. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
parameter is the name of the parameter.
The following information is displayed:
The parameter type
The parameter value
Help text for the parameter that was provided by the job’s
designer
Whether the value should be prompted for
The default value that was specified by the job’s designer
Any list of values
The list of values provided by the job’s designer
This syntax is equivalent to the DSGetParamInfo function.
–type type specifies the type of log entry to retrieve. If –type type is
not specified, all the entries are retrieved. type can be one of the
following options:
WARNING Warning.
ANY All entries of any type. This is the default if type is not specified.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the project containing job.
job is the job whose log entries are to be retrieved. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
entry is the event number assigned to the entry. The first entry in the
file is 0.
This syntax is equivalent to the DSGetLogEntry function.
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the project containing job.
job is the job whose log entries are to be retrieved. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
type can be one of the following options:
WARNING Warning
BATCH Batch
Generating a Report
The dsjob command can be used to generate an XML format report
containing job, stage, and link information.
dsjob –report [useid] project job|jobid [report_type]
useid specify this if you intend to use a job alias (jobid) rather than a
job name (job) to identify the job.
project is the project containing job.
job specifies the job to be reported on by job name. To identify a job
invocation, use the format job.invocation_id.
job_id is an alias for the job that has been set using the dsjob -jobid
command (see page 7-145).
report_type is one of the following:
BASIC – Text string containing start/end time, time elapsed and
status of job.
DETAIL – As basic report, but also contains information about
individual stages and links within the job.
LIST – Text string containing full XML report.
By default the generated XML will not contain a <?xml-stylesheet?>
processing instruction. If a stylesheet is required, specify a
RetportLevel of 2 and append the name of the required stylesheet
URL, i.e., 2:styleSheetURL. This inserts a processing instruction into
the generated XML of the form:
<?xml-stylesheet type=text/xsl” href=”styleSheetURL”?>
Creating a Project
The dsadmin command can be used for creating projects. You need to
have DataStage administrator status in order to use this command:
dsadmin -createproject ProjectName [-location ProjectLocation]
Deleting a Project
The dsadmin command can be used for deleting existing projects.
You need to have DataStage administrator status in order to use this
command:
dsadmin -deleteproject ProjectName
ProjectName is the project whose parallel jobs will have the specified
advanced runtime options set.
AdvancedRuntimeOptions is the value to set the property to and must
be quoted.
This command is only available for Enterprise Edition.
To unset the properties repeat the command with an empty string, for
example:
dsadmin -advancedruntime "“ myproject
Listing Projects
The dsadmin command can be used for listing the projects on a
server.
dsadmin -listprojects
Listing Properties
The dsadmin command can be used for listing the properties of a
project. The following properties are listed:
JobName is the full or partial name of the job to search for. For partial
job name matching, any number of * characters can be used for
missing parts using wildcard matching. If the job name is not
supplied, then all jobs will be returned.
ProjectName the project containing the job specified by JobName.
-ljobs indicates that jobs are to be searched.
-matches indicates that jobs are to be searched by name.
- sub[categories] optionally indicates that the the supplied starting
category and all subcategories will be searched. When no category is
specified and the subcategories option is specified, the whole project
is searched.
returns all the jobs in the project called dstage project that start with
the text “Job”. The order of the returned jobs is based on category
order, and then job type within the category. An example result might
look like:
Job1,server job
Job2,sequence job
Category1\Job3,server job
Category1\Job4,server job
Category1\SubCategory1\Job5,sequence job
Category2\SubCategory2\Job6,server job
JobName is the full name of the job whose inclusion in job sequences
you are searching. Remember, job names are unique throughout the
whole project, so do not have to be qualified by category.
ProjectName the project containing the job specified by JobName.
-ljobs indicates that jobs are to be searched.
–usedby finds where the supplied job is used. In other words it finds
all jobs that have the supplied job in its dependency list.
-recursive takes each sequence job that the supplied job is in, and
recursively searches for sequence jobs that in turn contain them.
-ocategory specifies that, for each job found, the full category path
should be output.
-ojobtype specifies that, for each job found, its job type is output after
a comma.
Each sequence job found is output on a new line. When the –
recursive option is supplied, the tab character is used to show the
tree of jobs being used by other jobs. When the –ojobtype option is
supplied, the job type is output after each job name, separated from
the name by a comma.
For example:
dssearch –ljobs –usedby –r –oc –oj dstage JobE
-ocategory specifies that, for each job found, the full category path
will be output.
-ojobtype specifies that, for each job found, its job type should be
output.
Each job found is output on a new line. When the –recursive option is
supplied, the tab character is used to show the tree of jobs using other
jobs. When the –ojobtype option is supplied, the job type is output
after each job name, separated from the name by a comma.
For example:
dssearch –ljobs –uses -recursive –ocategory dstage ContainingJob
An example output from this command shows that JobA and JobB
jobs are used by the sequence ContainingJob. The jobs named JobC
and JobD are used by the job named JobB. JobE is a job that is used
by JobD.
CategoryA\JobA
CategoryA\JobB
CategoryA\CategoryB\JobC
CategoryA\CategoryB\JobD
CategoryA\JobE
TableName is the full or partial name of the table to search for. For
partial table name matching, any number of * characters can be used
for missing parts using wildcard matching. All jobs containing a DRS
stage that accesses this table will be returned by the search.
ProjectName is the project containing the jobs being searched.
-ljobs indicates that jobs are to be searched.
-usesdrstable indicates that jobs are to be searched for DSR stages
containing the table.
-source specify this if you only want jobs returned that use the table
as a source
-target specify this if you only want jobs returned that use the table
as a target.
-ocategory specifies that, for each job found, the full category path
will be output.
-ojobtype specifies that, for each job found, its job type should be
output.
For example:
dssearch –ljobs –usesdrstable -source dstage customers
returns a list of jobs containing DRS stages that use the customers
table as a data source.
dssearch –ljobs –usesdrstable –s –oc –oj dstage *.Person
This command-line returns all the jobs, with category and job type,
containing DRS Stages with a source table whose name ends in
“.Person”. A possible result could be:
CategoryA\DRSJobA,server job
CategoryB\DRSJobB,server job
DataStage comes with a range of header files that you can include in
code when you are defining a Build stage. The following sections list
the header files and the classes and macros that they contain. See the
header files themselves for more details about available functionality.
apt_ util/locator. h
APT_ Locator
apt_ util/persist. h
APT_ Persistent
apt_ util/proplist. h
APT_ Property
APT_ PropertyList
apt_ util/random. h
APT_ RandomNumberGenerator
apt_ util/rtti. h
APT_ TypeInfo
apt_ util/ string. h
APT_ String
APT_ StringAccum
apt_ util/ time. h
APT_ Time
APT_ TimeStamp
apt_util/ustring.h
APT_UString
writing
DataStage API programs 7–3