View previous topic :: View next topic |
Author |
Message |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Tue May 02, 2006 3:39 pm Post subject: pli bit operator |
|
|
Hai All,
I have a declaration in a PLI program like
Code: |
DCL A_EOFSW BIT (1);
ON ENDFILE (A)
A_EOFSW = ON;
|
Is it necessary to declare
Code: |
DCL ON BIT(1) INIT('0'B);
DCL OFF BIT(1) INIT('1'B);
|
My intention is to have on end file ,no records switch to on ? _________________ Shekar
Grow Technically |
|
Back to top |
|
|
Grant Beginner
Joined: 02 Dec 2002 Posts: 45 Topics: 1 Location: Sydney, NSW, Australia
|
Posted: Tue May 02, 2006 6:22 pm Post subject: |
|
|
Yes it is necessary to declare ON, but you do not need to declare OFF unless you are going to use it.
Also, you should be initialising "ON" to '1'B and OFF to '0'B.
This will allow the following expressions to return a true result if any of the bits in A_EOFSW are set on (i.e. '1'B):
If A_EOFSW
then ....
or
Do While ( |
|
Back to top |
|
|
bauer Intermediate
Joined: 10 Oct 2003 Posts: 315 Topics: 49 Location: Germany
|
Posted: Mon May 08, 2006 3:10 am Post subject: |
|
|
Hi,
if you declare ON as preporcessor variable
Code: |
%DCL ON CHAR ;
%ON = '''1'B'' ;
|
it may be better regarding performance considerations.
bauer |
|
Back to top |
|
|
|
|