How to give If condition in CL/400 program

1590 pts.
Tags:
AS/400
CL Program
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

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • 6r
    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
    1,590 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following