This example allocates SYS1.MACLIB to SYSLIB and directs messages to z/OS UNIX standard error (sdterr):
call bpxwdyn "alloc fi(syslib) da(sys1.maclib) shr msg(2)"
This example requests that the name of the data set allocated to ddname SYSLIB be returned in the REXX variable dsnvar.
call bpxwdyn "info fi(syslib) inrtdsn(dsnvar)"
This example frees SYSLIB and traps messages in stem S99MSG.:
call bpxwdyn "free fi(syslib)"
if bpxwdyn("alloc fi(tmp) da(sys1.sbpxexec) shr msg(2)")=0 then call bpxwdyn "concat ddlist(sysproc,tmp) msg(2)"
call bpxwdyn "outdes(p20) dest(kgn.p20n10)", "address('WJ Schoen','M/S 619')", "name(wschoen) bin(0004) dept(64ba)"
call bpxwdyn "free outdes(p20)"