BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hi Experts,

I am trying to save a sas data set in a location. TU_acc_added_1 is the name of the data set. I am not sure if I am giving the correct command in the set statement.

libname Store "\\local2.local\shares\Public\Trace\2022_07_11";

data store.TU_acc_added_1;
set store.TU_acc_added_1;
run;
error:
28         
29         data store.TU_acc_added_1;
30         set store.TU_acc_added_1;
ERROR: File STORE.TU_ACC_ADDED_1.DATA does not exist.
31         run;

Can you please suggest what mistake I am doing in my code. Thanks

2 REPLIES 2
Tom
Super User Tom
Super User

@Sandeep77 wrote:

Hi Experts,

I am trying to save a sas data set in a location. TU_acc_added_1 is the name of the data set. I am not sure if I am giving the correct command in the set statement.

libname Store "\\local2.local\shares\Public\Trace\2022_07_11";

data store.TU_acc_added_1;
set store.TU_acc_added_1;
run;
error:
28         
29         data store.TU_acc_added_1;
30         set store.TU_acc_added_1;
ERROR: File STORE.TU_ACC_ADDED_1.DATA does not exist.
31         run;

Can you please suggest what mistake I am doing in my code. Thanks


The name on the DATA statement is the dataset that will be created.

The name on the SET statement is the dataset that is being read.

You used the same name on both and then didn't actually include any code that would change anything, so there was no need to even run the code as written.

 

So if you want to create STORE.TU_acc_added_1 what is the SOURCE of the data you want to write there? 

 

Is it some other existing SAS dataset? 

data store.TU_acc_added_1;
   set mylib.mydataset;
run;

Is it some other type of data?  For example a text file?  If so then perhaps you want use an INFILE and INPUT statement to convert the text file into a dataset?

data store.TU_acc_added_1;
   input "mytextfile.txt" dsd dlm=';' ;
   input var1 var2 var3 ;
run;
andreas_lds
Jade | Level 19

You meant

 

 

data store.TU_acc_added_1;
   infile "mytextfile.txt" dsd dlm=';' ;
   input var1 var2 var3 ;
run;

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 428 views
  • 0 likes
  • 3 in conversation