BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mrahman
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.


 

View solution in original post

7 REPLIES 7
novinosrin
Tourmaline | Level 20

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;

 

mrahman
Calcite | Level 5

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;

Tom
Super User Tom
Super User

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.

mrahman
Calcite | Level 5
I am trying to read .txt file on Windows machine. It is not a SAS file.
Kurt_Bremser
Super User

@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.

Reeza
Super User

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.


 

mrahman
Calcite | Level 5
That worked! Thanks so much for the link.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 7854 views
  • 1 like
  • 5 in conversation