Announcement

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

  • r(601) error appending STUMPED

    New to Stata and already having an issue. I am on a Mac and using a copy of Stata and license from my school, Drexel. I am able to load one file into Stata, and then when trying to append I keep getting an r(601) error file ####### not found. In doing some internet research I thought it could be a folder control issue, so I installed Stata on my desktop. Still getting the r(601) error.

    Thought it could be a Stata license issue, but I am able to see the serial number using commands.

    I have tried doing append using command and also the GUI. I have watched training on append and I am pretty sure I am typing the command correctly.

    Below are my command and results. I can successfully import the test data 2.csv file, bu then when trying to use that file to append the one loaded is when I get the r(601) error. Any Idas?

    Gary

    o




    . clear all

    . import delimited "/Users/garyhuff/Desktop/test data 2.csv"
    (encoding automatically selected: UTF-8)
    (11 vars, 18 obs)

    . clear all

    . import delimited "/Users/garyhuff/Desktop/test data. 1.csv"
    (encoding automatically selected: UTF-8)
    (11 vars, 18 obs)

    . append using "/Users/garyhuff/Desktop/test data 2.csv"
    file /Users/garyhuff/Desktop/test data 2.csv not found
    r(601);

  • #2
    You cannot -append- a .csv file. You can only append a Stata .dta file. So after you import your "test data 2.csv" file, you have to -save- it as a Stata .dta file. Then you can import "test data 1.csv" and then -append- the Stata .dta file you saved.

    The only operations you can carry out with .csv files are -import-ing and -export-ing. Other file management operations (-append-, -merge-, etc.) are only available with Stata .dta files.

    Comment


    • #3
      This was cross-posted at https://www.reddit.com/r/stata/comme...und_error_mac/

      Please note that it is a request here that you tell us about cross-posting -- see https://www.statalist.org/forums/help#crossposting -- and a rule on Reddit's r/stata that you tell people about cross-posting. In either case the reasoning is that (1) people who might provide an answer won't want to duplicate effort made elsewhere (2) people interested in an answer should be interested in any answer elsewhere. I've seen some people describe posting in two or more forums as offensively inconsiderate to people in any one forum, an attitude I don't share, but as said the attitude can be expressed.

      Otherwise a couple of details can be added to @Clyde Schechter's explanation.

      The help for append states very early

      append appends Stata-format datasets stored on disk to the end of the dataset in memory. If any filename is specified without
      an extension, .dta is assumed.
      This is the nub of the matter, but part is simple once understood and the other part is more subtle.

      A comma-separated variable file is not a Stata-format dataset, for which the conventional extension is .dta. So append isn't designed to do what you asked, and that is documented.

      But in that case why did Stata not just indicate that you tried to use the wrong kind of data file? The answer from the second sentence quoted above is that Stata was expecting a file with an extension .dta, which you do not have to specify, so it was looking for /Users/garyhuff/Desktop/test data. 1.csv.dta -- which was the file that could not be found.

      From a user's point of view having two extensions .csv.dta might be unlikely but names with two or more periods (stops) are not illegal, as shown by the fact that two periods (stops) are already part of the filename. So Stata makes no judgement there: its behaviour matches its documentation.

      Comment

      Working...
      X