sample: package;
sample: proc options( main );
dcl sum fixed bin(31);
sum = addtwo( 3 );
put skip list ( 'sum = ‘ || sum );
end;
addtwo: proc( limit )
returns( byvalue fixed bin(31) );
dcl limit fixed bin(31) byvalue;
dcl sum fixed bin(31);
sum = 0;
return( sum );
end;
end;
CgpzYW1wbGU6IHBhY2thZ2U7CnNhbXBsZTogcHJvYyBvcHRpb25zKCBtYWluICk7CglkY2wgc3VtIGZpeGVkIGJpbigzMSk7CglzdW0gPSBhZGR0d28oIDMgKTsKCXB1dCBza2lwIGxpc3QgKCAnc3VtID0g4oCYIHx8IHN1bSApOwplbmQ7CgphZGR0d286IHByb2MoIGxpbWl0ICkKICByZXR1cm5zKCBieXZhbHVlIGZpeGVkIGJpbigzMSkgKTsKCQkKCWRjbCBsaW1pdCBmaXhlZCBiaW4oMzEpIGJ5dmFsdWU7CglkY2wgc3VtIGZpeGVkIGJpbigzMSk7CglzdW0gPSAwOwoJCglyZXR1cm4oIHN1bSApOwplbmQ7CgplbmQ7