time stamp concatenation

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
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

time stamp concatenation

Post by scottr »

friends i have 4 fields as HR,MIN,SEC,AM_PM_Flag.

how to concate these fields to get time stamp like HR:MIN:SECAM_PM_FLAG. i tried with the regular : but all i got is HRMINSECAM_PM_FLAG.

thanks for ur help
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Code: Select all

linkname.HR:linkname.MIN:linkname.SEC:linkname.AM_PM_Flag
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

Post by scottr »

Ken, the output came like 02025AM ,but i want it like 02:02:5AM

thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you want delimiters, you have to concatenate them in, too.

Code: Select all

HR : ":" : MIN : ":" : SEC : " " : AM_PM_Flag
Or, if you can be certain that each component is two characters long, you can concatenate first and format later.

Code: Select all

Fmt(HR:MIN:SEC:AM_PM_Flag, "R##:##:## ##")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
scottr
Participant
Posts: 51
Joined: Thu Dec 02, 2004 11:20 am

Post by scottr »

Thanks Ray...
Post Reply