Announcement

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

  • Issue when read large SAS file

    Hi everyone,

    I'm new here and also a novice of Stata.

    I have a large Sas file about 48GB and I want to read it by Stata.
    I try to import it with some selected variables with command: import sas institutionid institutionname regstockperiodid restatement fiscalyear fiscalquarter var_215343 var_216559 var_216560 var_231618 var_215668 using "C:\Users\jyk04\Dropbox\stock price crash risk\loan_write_off_ML_2022 Spring\bank_reg\inst_fp_holding.sas7bdat"

    but it failed like this:
    error reading file
    r(692);
    and r(692) refers to
    file I/O error on read

    So anyone can tell me why this happen? i try to import another larger file(64GB) with some selected variables and it works. So I'm really confused why this can't be read.

    All the suggestions and comments are appreciated!
    Now it's 11 PM in Singapore, maybe I can not reply your comments and suggestions immediately, but I will reply once I get up! Thanks!

  • #2
    It is hard to know what went wrong: but with this r(692) code, whatever the problem, it was detected by your operating system, and Stata simply passed the message along to you. In any case, the problem has nothing to do with Stata or -import sas-. The most obvious possibilities are:

    1. You don't have permission to read that file (or that directory or some other directory along the path to it).
    2. The file is itself corrupted.

    Check the permissions on that file. If you have read permission and if you are able to read other files in the same directory, then #1 is ruled out. If some other application is able to read the file properly than #2 is ruled out.

    If neither of these is the source of the problem, then I don't know what else to suggest. You might try going into your operating system directly, say using its native copy command (not the Stata -copy- command) and attempt to copy the file to some other location (N.B. copy, not move, nor relink). My prediction would be that this operation will also fail, but the error message from the OS might be more specific about what is wrong. (And if it doesn't fail, you might try reading the copy with -import sas-.)
    Last edited by Clyde Schechter; 09 May 2022, 10:00.

    Comment


    • #3
      One more consideration since I see the file is being maintained with a link to Dropbox, perhaps turn off any syncing while you are trying to access that file. It may be that the file is being updated and that his causing this conflict.

      Comment


      • #4
        Thanks for your adviceClyde
        I try open another similar file in the same path and it can work, so seem like not directory issue
        I haven't tried to read with other application because I do not have SAS, python can't work because the file is too large.
        Maybe I should try get SAS and see whether it can work or not and to rule out the file itself corrupted.

        Comment


        • #5
          Thanks Leonardo.

          I try read other files in the same Dropbox directory and they can work. So maybe it's not Dropbox issue.

          Comment

          Working...
          X