Focal Point
[SOLVED] check format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4577032116

October 17, 2011, 01:55 PM
pvparuc
[SOLVED] check format
Hi all,

I have a field with format A2 that can have values '00' to '99' and 'AA' to 'ZZ'. I am trying to define a new field which will be 0 if the value is numeric i.e. '00' to '99' and 1 if the value is alpha i.e. 'AA' to 'ZZ'.
Now I'm using the following in define,

FLAG/I1 = IF SECTION IN ('00','01','02','03','04','05','06','07','08','09',
'10','11','12','13','14','15','16','17','18','19',
'20','21','22','23','24','25','26','27','28','29',
'30','31','32','33','34','35','36','37','38','39',
'40','41','42','43','44','45','46','47','48','49',
'50','51','52','53','54','55','56','57','58','59',
'60','61','62','63','64','65','66','67','68','69',
'70','71','72','73','74','75','76','77','78','79',
'80','81','82','83','84','85','86','87','88','89',
'90','91','92','93','94','95','96','97','98','99')
THEN 0 ELSE 1;

is there anyother way of achieving this.

Thanks in advance,
pvparuc

This message has been edited. Last edited by: pvparuc,


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
October 17, 2011, 02:08 PM
njsden
FLAG/I1 = CHKFMT(2, SECTION, '99', FLAG);


FLAG will contain 0 if both digits are numeric or a number with the position of the first non-numeric one found.

'00' .. '99' -> 0
'AA' .. 'ZZ' -> 1
'A1' -> 1
'7B' -> 2



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
October 17, 2011, 02:11 PM
njsden
If you need FLAG to be only 0 or 1, then you can tweak the expression a bit:

FLAG/I1 = IF CHKFMT(2, SECTION, '99', FLAG) EQ 0 THEN 0 ELSE 1;




Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
October 17, 2011, 03:04 PM
pvparuc
This is exactly what I was looking for

Thanks njsden


Release: Webfocus 7.6.11
OS/Platform: Windows
Output: HTML, EXL2K
October 17, 2011, 03:14 PM
njsden
You're welcome!

Could you please edit the title of your original post and prefix it with [SOLVED]?

Thanks Wink



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.