I’ve used Tom’s approach and it works well. The following method also works for checking that a record exists without performing the “count”.
]D RecFound s 1a inz(‘N’)
Exec SQL set :RecFound = (select ‘Y’ from sysibm/sysdummy1
where exists (select zip1 from MyZips where zip1 = 15205));</pre>