Progress 4GL: How to generate different log file name when multiple processes using the same...

Discussão em 'StackOverflow' iniciado por fdantas, Setembro 2, 2020.

  1. fdantas

    fdantas Administrator Moderador

    I am using this code for generating log files with timestamp so that each time when the procedure called by one process it will generate unique log filename. But the concern is that when two processes calling the same procedure at a time then the log files got over written. I don't want this. I want to find when procedures called by multiple processes and need to generate different log file name.

    DEFINE VARIABLE TimeStamp AS CHARACTER NO-UNDO.
    DEFINE VARIABLE cPath AS CHARACTER NO-UNDO.

    ASSIGN

    TimeStamp = string(month(today),"99") + string(day(today),"99") +~
    string(year(today),"9999") + substring(string(time,"hh:mm:ss"),1,2) +~
    substring(string(time,"hh:mm:ss"),4,2) +~
    substring(string(time,"hh:mm:ss"),7,2)

    cPath = "cim_" + STRING(TimeStamp) + ".log".



    PROCEDURE generatecimlogfile:
    OUTPUT TO VALUE(cPath).
    MESSAGE "Inside a file".
    END PROCEDURE.

    RUN generatecimlogfile. /*(This procedure called by multiple processes at a time).*/

    Continue reading...

Compartilhe esta Página