Date help

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
marc_brown98
Premium Member
Premium Member
Posts: 67
Joined: Wed Apr 14, 2004 11:33 am

Date help

Post by marc_brown98 »

I was wondering if anybody has seen this situation. I am using the following: DATE.TAG(@DATE) to insert into 2 different columns, one has the correct date, for instance '2004-05-04 00:00:00.000' and the next column ends up with '4513-02-25 00:00:00.000' the target db is sql server 2000, both fields are defined exactly the same in the db and defined in xfm the same. Any help or work arounds would be greatly appreciated.

Thanks,
Marc
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

I would use a stage variable for your date and then write it to both the columns. It seems that would keep them the same.

John
marc_brown98
Premium Member
Premium Member
Posts: 67
Joined: Wed Apr 14, 2004 11:33 am

Post by marc_brown98 »

thanks. I will take a look at doing that.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

When you do, consider putting the derivation (DATE.TAG(@DATE)) in the 'Initial Value' area when you define the variable. Then simply use it in your Transformation derivations. This way you incur the overhead of the system call to get the current date once and then simply leverage it after that. In your original layout, you are calling it two times for every record through the job. And it probably isn't changing. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
marc_brown98
Premium Member
Premium Member
Posts: 67
Joined: Wed Apr 14, 2004 11:33 am

Post by marc_brown98 »

Craig,
Yup, I wasn't even thinking about that, your right. mucho thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DATE.TAG has been around for a long time. It simply performs Oconv(%Arg1%, "D-YMD[4,2,2]"), so should not have any side effects. So this is very odd behaviour indeed.
Is it reproducible? If so take a look at the generated Transformer stage code (in the RT_BPnnn directory, where nnn is your job number) to see whether you can spot anything in the job logic.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
marc_brown98
Premium Member
Premium Member
Posts: 67
Joined: Wed Apr 14, 2004 11:33 am

Post by marc_brown98 »

Ray,
I got it straightened out at least it is not doing it, I think I was parsing the file wrong, etc...Thanks for the help.
Post Reply