- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to execute the following code and getting the following error. The same code worked in the previous version of SAS but not working now. Any help is appreciated.
libname input 'D\';
data q4_2015;
set input.PUDF_base1_4q2015_tab.txt;
run;
ERROR: File WORK.PUDF_BASE1_4Q2015_TAB.DATA does not exist.
ERROR 211-185: Invalid data set name.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You cannot reference a text file. You need to import it first, but that depends on the file structure.
You can try PROC IMPORT or the GUI to import a data set.
Or you can try a data step:
https://stats.idre.ucla.edu/sas/faq/how-do-i-read-in-a-delimited-ascii-file-in-sas/
@mrahman wrote:
I am trying to execute the following code and getting the following error. The same code worked in the previous version of SAS but not working now. Any help is appreciated.
libname input 'D\';
data q4_2015;
set input.PUDF_base1_4q2015_tab.txt;
run;
ERROR: File WORK.PUDF_BASE1_4Q2015_TAB.DATA does not exist.
ERROR 211-185: Invalid data set name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
assuming that's a sas dataset ,should it be PUDF_base1_4q2015_tab excluding the .txt?
data q4_2015;
set input.PUDF_base1_4q2015_tab;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply. Tried without the .txt but still get the same error. For some reason, it is appending. DATA at the end of the file name. Not sure if that has anything to do with the error or not.
652 data q4_2015;
653 set input.PUDF_base1_4q2015_tab;
ERROR: File INPUT.PUDF_BASE1_4Q2015_TAB.DATA does not exist.
654 run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Do you really have a directory named D that is a sub-directory of whatever directory is the current working directory for your SAS process?
If so does it actually contain a file named 'pudf_base1_4q2015_tab.sas7bdat'?
Are you are running on Unix? Does the beginning of the filename really use uppercase letters? If so then SAS on Unix will not see that file since it is looking for the file with the lowercase letters in its name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@mrahman wrote:
It is not a SAS file.
Then why are you trying to read it as one?
External files need to be imported, either with proc import or as infile (not set!) in a data step.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You cannot reference a text file. You need to import it first, but that depends on the file structure.
You can try PROC IMPORT or the GUI to import a data set.
Or you can try a data step:
https://stats.idre.ucla.edu/sas/faq/how-do-i-read-in-a-delimited-ascii-file-in-sas/
@mrahman wrote:
I am trying to execute the following code and getting the following error. The same code worked in the previous version of SAS but not working now. Any help is appreciated.
libname input 'D\';
data q4_2015;
set input.PUDF_base1_4q2015_tab.txt;
run;
ERROR: File WORK.PUDF_BASE1_4Q2015_TAB.DATA does not exist.
ERROR 211-185: Invalid data set name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content