Fatal Error: Invalid time

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
mmanes
Participant
Posts: 91
Joined: Tue Mar 16, 2004 10:20 am
Location: Rome

Fatal Error: Invalid time

Post by mmanes »

Hi to everyone,
is there a way to check if an input is a date in a transformer stage?

tks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

IsValidDate()

Doesn't quite relate to your subject, though.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only if the source data type is a string of some kind.

If the source data type is Date, then theoretically it can't be invalid unless it has more fractional seconds than are specified in your metadata, or is not constructed using the format specified in your metadata.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I believe that the IsValidDate() only accepts the system default date format, if the string is different then IsValid('date',In.DateColumn,'%yyyy-%mm-%dd') would work, assuming your date format is 9999-12-31.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or that. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mmanes
Participant
Posts: 91
Joined: Tue Mar 16, 2004 10:20 am
Location: Rome

Post by mmanes »

I'm sorry,
I cannot see "premium content".

thank you anyway.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

We know. But there's plenty of information you can see, didn't any of it help? Let us know if you still have any specific questions... and I'm still wondering why your subject says "Invalid Time" and then you asked how to validate a date. Are you actually wondering how to validate a timestamp?
-craig

"You can never have too many knives" -- Logan Nine Fingers
mmanes
Participant
Posts: 91
Joined: Tue Mar 16, 2004 10:20 am
Location: Rome

Post by mmanes »

Yes, but I find only "isValid()" function.

There're not other functions like IsValidDate or IsValidTimestamp.

I need to check if a string is a timestamp

thank you
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What version are you on? Regardless - did you check the documentation for IsValid? It is multi-purpose as you might gather from the name:
The IsValid() documentation wrote:Returns whether the given string is valid for the given type. Valid types are "date", "decimal", "dfloat", "sfloat", "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "raw", "string", "time", "timestamp", "ustring".
There's more in the docs. Give that a shot.
-craig

"You can never have too many knives" -- Logan Nine Fingers
mmanes
Participant
Posts: 91
Joined: Tue Mar 16, 2004 10:20 am
Location: Rome

Post by mmanes »

My DS version is 8.1

I don't know the syntax of IsValid() to check a timestamp

I've, in a file...

NAME;YYYYMMDDHH24MISS;LOCATION

I need to check if timestamp field is a valid timestamp

tks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The syntax is in the documentation. Does your version support an 'optional format string'? That would simplify things but from some searches here and online 8.1 might not allow that optional third parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply