To direct MSGFILE output to a z/OS UNIX file, use the PATH= keyword in the ddname parameter of MSGFILE to specify a ddname that nominates a z/OS UNIX file.
If your application is running in an address space created by using the fork() or spawn() functions or if it is invoked by one of the exec family of functions, the application has access to a DD card only if you dynamically allocate one. If the application can access a DD card, MSGFILE output is directed to that file. If the allocated DD card contains the PATH= keyword, Language Environment directs the MSGFILE output to the specified file in the z/OS UNIX file system.
If your application is running under z/OS UNIX, or under any environment that has file descriptor 2 (FD2) open, MSGFILE output is directed to whatever FD2 points to. Under the shell this is typically your terminal.
If FD2 does not exist but your application is either running in an address space created by the fork() or spawn() functions or invoked by one of the exec family of functions, MSGFILE output is directed to the current working directory; if that directory is the root directory, the output is written to a file in the directory /tmp. The name of the file is the name you specify with the MSGFILE runtime option, with the default of SYSOUT.
/path/Fname.Date.Time.Pid