BPX2ITY (isatty) example

The following code determines if the standard output device is a terminal. For the callable service, see isatty (BPX2ITY, BPX4ITY) (X/Open Version) — Determine whether a file descriptor represents a terminal. AMODE 64 callers use BPX4ITY (isatty) example.
                                              
         CALL  BPX2ITY,              Determine if device is a TTY      +
               (=A(STDOUT_FILENO),   Input: File descriptor            +
               RETVAL,               Return value: 0 isn't, 1 is, -1   +
               RETCODE,              Return code: describes why VAL=-1 +
               RSNCODE),             Reason code: qualifier on RETCODE +
               VL,MF=(E,PLIST)       ---------------------------------- 
         ICM   R15,B'1111',RETVAL    Test RETVAL                        
         BZ    PSEUDO                RETVAL=0 means device not terminal