Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • An easy to fix glitch in frlink

    When the command frlink is run, it creates a characteristic named frlink_date for the newly created variable. This characteristic is meant to store the day and time of the linkage, but it only stores the day. This is because of this line in frlink_gen, which is called by frlink:

    Code:
    else    local fd `c(current_date)' `c(current_time')
    The ending single quote for c(current_time) is inside the parentheses, when of course it should be outside:

    Code:
    else    local fd `c(current_date)' `c(current_time)'
    As it stands, since the existing macro is bugged, it evaluates to nothing, leaving only the date behind in the characteristic. This is straightforward enough that code to reproduce the problem probably isn't necessary, but here's an example anyway:

    Code:
    clear all
    gen testvar_for_link = .
    frame copy default frame2
    frlink 1:1 testvar_for_link, frame(frame2) gen(new_var)
    di "`new_var[frlink_date]'"
    Funny enough, there IS a way to get the time in the characteristic, as long as the time is 11 AM. Using the non-documented debug option, if the second to last line is instead:

    Code:
    frlink 1:1 testvar_for_link, frame(frame2) gen(new_var) debug(nodate)
    Then the variable characteristic frlink_date reads "01jan1960 11:00:00" (as intended by the option).

  • #2
    They'll have probably seen this thread, but you might want to mention it to StataCorp's technical services staff just to be sure.

    Comment


    • #3
      We will get this fixed in a future update.

      Thanks for the detailed explanation of the problem, and code review.

      Comment


      • #4
        This is now fixed in the Stata (and StataNow) 19 update on 14jan2026.

        Comment

        Working...
        X