Focal Point
[CLOSED] SET Command # Weird Behaviour

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

February 09, 2012, 09:35 AM
Ramkumar - Webfous
[CLOSED] SET Command # Weird Behaviour
-SET &ECHO = 'ALL';
-SET &HI=IF 212 EQ 'ALL' THEN 'ALL' ELSE IF 05 LT 06 THEN 'N/A' ELSE STRREP (05, '212', 4, ' OR ', 2, ', ', 05, 'A05');
-TYPE &HI
-EXIT

I am just having this in code. In this ELSE IF 05 LT 06 is not getting executed at all on any cause. It is going to the ELSE part everytime and causing an error.

Anyone could crack why is is that ? It shud stop at the ELSE IF itself. Something is going crazy. Roll Eyes

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


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
February 09, 2012, 09:43 AM
njsden
Works okay in 7.7.03. I get "N/A" as expected.

Here's the output:

Your request did not return any output to display.
... some output lines removed ...

 -SET &HI=IF 212 EQ 'ALL' THEN 'ALL' ELSE IF 05 LT 06 THEN 'N/A' ELSE STRREP (05, '212', 4, ' OR ', 2, ', ', 05, 'A05');
 -TYPE N/A
 N/A
 -EXIT



I assume 212, 05 and 06 are just "resolved" values for some &variables you have in your code, are they not?



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.
February 09, 2012, 02:41 PM
Waz
I assume that the values in this code are in fact variables, and this is a cut and paste of program output.

If so, then it would be better to see the code that generated it, and there the varables were coming from.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 10, 2012, 04:25 AM
Ramkumar - Webfous
Here it is Waz...
 -SET &HEAD_FLD4= &v_zip_code;
-SET &HEAD_FLD_D4=STRREP (&v_zip_code.LENGTH, &v_zip_code, 4, ' OR ', 2, ', ', &v_zip_code.LENGTH, 'A&v_zip_code.LENGTH');
-SET &HEAD_FLD4=IF &HEAD_FLD4 EQ '_FOC_NULL' THEN 'ALL' ELSE STRIP(&HEAD_FLD4.LENGTH, &HEAD_FLD4, '''', 'A&HEAD_FLD4.LENGTH');
-SET &HEAD_FLD4=IF &HEAD_FLD4 EQ 'ALL' THEN 'ALL' ELSE IF &HEAD_FLD4.LENGTH LE 06 THEN &HEAD_FLD4.EVAL ELSE STRREP (&HEAD_FLD4.LENGTH, '&HEAD_FLD4.EVAL', 4, ' OR ', 2, ', ', &HEAD_FLD4.LENGTH, 'A&HEAD_FLD4.LENGTH');
-TYPE &HEAD_FLD4
-EXIT 



Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
February 10, 2012, 09:44 AM
njsden
Ramkumar,

What is your expected output given '212' as the value for &v_zip_code.

I tested your code with that and I get the same value as an answer -> 212.

That seems consistent with
... IF &HEAD_FLD4.LENGTH LE 06 THEN &HEAD_FLD4.EVAL ...


212's length is 3 with is < 6 and therefore the answer is the parameter itself.

Which particular value of &v_zip_code is causing you trouble?

By the way, in the expression above, you can remove the .EVAL from there.



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.