Skip to main content
Aug 5, 2021 10:56 AM UTC

Last compile date, last edit date

We have a very old (clunky) program that displays the last edit date for source and the last compile date for object code. I'm wondering if any of you learned folks have a clean, effective way of doing this that might be helpful? TIA...

------------------------------
Jeff Teter
Woodforest National Bank
The Woodlands, TX
------------------------------

    4 replies

    Manu Fernandes
    Inspiring
    Aug 5, 2021 12:21 PM UTC
    We have a very old (clunky) program that displays the last edit date for source and the last compile date for object code. I'm wondering if any of you learned folks have a clean, effective way of doing this that might be helpful? TIA...

    ------------------------------
    Jeff Teter
    Woodforest National Bank
    The Woodlands, TX
    ------------------------------
    Hi,

    About the source file, it's only the OS timedate which can inform about it. 
    OPENSEQ profilename,sourcename TO F ELSE STOP 
    STATUS STS FROM F ELSE STS = ''
    STS<16> is the last modified date 
    STS<15> is the last modified time 
    Read doc about STATUS statement. 

    About object code, you can do the same from profilename.O or 
    use VLIS and read the Object Date Time information embedded into the Object, which is better than OS..

    Here is a complete code to do it , save it on 'thisfile', 'thisprog' and BASIC it. 
    Usage : RUN thisfile thisprog FILENAME PROGNAME
    
    STS = CONVERT(' ',@AM,TRIM(@SENTENCE))
    FILENAME = STS<DCOUNT(STS,@AM) -1>
    PROGRAM =  STS<DCOUNT(STS,@AM) >
    CRT TIMEDATE()
    CRT 'PROGRAM ':FILENAME:' ':PROGRAM
    OPENSEQ FILENAME,PROGRAM TO F ELSE CRT FILENAME,PROGRAM, 'OPEN ERROR ':STATUS() ; STOP 
    STATUS STS FROM F ELSE STS = ''
    EXECUTE 'VLIST ':FILENAME:' ':PROGRAM CAPTURING CAPT 
    CRT 'Source Date Time: ':FMT(STS<16>,'D'):' ':OCONV(STS<15>,'MTS')
    CRT CAPT<DCOUNT(CAPT[1,INDEX(CAPT,'Object Date Time:',1 )],@AM) >
    Results 
    18:17:23 05 AUG 2021                  
    PROGRAM EFVPROGS TEST                 
    /home/INFODATA/efv/progs/TEST         
    Source Date Time: 05 AUG 2021 18:12:38
    Object Date Time: 05 AUG 2021 18:11:52
    ​

    I hope this help



    ------------------------------
    Manu Fernandes
    ------------------------------
    Brian Paige
    Participating Frequently
    Aug 5, 2021 3:00 PM UTC
    We have a very old (clunky) program that displays the last edit date for source and the last compile date for object code. I'm wondering if any of you learned folks have a clean, effective way of doing this that might be helpful? TIA...

    ------------------------------
    Jeff Teter
    Woodforest National Bank
    The Woodlands, TX
    ------------------------------
    We're running UniVerse on AIX, and use IDEAL flavor accounts. When we compile programs, the object code is written to the respective .O file, but also into GLOBAL.CATDIR ($uvhome/catdir).

    Using the Unix ls command, the date/time stamp on each of the different Unix file entries will tell you the following:
    BP file - last time the file was saved (assumption is this is the last time it was changed)
    BP.O file - last time the object code was updated (last time it was compiled)
    Entry in $uvhome/catdir - last time the program was executed

    That's pretty specific to the environment, though, so some of the other U2-based solutions that have been offered up may be better options for you.

    Brian
    Rebecca Randolph
    New Participant
    Aug 9, 2021 5:37 PM UTC
    We have a very old (clunky) program that displays the last edit date for source and the last compile date for object code. I'm wondering if any of you learned folks have a clean, effective way of doing this that might be helpful? TIA...

    ------------------------------
    Jeff Teter
    Woodforest National Bank
    The Woodlands, TX
    ------------------------------
    I am also looking for an easy way to determine the date all programs were last cataloged locally in an account in Universe (piopen flavor rellevel 11.1.3). I see that the date in the &MAP& is the date last run not cataloged but I know the catalog date must be available.  I see a Unix date in $uvhome/catdir but you must search for the local account directories and go into each directory and programs with long names makes it a pain to locate as you must combine the names and fix the dot's when at the dividing point.  Has someone found an easier way to provide this information for change auditing?

    ------------------------------
    Rebecca Randolph
    Laboratory Solution Design
    Kaiser Foundation Health Plan of WA.
    Tukwila WA United States
    ------------------------------
    Manu Fernandes
    Inspiring
    Aug 9, 2021 5:57 PM UTC
    I am also looking for an easy way to determine the date all programs were last cataloged locally in an account in Universe (piopen flavor rellevel 11.1.3). I see that the date in the &MAP& is the date last run not cataloged but I know the catalog date must be available.  I see a Unix date in $uvhome/catdir but you must search for the local account directories and go into each directory and programs with long names makes it a pain to locate as you must combine the names and fix the dot's when at the dividing point.  Has someone found an easier way to provide this information for change auditing?

    ------------------------------
    Rebecca Randolph
    Laboratory Solution Design
    Kaiser Foundation Health Plan of WA.
    Tukwila WA United States
    ------------------------------
    Hi rebecca

    Local catalog create  VOC entry type V with full path to the objet code in the file.O, there is no info anywhere. 

    I suggest to overload CATALOG verb to maintain a logging of activity then chain native verb. 

    1/
    COPYI FROM VOC CATALOG,sysCATALOG

    2/
    ED BP MYCATALOG
    OPENSEQ 'LOGFILE', 'CATALOG' TO F ELSE... 
    WRITESEQ TIMEDATE() :C:@LOGNAME:C:@ACCOUNT:C:@SENTENCE ON F...
    CLOSESEQ F
    CHAIN 'sys' :@SENTENCE

    3/ BASIC BP MYCATALOG
    4/  sysCATALOG BP MYCATALOG 
    5/ COPYI FROM VOC MYCATALOG, CATALOG OVERWRITING

    This is a method to simply trap logging  any verb.

    I hope this help

    ------------------------------
    Manu Fernandes
    ------------------------------