You’ll need to build your query select statement based on the parameters given in :-
First fill your QRYSLT variable with the basic selection criteria (not dependent on your parameters):-
CHGVAR &QRYSLT ‘Basic slection criteria’
Then build the rest of your query select statement, based on which parameters are filled in :-
IF &A <> ” THEN CHGVAR &QRYSLT (&QRYSLT *CAT ‘*AND A =’ &A)
IF &B <> ” THEN CHGVAR &QRYSLT (&QRYSLT *CAT ‘*AND B =’ &B)
This is only to give you the basic idea, you’ll have to get the syntax right depending on whether you have numeric or character parameters.