NEED HELP on If ....GOTO.
i have two if statements as:
-IF &XYZ EQ 0 THEN GOTO NOdata ELSE GOTO Data ;
and another similar If stmt is
-IF &ABC EQ 0 THEN GOTO NOdata ELSE GOTO Data ;
i need help on how to tie these above two statements.i mean how to use both &ABC and &XYZ in a single if stmt.This message has been edited. Last edited by: Kerry,
can i use 'or' like this in IF stmt.
-IF (&ABC or &XYZ) EQ 0 THEN GOTO NOdata ELSE GOTO Data ;
please let me know.
OR is capital O and R.
Why are you not trying
This is an OR statement that works similarly for any programming language:
-IF &XYZ EQ 0 OR &ABC EQ 0 GOTO NOdata ELSE GOTO Data;
-IF &XYZ EQ 0 GOTO NOdata ELSE - IF &ABC EQ 0 GOTO NOdata ELSE GOTO Data;
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
I would always suggest using parentheses, as this forces the order of evaluation.
-IF (&XYZ EQ 0) OR (&ABC EQ 0) GOTO NOdata ELSE GOTO Data;
swati, the IF structure seemed simple enough. If you still have trouble going where you want to go, try -SET &ECHO = ALL to see how DM interpret you IF statement. You will be suprised that...
FOC_NONE <> 'FOC_NONE'
'ABC' <> 'ABC ' or ABC <> 'ABC'
null string <> blanks
Developer Studio 7.6.11
AS400 - V5R4
IF and ELSE IF is safe than OR in some cases
HTML,PDF,EXL2K, Active, All
|Powered by Social Strata|