[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnubol: Search and Evaluate tests



I have created (and tested) the "attached" program that can be used to test
the THEORETICALLY still unresolved question about SEARCH and EVALUATE.  As I
expected/predicted, the first two test paragraphs compile successfully and
the last two get severe compiler errors - with Fujtisu.  Anyone want to try
it with IBM to confirm that it gets E-level messages?
  ***

000010 Identification Division.
000020  Program-Id. SandE.
000030* Test of unterminated Search and Evaluate
000040 Data Division.
000050  Working-Storage Section.
000060 01 aTabl.
000070	05	Tst		Pic X.
000071	05 	Tabl 	Occurs 10 times
000080				Indexed by Ind
000090				Ascending Key Elem1.
000100		10	Elem1	Pic X.
000110		10	Elem2	Pic X.
000111 Procedure Division.
000112  001-Mainline.
000113 		Perform 100-Test1
000114 		Perform 200-Test2
000115 		Perform 300-Test3
000116 		Perform 400-Test4
000117 		Stop Run
000118 		.
000120  100-Test1.
000130 		Evaluate Tst
000140 		  When "1"
000150 		  	Search All Tabl
000151 		  		At End
000152 		  			Display "At End  1"
000153 		  		When Elem1 (Ind) = "X"
000154 		  			Display "When 1"
000155 		  		End-Search
000156 		  When "2"
000157 		  	Search Tabl
000158 		  	  Varying Ind
000159 		  	  	At End
000160 		  			Display "At End 2"
000170 		  		When Elem2 (ind) = "X"
000180 		  			Display "When 2"
000190 		  	End-Search
000200 		  When Other
000210 		  	Display "Other 1"
000220 		 End-Evaluate
000230 		  .
000240  200-Test2.
000270     	Search All Tabl
000280 	  		At End
000281 	  			Evaluate Tst
000282 	  			  When "X"
000283 	  			  When "Y"
000290 		  			Display "When 3"
000291 		  		  When Other
000292 		  		  	Display "Other 2"
000293		  		End-Evaluate
000294 		  	When Elem1 (ind) = "Z"
000295 		  		Evaluate True
000296 		  		  When Elem1 (ind) = Elem2 (ind + 1)
000297 		  		  	Display "When 4"
000298 		  		End-Evaluate
000299 		  .
000309  300-Test3.
000319 		Evaluate Tst
000329 		  When "1"
000339 		  	Search All Tabl
000349 		  		At End
000359 		  			Display "At End  1"
000369 		  		When Elem1 (Ind) = "X"
000379 		  			Display "When 1"
000389* 	  		End-Search
000399 		  When "2"
000409 		  	Search Tabl
000419 		  	  Varying Ind
000429 		  	  	At End
000439 		  			Display "At End 2"
000449 		  		When Elem2 (ind) = "X"
000459 		  			Display "When 2"
000469* 		  	End-Search
000479 		  When Other
000489 		  	Display "Other 1"
000499 		 End-Evaluate
000509 		  .
000519  400-Test4.
000529     	Search All Tabl
000539 	  		At End
000549 	  			Evaluate Tst
000559 	  			  When "X"
000569 	  			  When "Y"
000579 		  			Display "When 3"
000589 		  		  When Other
000599 		  		  	Display "Other 2"
000609*		  		End-Evaluate
000619 		  	When Elem1 (ind) = "Z"
000629 		  		Evaluate True
000639 		  		  When Elem1 (ind) = Elem2 (ind + 1)
000649 		  		  	Display "When 4"
000659*		  		End-Evaluate
000669 		  .


  ***
Bill Klein
  wmklein <at> ix.netcom.com


--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.