Announcement

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

  • import fred stops working randomly

    Hello,

    I am using StataNow 19.5, MP.

    I am automating the import of various series from FRED like treasury yields or labor market indicators. For some reason the import fred command stops working randomly and gives me the "I/O error". Here's my code:
    Code:
    import fred DGS1MO DGS3MO DGS6MO DGS1 DGS2 DGS3 DGS5 DGS7 DGS10 DGS20 DGS30, clear
    
    Summary
    --------------------------------------------------------------------------------------------------------------
    Series ID                    Nobs    Date range                Frequency
    --------------------------------------------------------------------------------------------------------------
    DGS1MO                       6197    2001-07-31 to 2026-05-12  Daily
    DGS3MO                       11173   1981-09-01 to 2026-05-12  Daily
    DGS6MO                       11173   1981-09-01 to 2026-05-12  Daily
    DGS1                         16075   1962-01-02 to 2026-05-12  Daily
    DGS2                         12483   1976-06-01 to 2026-05-12  Daily
    DGS3                         16075   1962-01-02 to 2026-05-12  Daily
    DGS5                         16075   1962-01-02 to 2026-05-12  Daily
    DGS7                         14205   1969-07-01 to 2026-05-12  Daily
    DGS10                        16075   1962-01-02 to 2026-05-12  Daily
    DGS20                        14386   1962-01-02 to 2026-05-12  Daily
    DGS30                        12305   1977-02-15 to 2026-05-12  Daily
    --------------------------------------------------------------------------------------------------------------
    # of series imported: 11
       highest frequency: Daily
        lowest frequency: Daily
    r; t=16.58 10:44:29
    
    import fred DGS1MO DGS3MO DGS6MO DGS1 DGS2 DGS3 DGS5 DGS7 DGS10 DGS20 DGS30, clear
    I/O error
    r(691); t=0.20 10:44:51
    
    import fred LNU01000000 LNU02000000 LNU03000000 UNRATENSA PAYNSA, clear
    I/O error
    r(691); t=12.41 11:00:28
    Code:
    
    
    I checked online and found that it may be an issue with Stata's Temp folder being out of space, but that is not an issue in my case (plenty of space on drive C). I wrote directly to Stata tech support about this, and they also could not provide a solution saying that this may be caused by a firewall or antivirus that is run by my work administrator. I doubt that is the issue since I am also using the
    Code:
    getsymbols
    command to import stock price data and I have never encountered the I/O error issue with that.

    Has anyone run into this issue? Is there a fix to this or am I missing something?

    Thanks!


  • #2
    Is this post relevant? https://www.statalist.org/forums/for...nomic-database

    Comment


    • #3
      Originally posted by Stephen Jenkins View Post
      That post provides a timeline from the
      Code:
      freduse
      to
      Code:
      import fred
      , which only works with an API now. I'm using the
      Code:
      import fred
      command and have originally set the API permanently for Stata. So, that shouldn't be an issue since the import fred command works fine sometimes, and then when I run it again after a few seconds or minutes or for a different set of series it throws the I/O error.

      Comment

      Working...
      X