How to read in permanent vs temporary dataset? Most of the data I have read into SAS has code as follows:
libname ILE2023 "/home/u60777348/ILE2023";
data BRFSSILE;
set ILE2023.brfss2018;
run;
I see this is temporary because of the set statement, it is creating a temporary dataset from the "brfss2018" data. What would reading in the permanent dataset "brfss2018" code look like?
Thanks for any help-much appreciated.
I am not sure what your question is. The code you posted IS reading in a permanent dataset named brfss2018. It is reading the one that lives in the directory named /home/u60777348/ILE2023.
So the code you posted is reading the dataset the lives in the file named /home/u60777348/ILE2023/brfss2018.sas7bdat .
I see, thank you. In switching around my lines, the code that I was originally using, listed above, now isn't running. I don't know how this is even possible. I am getting the error message "The table "WORK.BRFSSILE" cannot be opened because it does not contain any columns." from the code
libname ILE2023 "/home/u60777348/ILE2023";
data BRFSSILE;
set ILE2023.brfss2018;
run;
which ran perfectly fine before. Any idea what's happening? Nothing like this has ever happened to me before.
If you got that error after running that data step then the permanent dataset also has no variables.
You probably accidentally ran a data step like this:
data ILE2023.brfss2018;
run;
Which would make a new dataset with no variables.
You probably need to re-create the "permanent" dataset. And you have learned that nothing is permanent.
That was the step so that explains it. Do I need to redownload the data again?
@lanec23 wrote:
That was the step so that explains it. Do I need to redownload the data again?
Yes, you do.
One way to protect yourself against such situations where you overwrite by mistake a source table is to strictly separate source from target locations and to assign source locations read only. In your case below libname syntax would have protected you.
libname ILE2023 "/home/u60777348/ILE2023" access=readonly;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!