View previous topic :: View next topic
|
Author |
Message |
Swetha Rao
New User
Joined: 04 Apr 2012 Posts: 3 Location: India
|
|
|
|
Hi,
Wanted to know the meaning of this operation in Pl1 programming on mainframe
C = A !< B
where the value of A is 100
B is 50
C is '100100' B
What does !< operation do ? and what is the value assigned to C ? |
|
Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
What are the data types of A, B, and C? |
|
Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Well, I just searched the manual (version 3.5) for ! and it was not found except in its normal usage as an exclamation mark e.g. Note!. So, what version of PL/1 are you using? |
|
Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Nic Clouston wrote: |
Well, I just searched the manual (version 3.5) for ! and it was not found except in its normal usage as an exclamation mark e.g. Note!. So, what version of PL/1 are you using? |
I suspect that her emulator does not have the logical-OR and logical-NOT symbols defined, and that she is winging it. |
|
Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
I found a reference to ! in a 1983 Digital Research manual for PL/1 on DOS. Somehow I do not think that that is the version in question here. But it may not be (probably is not) a mainframe version and so the topic is in the wrong forum. (But I do not know of a PC PL/1 forum) |
|
Back to top |
|
 |
Swetha Rao
New User
Joined: 04 Apr 2012 Posts: 3 Location: India
|
|
|
|
Thank you to all for your replies.
I just found the answer.
In case of decmials, !< would just mean ( NOT LESS THAN).
in this example, C = A ! < B
Since 100 < 50 (condition is TRUE) and C is a BIT string, '1'B (for TRUE) is assigned to C.
In case of Bit strings, ! would mean (the operator NOT)
If C has the value '1'B then !C will have the value '0'B. |
|
Back to top |
|
 |
Akatsukami
Global Moderator

Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Swetha Rao wrote: |
In case of decmials, !< would just mean ( NOT LESS THAN).
in this example, C = A ! < B
Since 100 < 50 (condition is TRUE) and C is a BIT string, '1'B (for TRUE) is assigned to C. |
And yet, according to you, the value of C is not '1'B, but '100100'B. How do you explain this discrepancy? |
|
Back to top |
|
 |
Swetha Rao
New User
Joined: 04 Apr 2012 Posts: 3 Location: India
|
|
|
|
The initial value of C is '100100'B and the length is 6 (the declaration being DCL C_1 BIT(6) INIT('100100'B); )
After the operation the value of C is '100000' B.
Hope this clarifies the doubt . |
|
Back to top |
|
 |
|