Data Elements
Posted: Mon May 28, 2001 5:21 am
A few on the list have expressed wonder at the function of data elements. Try this little experiment.
Construct a DataStage job that extracts all four columns from the UV table EXAMPLE1. In a Transformer stage, generate three output columns; PRODUCT, SALEDATE and QTY. PRODUCT and QTY are unchanged; apply the TIMESTAMP transform to the input column DATE to generate SALEDATE. Results go into a text file.
Compile and run the job, with warning limit set to 0 (unlimited). Inspect the results.
Now, go back and set the data element column for DATE equal to Date. Recompile and run again.
The data element applies an automatic date conversion to the input column. This mimics the behaviour of the SQLBindParameter and SQLBindCol() functions, where the third argument can specify internal date or time format. This works with UV and ODBC stage types at the very least.
Construct a DataStage job that extracts all four columns from the UV table EXAMPLE1. In a Transformer stage, generate three output columns; PRODUCT, SALEDATE and QTY. PRODUCT and QTY are unchanged; apply the TIMESTAMP transform to the input column DATE to generate SALEDATE. Results go into a text file.
Compile and run the job, with warning limit set to 0 (unlimited). Inspect the results.
Now, go back and set the data element column for DATE equal to Date. Recompile and run again.
The data element applies an automatic date conversion to the input column. This mimics the behaviour of the SQLBindParameter and SQLBindCol() functions, where the third argument can specify internal date or time format. This works with UV and ODBC stage types at the very least.