Page 1 of 1

Checking the format of the string

Posted: Wed May 26, 2010 12:41 pm
by Murali4u
Dear all,

This question may be simple or known to all.
Can we have any function to check the format of the string like for eg

'XX XXX' * return true

aa abcd - returns true
aaa dcd - returns false
aaaaaaaaaaa - returns false

Please post me if you know any functions for this one.

Posted: Wed May 26, 2010 1:11 pm
by anbu
If want to match 2 alphabets followed by a space and 3 alphabets
If Fld Matches '2A 3A0X' Then 'Yes' Else 'No'
If want to match any 2 characters followed by a space and 3 chars
If Fld Matches '2X 3X0X' Then 'Yes' Else 'No'

Posted: Wed May 26, 2010 2:02 pm
by Murali4u
Thank you very much. but one more question can we check a mixed format like aphabets and numerals:

eg:
[A-Z][0-9]
A9B
4BU
4B5

We can write the matches in a static way but the question is can we achieve it through dynamically.

Thanks in advance

Posted: Wed May 26, 2010 2:14 pm
by anbu
Use N to match a number

You can keep the format string as a job parameter.

Posted: Wed May 26, 2010 6:27 pm
by ray.wurlod
All possible match patterns are documented in the DataStage BASIC manual (and in UniVerse manuals).

They may even be documented somewhere on DSXchange.