Q:

What is the best way to have a unique file name for each files?

I have written a program for export some text files to a specific directory. So i preferred using MTIME is the best way to have a unique name but this will be a problem when multiple process exporting same file name using MTIME. 
Could you please tell me the best way to have a unique file name? Let me share some sample.
DEFINE INPUT PARAMETER ipData1 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipData2 AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER ipData3 AS CHARACTER NO-UNDO.

DEFINE VARIABLE cExportData AS CHARACTER NO-UNDO FORMAT 'X(250)'.
DEFINE VARIABLE cPath AS CHARACTER NO-UNDO.
DEFINE VARIABLE cExt  AS CHARACTER NO-UNDO.
DEFINE VARIABLE cSFTL AS CHARACTER NO-UNDO FORMAT 'X(150)'.
DEFINE VARIABLE cMessageDateTime AS CHARACTER NO-UNDO.

ASSIGN
  cPath  = "R:\Downloads\progress\" 
  cExt   = ".Txt"
  cMessageDateTime = "123456789".

OUTPUT TO VALUE (cPath + cMessageDateTime + STRING(MTIME) + cExt ).   

put unformatted ipData1 skip ipData2 skip ipData3 skip "End."

OUTPUT CLOSE.

A:

You have several options:

Use the program that Progress has supplied:  adecomm/_tmpfile.p
define variable fname as character no-undo format "x(30)".
run adecomm/_tmpfile.p ( "xxx", ".tmp", output fname ).
display fname.

Use a GUID:
define variable fname as character no-undo format "x(30)".
fname = substitute( "&1&3&2", "xxx", ".tmp", GUID( GENERATE-UUID )).
display fname.

Ask Windows to do it (if you are always running on Windows):
define variable fname as character no-undo format "x(30)".
fname = System.IO.Path:GetTempFileName().
display fname.

Trial and error:
define variable fname as character no-undo.
do while true:
fname = substitute( "&1&3&2", "xxx", ".tmp", string( random( 1, 1000 ), "9999" )).
file-info:filename = fname.
if file-info:full-pathname = ? then leave.  /* if the file does NOT exist it is ok to use this name */
end.
display fname.

