Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Documentation for @MONTH, @YEAR, @YEAR4 incorrect?

    Posted 09-28-2022 13:17

    Reading the documentation for @ Variables, it seems inconsistent for @DAY to come from the established @DATE, yet the other, similarly named variables should be based on the current date.

    Variable

    Read-Only

    Value

    @DATE

    Internal date when the program was invoked.

    @DAY

    Day of month from @DATE.

    @MONTH

    Current month.

    @YEAR

    Current year (2 digits).

    @YEAR4

    Current year (4 digits).

    The following experiment confirms the current-date @ variable documentation does not reflect the behavior of UniVerse 11.3.1.6022. All values relate to the established @DATE value. Disabling automatic date and time, set the clock to late New Year's eve, run the program, celebrate the new year, and let the program finish.

    AtDay

    0001 program AtDay

    0002

    0003 D = DATE()

    0004 print "DATE(): ":DATE():", ": OCONV(D,"D4/")

    0005 print "@MONTH: ":@MONTH

    0006 print "@DAY: ":@DAY

    0007 print "@YEAR: ":@YEAR

    0008 print "@YEAR4: ":@YEAR4

    0009 print "Wait for end of day: ":

    0010 input Junk

    0011

    0012 D = DATE()

    0013 print "DATE(): ":DATE():", ": OCONV(D,"D4/")

    0014 print "@MONTH: ":@MONTH

    0015 print "@DAY: ":@DAY

    0016 print "@YEAR: ":@YEAR

    0017 print "@YEAR4: ":@YEAR4

    At the input prompt, let the date roll over to the next year.

    >run bp AtDay

    DATE(): 20086, 12/28/2022

    @MONTH: 12

    @DAY: 28

    @YEAR: 22

    @YEAR4: 2022

    Wait for end of day: ?

    DATE(): 20090, 01/01/2023

    @MONTH: 12

    @DAY: 28

    @YEAR: 22

    @YEAR4: 2022



    ------------------------------
    Mark A Baldridge
    Principal Consultant
    Thought Mirror
    Nacogdoches, Texas United States
    ------------------------------



  • 2.  RE: Documentation for @MONTH, @YEAR, @YEAR4 incorrect?

    PARTNER
    Posted 09-29-2022 07:13
    I don't believe those functions are a direct read of the current state but loaded up when the routine is ran.  For a direct read you would want to use DATE() and the relevant DD, DM, DY conversions​​​

    ------------------------------
    Mike Young
    Senior PS Techical Consultant
    Aptean
    Atlanta GA US
    ------------------------------



  • 3.  RE: Documentation for @MONTH, @YEAR, @YEAR4 incorrect?

    ROCKETEER
    Posted 09-29-2022 14:16
    Mark,
    Is your post a suggestion that the documentation for the other 3 AT-variables also include the "from @DATE" qualifier?
    This would seem accurate based on your test results and the post from Mike.
    Thanks,
    Neil
    ​​

    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------



  • 4.  RE: Documentation for @MONTH, @YEAR, @YEAR4 incorrect?

    Posted 09-29-2022 17:39
    Yes, and also to replace "Current" MONTH/YEAR/YEAR4, which is incorrect.

    Accurate documentation helps everyone! :)

    ------------------------------
    Mark A Baldridge
    Principal Consultant
    Thought Mirror
    Nacogdoches, Texas United States
    ------------------------------



  • 5.  RE: Documentation for @MONTH, @YEAR, @YEAR4 incorrect?

    ROCKETEER
    Posted 10-06-2022 08:52
    A documentation ticket has been opened with the request to change the descriptions of the 3 @variables to the following.

    @MONTH - Month number from @DATE
    @YEAR - Two digit year from @DATE
    @YEAR4 - Four digit year from @DATE

    Thanks,

    Neil




    ------------------------------
    Neil Morris
    Universe Advanced Technical Support
    Rocket Software
    ------------------------------