Hi,
I want to give two If conditions in a cl program to make sure the value of field is between the Range.
I am trying to write following line of code but syntax error is coming,any idea/suggestions How can I do comparison at a same time:
IF COND(%SST(&ODOBNM 7 4) *LE %SST(&VAR1 7 4)) and IF COND(%SST(&ODOBNM 7 4) *GE %SST(&VAR2 7 4))
Thanks
even if I want to use corrected condition like:-
IF COND(%SST(&ODOBNM 7 4) *LE %SST(&VAR1 7 4)) *AND IF COND(%SST(&ODOBNM 7 4) *GE %SST(&VAR2 7 4))
Then condition prompt is not enoough longer to give this command,I mean full condition can't be typed because of lessser space in If condition prompt,any idea/suggestions,How o type this long condition in IF command in CL/400 PROGRAM.
Thanks
Using your style, it would look something like this:
IF COND(%SST(&ODOBNM 7 4) *LE %SST(&VAR1 7 4) *AND +
%SST(&ODOBNM 7 4) *GE %SST(&VAR2 7 4)) THEN( DO )
...code goes here
ENDDO
I might use a style that looks something like this:
if ( %sst( &ODOBNM 7 4 ) *le %sst( &VAR1 7 4 ) *and +
%sst( &ODOBNM 7 4 ) *ge %sst( &VAR2 7 4 )) do
...code goes here
enddo
The compound COND() doesn't have another "IF" statement in the middle of it. Also, the "AND" connective is written "*AND". When the two conditions are combined, you also must be careful about balancing the parentheses. Finally, notice the "+" after the "*AND" to indicate the continuation onto a new source line.
It's hard to predict how the code is going to look after I post this comment. We can work out details if necessary.
Tom
Discuss This Question: 2  Replies