Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How 'NOT' operator will function in this statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Tue Sep 11, 2007 12:57 pm    Post subject: How 'NOT' operator will function in this statement
Reply with quote

Hi i want to know how the NOT will funtion in the below cobol statement.

IF CODE NOT = 'GMT' AND 'CST'

Compiler will treat as NOT = 'GMT' AND NOT = 'CST'

or else

NOT = 'GMT' AND TPO-POLSYM = 'CST'.

Please explain the NOT functionality clearly.
Back to top
View user's profile Send private message

Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Tue Sep 11, 2007 1:11 pm    Post subject: Reply to: How NOT will function
Reply with quote

pons,

when you use not equal then it applies to all the stmts to right side untill u dont code another qualifier.

in ur case to both the string

NOT = 'str1' and 'str2' implies

NOT = 'str1' and NOT = 'str2'
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Sep 11, 2007 8:49 pm    Post subject:
Reply with quote

Hello,


Quote:
IF CODE NOT = 'GMT' AND 'CST'
will work as described by Sandy.

Something you must be careful of is
Code:
IF CODE NOT = 'GMT' OR 'CST'
This code will always "fail". The NOT= condition will always be raised.
Back to top
View user's profile Send private message
noorkh

New User


Joined: 06 Mar 2006
Posts: 76
Location: Chennai

PostPosted: Wed Sep 12, 2007 10:37 am    Post subject:
Reply with quote

Dick,

I am not satisified that we can code single NOT value for both values as mentioned by Pons. I have tried it once it didn't work so i always used to put IF A NOT = 'I' AND A NOT = 'V'.

I may be wrong. Please clarify me.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Sep 12, 2007 11:01 am    Post subject:
Reply with quote

Quote:
I have tried it once it didn't work so i always used to put IF A NOT = 'I' AND A NOT = 'V'.


How about trying it one more time? It will clear your doubt..
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Sep 12, 2007 6:30 pm    Post subject:
Reply with quote

Hello,

You might want to check if the one that did not work used OR rather than AND. . .

If you have one that will not work as you expect, please post it here.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us