Load type custom

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Load type custom

Post by MAT »

Hi all,

I would like to assign the value Current_Timestamp directly at the level of the loading stage. My first attempt of replacing the value ":MOD_DT_TM" by Current_Timestamp resulted in an error.

Mload Script:
dml label tdmload do update the existing rows;
UPDATE #ThisDataBase#.#Table#
SET EMAIL_ADDR = :EMAIL_ADDR,
MOD_DT_TM = current_timestamp
WHERE CUST_ACCT_ID = :CUST_ACCT_ID;
import INFILE #FilePath#/Dly/multiload/#ThisJob# format fastload
layout internal apply tdmload;

Thanks

MAT
ariear
Participant
Posts: 237
Joined: Thu Dec 26, 2002 2:19 pm

Post by ariear »

What is current_timestamp ? it's not a Datastage parameter (No # 'round it)
If it's a DataStage routine/Transform I don't believe the DataStage compiler will substitute it with a value at run time. You're running a Teradata utility based on a static input file after all
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Agreed.

Calculate the current timestamp (once) in a stage variable
Oconv(@DATE,"D-YMD[4,2,2]"):" ":Oconv(@TIME,"MTS:")

Use this stage variable to deliver the value to the MOD_DT_TM column.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Post by MAT »

Current_Timestamp is an Sql teradata variable. I Agree with you about the format of the TimeStamp in DataStage but I would like to use this current_Timestamp as it is more accurate.

When I see the Log report, I have this message :

"DML label name 'TDMLOAD' was not previously defined."

TDMLOAD is the Teradata Stage.

Thanks

MAT
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Post by MAT »

The Answer is :[:p]

.dml label tdmload;
UPDATE #ThisDataBase#.#Table#
SET EMAIL_ADDR = :EMAIL_ADDR,
MOD_DT_TM = current_timestamp
WHERE CUST_ACCT_ID = :CUST_ACCT_ID;
.import INFILE #FilePath#/Dly/multiload/xxx format fastload
layout internal apply tdmload;

with xxx : name of your stage. And the field "MOD_DT_TM" has to be declared in your Input file as if you don't take the value.

MAT
Post Reply