Help using Base SAS procedures

Issue reg deletion of rows from sashelp.class dataset.

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Issue reg deletion of rows from sashelp.class dataset.

proc sql;
delete from sashelp.class
where age>13;
quit;

Hi, I used the above mentioned SAS code to delete the observations from sashelp.class dataset whose age is greater than 13.

By doing so, 9 records got deleted. Now when I use Proc Print statement to display the same dataset, I only get 10 records instead of 19 which is obvious. How can I get back all the 9 deleted observations? I tried using Global statements but it didn't work out.

Now I can not perform any manipulations or analysis on a dataset that has incomplete observations.

Please help me solving this issue.

 

Thank you

Avijeet


Accepted Solutions
Solution
‎08-19-2017 06:09 AM
Super User
Posts: 18,603

Re: Issue reg deletion of rows from sashelp.class dataset.

I highly suspect that's an illegal version. Especially if you just installed it. 

 

Search SAS Analytics U and you can download and work with the latest version. It's free for learning. 

View solution in original post


All Replies
Super User
Posts: 18,603

Re: Issue reg deletion of rows from sashelp.class dataset.

1. I'm surprised you were able to delete those rows, usually SASHELP is locked down.

2. You cannot replace the rows once their deleted unless you have some options set up on your server. You'll need to get the original dat a back somehow. Maybe a colleague will have it on their system? Its not just the data, its the labels and formats as well, so I recommend getting the SAS dataset from someone with a similar set up to yours. 

 

 

New Contributor
Posts: 3

Re: Issue reg deletion of rows from sashelp.class dataset.

Hi,

FYI I am a student. I am learning SAS now and I don't use the licensed software.

I am using the university edition. What should I do to get back the deleted records?

 

Super User
Posts: 18,603

Re: Issue reg deletion of rows from sashelp.class dataset.

SAS UE doesn't allow you to do that. 

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
57
58 proc sql;
59 delete * from sashelp.class where age=13;
ERROR: User does not have appropriate authorization level for file SASHELP.CLASS.DATA.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
60 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 

Avijeet wrote:

Hi,

FYI I am a student. I am learning SAS now and I don't use the licensed software.

I am using the university edition. What should I do to get back the deleted records?

 


What exactly do you mean by University Edition? If it's the one downloaded from SAS UE, the quickest way is to redownload the image and re-install. 
 
New Contributor
Posts: 3

Re: Issue reg deletion of rows from sashelp.class dataset.

Just to confirm my software information is

SAS 9.1.3 Service Pack 4

XP_PRO platform and not the SAS UE edition.

I got it installed from the institute where I am undergoing training on SAS.

 

Thank you

Solution
‎08-19-2017 06:09 AM
Super User
Posts: 18,603

Re: Issue reg deletion of rows from sashelp.class dataset.

I highly suspect that's an illegal version. Especially if you just installed it. 

 

Search SAS Analytics U and you can download and work with the latest version. It's free for learning. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 255 views
  • 5 likes
  • 2 in conversation