BookmarkSubscribeRSS Feed
gtucke1
Fluorite | Level 6

I needed to delete 2 observations. I wanted to check the dataset to make sure the changes had been made. Below are my export and import statements. I continue to get the following error for the import statement:

 

Proc export data = ICPNEED.cg_relation_fix
Outfile = 'C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Working Data Set\cg_realtion_fix.xlsx'
DBMS = XLSX Replace;
Sheet = "cg_relation_fix";
Run;

 

Proc import datafile = 'C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Working Data Set\cg_relation_fix.xlsx'
DBMS = xlsx
OUT = ICPNEED.relation_fix
Replace;
Run;

 

From the log:

329 Proc import datafile = 'C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Working
329! Data Set\cg_relation_fix.xlsx'
330 DBMS = xlsx
331 OUT = ICPNEED.relation_fix
332 Replace;
333 Run;

ERROR: Physical file does not exist, C:\Users\gtuck\OneDrive\Documents\Gretchen
Dissertation\SAS\Working Data Set\cg_relation_fix.

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Why don't you just check this in SAS instead of Excel?

--
Paige Miller
gtucke1
Fluorite | Level 6
Hi,

What is the procedure for checking in SAS?
PaigeMiller
Diamond | Level 26

Every SAS user interface has a data set viewer, in every interface I know, you double-click on the actual data set on the left side of the screen. To be more specific, I would have to know what SAS user interface you are using. Once you have the data set viewable on your screen, you can  confirm the two observations are no longer present.


Checking the log will tell you if records were deleted, and how many. It won't tell you if you deleted the right records. In some cases, it is trivial to delete the right records; in other cases it is not so trivial and requires careful checking.

--
Paige Miller
Tom
Super User Tom
Super User

The SAS log should show whether or not two observations were deleted.

Example:  This data step ended up deleting 5 observations.

214  data want;
215    set sashelp.class;
216    if age=12 then delete;
217  run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.WANT has 14 observations and 5 variables.

 

Kurt_Bremser
Super User

Typo:

Outfile = 'C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Working Data Set\cg_realtion_fix.xlsx'

datafile = 'C:\Users\gtuck\OneDrive\Documents\Gretchen Dissertation\SAS\Working Data Set\cg_relation_fix.xlsx'

realtion vs. relation 

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!

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
  • 5 replies
  • 416 views
  • 3 likes
  • 4 in conversation