Back to SPR List Previous Next
LOOKUP affects apparently unrelated local variables
Moderate Closed - Fixed Found:XS.01.07 02 OCT 2007 Fixed:XS.01.08 05 OCT 2007

DETAILS
 Try this program on COMPANY. The local variable changes value after the lookup.

 The second program is a slight variation with a lookup using string '1' instead of
 using number 1 and that effects the local variable somewhat.

 Start program translation
 Start program execution
 test before lookup = 1
 test after lookup  = 0
 End program execution
 Start program translation
 Start program execution
 test before lookup = 1
 test after lookup  = 540082177
 End program execution
EXAMPLE PROGRAM
 program
 integer*4 test
 compute test=1
 write  'test before lookup = ' test
 .  lookup record COMPANY.EMPLOYEE
           get vars gender
           using 1
 write   'test after lookup  = ' test
 end program


 program
 integer*4 test
 compute test=1
 write  'test before lookup = ' test
 .  lookup record COMPANY.EMPLOYEE
           get vars gender
           using '1'
 write   'test after lookup  = ' test
 end program
WORKAROUND
Use a DATABASE IS / CASE IS / RECORD IS construct instead of the loopup
Back to SPR List Previous Next