Page 1 of 1

How to validate a column having website url value

Posted: Tue Feb 19, 2013 7:38 am
by k2g
Hi,
In my source file, I have one column named as website_url. Before loading into target, I have to validate if it's value is proper website url or not.
For eg: It should start with www, http:// or https://. Also it should have valid domain. For eg: It should have formate like http://xxxx.xx.xx or other possible value. I am not able to cover all possible scenario and need help of you all expert. I am only 5 month old in Datastage. Your help will be much appreciated.

Thanks.

Posted: Tue Feb 19, 2013 8:37 am
by bob7027
as per your validation, use index function to search for the string what you want, like HTTP or HTTPs.
and later search for the string in which format you are expecting it to be.
Check for conditions for your URL contains alpha numeric.

Posted: Tue Feb 19, 2013 4:10 pm
by ray.wurlod
Welcome aboard.

If you are using version 8.7 or later and if you have Information Analyzer licensed then you can use the Data Rules stage to perform a matches_regex test on the URL. This is by far the easiest way to check URLs, as there are so many valid variants.

Posted: Tue Feb 19, 2013 9:53 pm
by k2g
Thanks Bob and ray for you reply.

Yes, I am checking this website_url column should not contain character like ! * ' ( ) ; : @ & = + $ , / ? % # [ ] . Apart from that, I am also checking that it should start with www, http:// or https://. I am not able to check the format of this website_url. For eg: If it's value is https://www.google.co.in , it is valid. But if it's value is https://www.googlecoin , it is not valid. Just wanted to know can we come up with common logic that we can implement in job to valid such things. Ray, As you mentioned, it can have many valid variant, that's why I am not able to come with common solution. I have to implement logic in job only, 8.1 Datastage.

Please help!

Thanks.