Focal Point
[SOLVED] Amper variable value for 0000000 and '' are same

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

May 20, 2010, 08:12 AM
DeepakD
[SOLVED] Amper variable value for 0000000 and '' are same
Hi,

I am facing a strange issue here. I am using a filter with amper variable
like
 WHERE XYZ EQ '&xyz'; 


Here XYZ is a A45 datatype and if I am passing 0000000 as value it is not taking that.

Before this filter I create one more variable with
 -SET &A = IF &xyz EQ '' THEN '' ELSE 'A';

&A get value as '' and after that &xyz behaves as ''.

Please help.

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


Regards,

Deepak
WebFOCUS 7.6.11
Redhat Linux 5.5
Excel, pdf, HTML
May 20, 2010, 09:44 AM
GinnyJakes
-SET &xyz='000000';
-SET &A = IF ASIS(&xyz) EQ '' THEN '' ELSE 'A';
-TYPE &xyz &A

Try this, Deepak. Dialogue Manager can't tell the difference between a zero and a space.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
May 20, 2010, 12:57 PM
jimster06
Deepak-
You may also want to consider the function ASIS.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
May 20, 2010, 02:07 PM
GinnyJakes
That's what I told him, Jim. Smiler


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
May 21, 2010, 11:32 AM
Chirag
Ginny,

Isn't it strange, dialog manager can't tell the difference between a zero and a space. Why webfocus kept this behaviour?


7.6.11
Linux
Excel, HTML, PDF

May 21, 2010, 11:50 AM
njsden
I think that if DM has been working like that since its initial conception, changing it now would potentially break thousands of Production code that may have relying on that particular functionality. It's probably a similiar situation as that of the annoying automatic blank line that just appears after a report HEADING when BORDERs are used; it should be an "easy" fix but I'm guessing they'd rather keep it that way to avoid undesirable side effects in existing code.



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.
May 21, 2010, 02:22 PM
webFocus_reporter
Chirag , I believe they might have updated this in 7.7.

Let me check..


WebFOCUS 7.6.X/7.7.X
Windows
all output
May 22, 2010, 04:45 AM
Ram Prasad E
Deepak, the way you check for missing or null values in amper variable is not correct.
Either use ASIS function, as mentioned by Ginny or you can try this too
-SET &xyz='0000000';
-SET &A=IF &xyz || 'A' EQ 'A' THEN 'Missing' ELSE &xyz;
-SET &check_1=&xyz.EXIST;
-SET &B=IF &check_1 EQ 0 THEN 'Missing' ELSE &xyz;

-TYPE &xyz &A  &B


The below one works fine. The problem will be only when used with dialogue Manager commands.
-SET &xyz='0000000';
TABLE FILE CAR
PRINT
CAR
COUNTRY
DEALER_COST
COMPUTE CC_1/A45=IF COUNTRY EQ 'ENGLAND' THEN '0000000' ELSE '1111111'; NOPRINT
WHERE TOTAL CC_1 EQ '&xyz';
END



WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
May 26, 2010, 03:27 AM
DeepakD
Thanks Everybody for this useful discussion. My problem is resolved.

Regards,
DeepakD