(a) Source: DB2 UDB Database
(b) Target : Sequential file
(c) Objective: Timestamp value to be represented in YYYY-MM-DD-HH:MM:SS.ssssss format
Corvertiion > Timestamp to YYYY-MM-DD-HH:MM:SS.ssssss for
Moderators: chulett, rschirm, roy
Corvertiion > Timestamp to YYYY-MM-DD-HH:MM:SS.ssssss for
Last edited by cosec on Wed Mar 27, 2013 9:26 pm, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
OK, so you need to convert the space to a "-" and force six places in the fractional seconds piece. Try something like this:
That is, everything to the left of the "." with the space character converted, concatenated with a dot and then everything to the right of the dot with sufficient trailing zeroes to make six characters.
Some people prefer the alternative formulation "6'0'L" rather than "L%6" for the format string argument of the Fmt() function. They are equivalent.
Code: Select all
Convert(" ", "-", Field(InLink.TheTimestamp, ".", 1,1 ) : "." : Fmt(Field(InLink.TheTimestamp, ".", 2, 1), "L%6")
Some people prefer the alternative formulation "6'0'L" rather than "L%6" for the format string argument of the Fmt() function. They are equivalent.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.