Modify to "truncate" timestamp

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Hesubo
Charter Member
Charter Member
Posts: 7
Joined: Tue Jul 18, 2006 5:30 pm
Location: Salisbury, NC

Modify to "truncate" timestamp

Post by Hesubo »

I have a need to drop the time portion of a timestamp and store the data back into a timestamp field. The result basically changing the time portion to 00:00:00

Ive tried the following:

trans_dt = Timestamp_From_date(Date_From_Timestamp(tdatetime))

but am receiving the following error:

main_program: Error parsing modify adapter: Error in binding: Expected ')', got: "("
Expected destination field selector, got: ")"; input:
KEEP trans_dt
;
trans_dt = Timestamp_From_date(Date_From_Timestamp(tdatetime))

Please bear with me as I am new to using the Modify stage. I'm attempting to convert from using the transformer stage as recommended in the video tech tip.

The code in the transformer stage that I am replacing is:
TimestampFromDateTime(TimestampToDate(DSLink37.TDATETIME) ,"00:00:00")

Thanks in advance for the help
Hesubo
Charter Member
Charter Member
Posts: 7
Joined: Tue Jul 18, 2006 5:30 pm
Location: Salisbury, NC

Post by Hesubo »

I've just noticed a comment in another post that indicates nested functions are not permitted in Modify stage. That must be my problem.

Given that, can I accomplish what I desire through some other method in the Modify stage or should I stick with the transformer stage?
kura
Participant
Posts: 21
Joined: Sat Mar 20, 2004 3:43 pm

Re: Modify to "truncate" timestamp

Post by kura »

yes, nested function is not compatible with MODIFY stage.

Depending upon how many transformation you do and volume of the data. I would choose either of Modify vs Transformer.

From my experience I recommend Modify.
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Kura,
I like to know why you prefer using Modify stage while we can do this in the Transformer stage too.I am new to DS.Willing to know the difference between them.

Thank you....
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

meena wrote:Hi Kura,
I like to know why you prefer using Modify stage while we can do this in the Transformer stage too.I am new to DS.Willing to know the difference between them.

Thank you....
Because modify is much efficient than transformer stage.
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi balajisr
Thank you...I got it.

Code: Select all


Because modify is much efficient than transformer stage

kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Check the post "Difference between Transformer Stage and all other stage". You can also find the controversial fact given by Pneuma Lin and opdas. you can also find the interesting Vincents bog.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply