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 Hereor login if you are already a member
Stmt = 'Select x,y,z from myfile where "BATCH#" = ' + %editc(reqBatch# : 'Z')