you can just use an external ds (from the file) and export it in the *SRVPGM and import it in the calling PGM.
here is a little piece of code i use to do tha same :
Global parm :
FBRO010P1 uf a e k disk
d Io_BRO010P1 e ds extname(BRO010P1 )
i have a few procedure (get_BRO010P1 <=> chain, .. and so on)
in the calling pgm :
d Io_Bro010p1 e ds extname(Bro010p1) import
My procedures get keys and some keywords like ‘*NEXT’, ‘*LOCK’ ….
and return always an indicator *off if operation fail, *on in other case.
hope this help