- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello Everyone,
I am trying to remove a permanent SAS dataset stored in a Unix directory from PC SAS. I enclose the code in Rsubmit and Endrsubmit; For testing purpose, I try to remove just one file first. When I run the code it has no errors. But it does not remove the dataset either. Can anyone tell me what I am doing wrong? Thank you very much for any input you may have!
rsubmit;
%macro remove;
x "rm /users/apps/cust_folder/customers1.sas7bdat";
%mend;
endrsubmit;
rsubmit;
%remove;
endrsubmit;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like your remote session is confused. Otherwise you should see the data step in the log with attendant NOTE: lines.
Try closing it and opening a new one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Your title is a little misleading. Looks like you want to run a Unix command using RSUBMIT block to a remote SAS session. Doesn't look like PC SAS has anything to do with it.
I usually like to use INFILE ... PIPE in a data step for those types of commands. That way you can see the response from the operating system. Also not sure what the macro is there for.
rsubmit;
data _null_;
infile "rm /users/apps/cust_folder/customers1.sas7bdat" pipe ;
input;
put _infile_;
run;
endrsubmit;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Tom,
I ran your code and it did not display anything from _infile_. There was no errors in the log. In fact, the only thing I see in the log was "Remote submit to XXX commencing" and "Remote submit to xxx complete". Any other suggestions?
Just to make myself clear, I run this from PC (Not on Unix). Hence, I call it 'PC SAS'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like your remote session is confused. Otherwise you should see the data step in the log with attendant NOTE: lines.
Try closing it and opening a new one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Tom, ballardw, and SASKiwi.
Tom,
I restarted a new SAS session and now I was able to see more info in the log. The problem was one of the letters in the file name had an incorrect case. It works like a charm now.
Thank you everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is that location available as a library from your SAS server or directly from your computer?
If so there is no reason to go to system commands. You could use proc delete or proc datasets.
And remember that UnIx is veRy Case sensiTIVE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Is there any particular reason for using an operating system command instead of these SAS techniques?
proc datasets library = MyLib;
delete customers1;
run;
quit;
or
proc sql;
drop table Mylib.customers1;
quit;