Data type check

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
Gopalraja
Participant
Posts: 18
Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai

Data type check

Post by Gopalraja »

Hi,

I want to chcek the data type is correct or not.

For example:

I have 2 columns in my source i.e EmpNo(Integer) and EmpName(String).
I want to check the Empno is integer and EmpName is string. How to check these two column data tyes are correct or not.

Is there any other way to check these kind of scenario.

Thanks in Advance...
Aswice
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

When is a string not a string?

Check out IsValid (if you want to keep processing with a default) and the Column Import stage (if you want to reject invalid records)
Gopalraja
Participant
Posts: 18
Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai

Post by Gopalraja »

Thanks for your reply.

IsValid check is possible to check only the string to string data type. But I want to check all kind of data types check.

Is any other function available apart from this IsValid check funtion.

Thanks in Advance
Aswice
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

You can use NUM function to check numerical value and Alpha function to check string values.
Nirdesh Kumar
nirdesh2
Participant
Posts: 56
Joined: Thu Nov 20, 2008 12:18 pm
Location: Noida

Post by nirdesh2 »

You can use NUM function to check numerical(integer) value and Alpha function to check string values.
Nirdesh Kumar
Gopalraja
Participant
Posts: 18
Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai

Post by Gopalraja »

Hi Nirdesh Kumar,

I got it..Thanks for your reply....


With Regards,
Aswice
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Gopalraja wrote: IsValid check is possible to check only the string to string data type. But I want to check all kind of data types check.
It is?

Code: Select all

IsValid Return 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" type (string) format (string) result (int8) 
Works fine for our float check too...
Post Reply