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
Gopalraja
Participant
Posts: 18 Joined: Wed Jun 18, 2008 3:51 am
Location: Chennai
Post
by Gopalraja » Tue Apr 28, 2009 11:39 pm
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 » Tue Apr 28, 2009 11:57 pm
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 » Wed Apr 29, 2009 3:05 am
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 » Wed Apr 29, 2009 3:22 am
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 » Wed Apr 29, 2009 3:23 am
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 » Wed Apr 29, 2009 4:38 am
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 » Wed Apr 29, 2009 5:11 pm
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...