I used the %found() ( the BIF: %found with open and close parenthesis with no argument) along with a %found (no parenthesis) in the same program and got an unexpected error. Fact 1: The chain directly preceded the %found and the %found evaluated to '0' when it should have evaluated to '1'. Fact 2: When I removed the parenthesis from the other statement containing the %found(), the %found worked correctly. Fact 3: The %found() was in a subroutine and hadn’t been executed yet. Fact 4: I also included an indicator on the Chain so I could check it and it was *off after the chain- chain ok. I pulled out the code and tested it using the exact same argument and file shown below: /FREE CHAIN ‘xxx’ myfile If %found Foundit = ‘yes’ Else Foundit = ‘no’ Endif CHAIN ‘xxx’ myfile If %found() Foundit = ‘yes’ Else Foundit = ‘no’ Endif /END-FREE If you try it, the first %found will fail and Foundit will equal ‘no’. If you remove the parenthesis from the %found() statement on the second chain, the first %found will work correctly. Why is this?

Reply With Quote