Skip to main content
Nelson Schroth
Participating Frequently
Jun 12, 2023 3:47 PM UTC

Modication, Status Change and Last Access dates in STATUS statement

I was exploring our use of the STATUS statement in a simple BASIC program that we use to show info on a file. There wre 3 date/time pairs:

  • Last Access
  • Last Modification
  • Last Status

Last access shows a date from years ago, so it "feels" more like a creation date.  Last Status and Last Modification show identical values.

What are these supposedly tell me?

Nelson



------------------------------
Nelson Schroth
president
C3CompleteShop LLC
Harrison OH US
------------------------------

    2 replies

    Nelson Schroth
    Participating Frequently
    Jun 12, 2023 4:08 PM UTC

    I was exploring our use of the STATUS statement in a simple BASIC program that we use to show info on a file. There wre 3 date/time pairs:

    • Last Access
    • Last Modification
    • Last Status

    Last access shows a date from years ago, so it "feels" more like a creation date.  Last Status and Last Modification show identical values.

    What are these supposedly tell me?

    Nelson



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------

    BTW, this is UniVerse on AIX 7.2



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------
    Jonathan Smith
    Rocketeer
    Jun 13, 2023 4:41 AM UTC

    BTW, this is UniVerse on AIX 7.2



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------

    Nelson,

    I used the program below to do some testing on an internal systems running UV 11.3.5 on AIX 7.1

    The customer file before I did anything

    # ls -al CUSTOMER.F
    -rw-r--r--    1 root     system         5120 Jul 29 2021  CUSTOMER.F

    001: OPEN "CUSTOMER.F" TO F.FILE ELSE STOP
    002: STATUS FILE.STATUS FROM F.FILE ELSE STOP
    003: CRT "Time Now " : OCONV(TIME(),"MTS")
    004: CRT "Date Now " : OCONV(DATE(),"D4/")
    005: CRT
    006: CRT "Time of Last Access " : OCONV(FILE.STATUS<13>,"MTS")
    007: CRT "Date of Last Access " : OCONV(FILE.STATUS<14>,"D4/")
    008: CRT "Time of Last Modification " : OCONV(FILE.STATUS<15>,"MTS")
    009: CRT "Date of Last Modification " : OCONV(FILE.STATUS<16>,"D4/")
    010: CRT "Time of Last Status Change " : OCONV(FILE.STATUS<17>,"MTS")
    011: CRT "Date of Last Status Change " : OCONV(FILE.STATUS<18>,"D4/")
    012: END

    Time Now 04:22:30
    Date Now 13/06/2023

    Time of Last Access 04:22:30
    Date of Last Access 13/06/2023
    Time of Last Modification 05:59:15
    Date of Last Modification 29/07/2021
    Time of Last Status Change 11:49:04
    Date of Last Status Change 19/08/2022

    In terms of the last access pair file systems can be mounted with "noatime" or "nodiratime" and stops the recording of the access times on files and directories. It is often used as a performance gain so I suspect the file system your files reside on may have been mounted with these options. You need to check to see with which options the file system was mounted with as this would explain why the last access time is not working for you.

    I then did a chmod 666 and reran the program


    # chmod 666 CUSTOMER.F
    # ls -al CUSTOMER.F
    -rw-rw-rw-    1 root     system         5120 Jul 29 2021  CUSTOMER.F

    Time Now 04:31:00
    Date Now 13/06/2023

    Time of Last Access 04:31:00
    Date of Last Access 13/06/2023
    Time of Last Modification 05:59:15
    Date of Last Modification 29/07/2021
    Time of Last Status Change 04:29:55
    Date of Last Status Change 13/06/2023

    So based on my testing, the date and time of last access do work as long as the os has the faciltiy enabled.
    The Last Modification Pair seem to be the creation date / time.
    The Status change pair are when something about the file at the os level changes such as doing a chmod etc. I suspect there are other commands that impact the status change as well but chmod is a simple one to test.


    I hope this explains them a little bit more.

    Regards,



    ------------------------------
    Jonathan Smith
    UniData ATS
    Rocket Support
    ------------------------------
    Rocket Software - Senior Principal Technical Support Engineer - UniData ATS