10 Single SQL command static with AVG, MAX

**FREE

dcl-s MaxSize zoned(15:0);
dcl-s AvgSize zoned(15:0);

exec sql
select avg(odobsz), max(odobsz) into :avgsize, :maxsize
from pfdata;

if sqlstt <> '00000'; // Error
    // handle the error
endif;

*inlr=*on;

Comments

Popular posts from this blog

07 Using CURSOR and FETCH into host DS

12 FETCH and sub-procedures