If you want to share SYSPRINT with a C program, you must compile your PL/I code with the STDSYS option.
By default, DISPLAY statements use WTO’s to display their output. If you specify the DISPLAY(STD) compiler option, DISPLAY statements will use the C puts function to display their output. This can be particularly useful under z/OS UNIX.
Behavior of the standard C stream for sharing output under MVS batch, TSO batch, IMS batch, and IMS interactive is as follows:
stdout goes first to DD:SYSPRINT. If DD:SYSPRINT does not exist, stdout looks for DD:SYSTERM and then DD:SYSERR. If neither of these files exist, the library opens a sysout=* data set using DD SYSPRINT and sends the stdout stream to it.