The syntax for AND and OR operators in the Strcutured Programming Macros is 
differs slightly between the UNTIL= and WHILE= options of the DO macro and 
every other SPM macro that supports conditions. This is not only very confusing 
but I was just bitten by the fact that the DO macro may silently accept an 
incorrect UNTIL= or WHILE= parameter and generate the wrong code.

For example:
DO     UNTIL=(CR,R1,LT,R2),AND,(CR,R3,LT,R4)
  DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8)
ENDDO
contains an incorrect DO macro but generates the following code without any 
warnings or errors:
         DO     UNTIL=(CR,R1,LT,R2),AND,(CR,R3,LT,R4)
+...@lb2<mailto:+...@lb2>                  DC  0H
           DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8)
+                CR              R5,R6
+                BRC             11,#...@lb6
+                CR              R7,R8
+           BRC             4,#...@lb1
+...@lb6<mailto:+...@lb6>                  DC  0H
         ENDDO
+...@lb3<mailto:+...@lb3>           DC              0H
+                CR              R1,R2
+                BRC             11,#...@lb2
+...@lb1<mailto:+...@lb1>                 DC                    0H
The DO macro seems to simply ignore the ",AND,(CR,R3,LT,R4)" and generates 
incomplete code (as far as the programmer's intentions are concerned). The 
correct syntax is:
DO     UNTIL=(CR,R1,LT,R2,AND,CR,R3,LT,R4)
  DOEXIT (CR,R5,LT,R6),AND,(CR,R7,LT,R8)
ENDDO
But why is this error not properly signalled? Is it possible to change the 
macros to use one, consistent syntax (while maintaining backward compatability?

Fred!

-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------

Reply via email to