Name 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
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Name check

Post by devidotcom »

Hi All,

I have a small check to be done on the customer name column (Cust_Name) to term it a valid name value.

This column can have
1. Only letters in upcase (A-Z)
2. Numbers (0-9)
3. Can contain only these values (& . ,)

What is best way we can handle this.

Please let me know.

Thanks
Devi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Convert all the valid characters to "" using a single Convert() function then test using Len() function to determine whether anything remains. The following expression is true if TheField contains a valid value, false if not.

Code: Select all

Len(Convert("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&.,","",InLink.TheField)) = 0
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
devidotcom
Participant
Posts: 247
Joined: Thu Apr 27, 2006 6:38 am
Location: Hyderabad

Post by devidotcom »

Thank you Ray.
Post Reply