Page 1 of 1

Checking Phone number

Posted: Wed Mar 21, 2012 10:09 am
by BuddingDev
I want some suggestions on removing those phone number from consideration which has area code starting with 1 or 0.

In an existing rule set four dictionary fields are being populated for area code, exchange and number respectively.

I like to validate the area code does not start with 1 or 0.

I have tried creating following modification in.PAT file. It does not seem to be working.

**
COPY data(1:3) temp1
* [temp1(1:1] =1,0]
RETYPE [1] 0

Is there anything different needs to be done for this requirement?

Posted: Wed Mar 21, 2012 11:08 am
by Jboyd
Why not put the incoming data through a transformer and make a constraint on the flowing data allowing only the data to flow where the contraint =

(field.area_code [1,1]) <> 1 or (field.area_code [1,1]) <> 0

Posted: Wed Mar 21, 2012 11:57 am
by BuddingDev
Thanks for the quick response. It can be handled in transformer as you have said. However, I like to handle it in QS this time.
I kind of got somewhere after multiple trial and error.

**| [data(1:1) !=1]
the above code is giving me desired output but I like to give two numeric values as follows
** |[data(1:1) !=1,2]

Can somebody suggest me how to give multiple numeric conditional values in .PAT file.
Whenever I am attempting to give multiple values , My window is shutting down to no avail.

Posted: Wed Mar 21, 2012 4:52 pm
by stuartjvnorton
Try double-quotes around the 1 and 2:

Code: Select all

** |[data(1:1) !="1","2"] 
or

Code: Select all

** |[data(1:1) !="1" "2"] 

Posted: Thu Mar 22, 2012 12:34 pm
by BuddingDev
In my case this double quote was not working So I decided to use & between two conditional operators and it worked.

Thanks all for your suggestions.