Function to check for strings

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
ppp
Participant
Posts: 21
Joined: Mon Aug 31, 2009 11:53 am

Function to check for strings

Post by ppp »

I have input data which is being read as varchar and it has to b parsed out to get the zipcode.
We have a requirement which asks to check for strings in this field(zipcode).

How do I achieve this in the transformer?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Umm... I think your terminology lacks a little something.

Do you mean "check for non-numeric characters" or "check for alphabetic characters" or some such?

The Num() function will check whether it's purely numeric, or you could use IsValid() to check whether it's an integer. Another more general approach is to use Convert() functions to eliminate all unwanted characters and compare that result to the original.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ppp
Participant
Posts: 21
Joined: Mon Aug 31, 2009 11:53 am

Post by ppp »

You are absolutely right. The Num() Function works perfect. Thank you
Post Reply