BPX1TYN (ttyname) example

The following code retrieves the pathname for the standard error output file. For the callable service, see ttyname (BPX1TYN, BPX4TYN) (POSIX version) — Get the name of a terminal.
                                              
         MVC   BUFLENA,=A(1023)      Maximum pathname                   
         CALL  BPX1TYN,              Determine terminal name           +
               (=A(STDERR_FILENO),   Input: File descriptor            +
               BUFLENA,              Length of buffer for pathname     +
               BUFFERA),             Buffer for pathname of terminal   +
               VL,MF=(E,PLIST)       ----------------------------------