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
where pnspec_src.ds is the name of an input source spectrum and QPBspectrum.fits is the name of the QPB spectrum that will be produced.
Alternatively an attitude file can be supplied, in which case SAS_ODF should be set to point to the directory containing the ODF.
qpbselect table=3222_0804720405_EPN_S003_ImagingEvts.ds productname=pnspec_src.ds outevfile=QPBevfile.fits outprod=QPBspectrum.fits useodfatt=yes attfile=P0804720405OBX000ATTTSR0000.FIT
A similar command 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