SAS_ODF should be set to point to the directory containing the ODF.
A science product (image or spectrum) should first be created using evselect with the required source selection expression.
Then the QPB product can be created by:
qpbselect table=3222_0804720405_EPN_S003_ImagingEvts.ds productname=pnspec_src.ds outevfile=QPBevfile.fits outprod=QPBspectrum.fits attfile=P0804720405OBX000ATTTSR0000.FIT
where pnspec_src.ds is the name of the source spectrum and QPBspectrum.fits is the name of the QPB spectrum that will be produced.
The same expression would be used to produce a QPB image:
qpbselect table=3222_0804720405_EPN_S003_ImagingEvts.ds productname=pnimage.ds outevfile=QPBevfile.fits outprod=QPBimage.fits attfile=P0804720405OBX000ATTTSR0000.FIT