Ok your statement might look like this:
Stmt = ‘Select x,y,z from myfile where batch# = ‘ + %editc(reqBatch# : ‘Z’)
where batch# is a numeric field in myfile reqBatch# has the reqired numeric value by the time that this string is built.
REGISTER or login:
Stmt = 'Select x,y,z from myfile where "BATCH#" = ' + %editc(reqBatch# : 'Z')