The DSPOBJD command allows you do do that. Just put an * as the last character.You can either just display the results or you can go to an OUTFILE, and then continue with any process you want with that data.
Register Hereor login if you are already a member
In your CLP program you dump your data to a file in say QTEMP like this
DSPOBJD OBJ(TRNLIB/*ALL) OBJTYPE(*PGM) OUTPUT(*OUTFILE) OUTFILE(QTEMP/MYPGMS)
Then read the records in this file and substring the object name field ODOBNM for the desired letter(s).
You can take this further by having a prompt screen for the LIBRARY name and the LETTER TO SEARCH. That way you code once and it works for all scenarios.