I've used below code to import CSV file, but am getting error as shown below despite using macro statements %SYSMSTORECLEAR; . Any help is really appreciated.
I'm using SAS EG 5.1.
%SYSMSTORECLEAR;
dm 'list;clear;log;clear;';
%PUT %SYSFUNC(GETOPTION(SASAUTOS));
filename _all_ clear;
libname _all_ clear;
proc delete data=work._all_;
run;
filename inf "/data/rawdata_cu/SA/SHOPPER_3-28-2014_cass.csv" lrecl=32767 termstr=crlf;
proc import datafile=inf out=rawdata dbms=csv replace;
guessingrows=10000000;
run;
Log:
14 GOPTIONS ACCESSIBLE;
15 %SYSMSTORECLEAR;
16 dm 'list;clear;log;clear;';
17 %PUT %SYSFUNC(GETOPTION(SASAUTOS));
( "SASEnvironment/SASMacro" '!SASROOT/sasautos' )
18 filename _all_ clear;
NOTE: Fileref INF has been deassigned.
ERROR: At least one file associated with fileref FILDES08 is still in use.
ERROR: Error in the FILENAME statement.
19 libname _all_ clear;
NOTE: Libref IN has been deassigned.
21 proc delete data=work._all_;
22 run;
NOTE: PROCEDURE DELETE used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
24 filename inf "/data/rawdata_cu/SA/SHOPPER_3-28-2014_cass.csv" lrecl=32767 termstr=crlf;
25 libname in "/data/PROD_CODES/CCU";
NOTE: Libref IN was successfully assigned as follows:
Engine: V9
Physical Name: /data/PROD_CODES/CyprusCU
Are you sure that the FILEREF "FILDES08" is associated with the SASMSTORE LIBEREF?
I don't think they are related.
Do we've any options like below (or any other) to find whether SASMSTORE LIBEREF and FILEREF are related?
%PUT %SYSFUNC(GETOPTION(SASAUTOS));
have a look at DICTIONARY.EXTFILES
also
filename fileref LIST;
I can't think of an option off the top of my mind, but you can query:
proc sql;
select SETTING
into :AUTOS_LIST
from SASHELP.VALLOPT
where OPTNAME="SASAUTOS";
quit;
It's my output,
("SASEnviornment/SASMacro" !SASROOT/sasautos')
Looks like a typo in there at least - Enviornment is not a word. Its EG so can't really help that much as only have base. Is there an Autoexec.sas? Check what it says in there.
Hi, Generally, the SASEnvironment/SASMacro folder is part of a Business Intelligence server setup. You may or may not have write access to that folder. I suggest you check with your SAS Admin. person.
cynthia
SAS handles macros in two ways
* autocall searches the directory specifications in the fileref SASAUTOS;
* compiled and stored searches the catalog(s) in the libref SASMSTORE;
%put note: sasmstore: %sysfunc(getoption(sasmstore));
%put note: mstored: %sysfunc(getoption(mstored));
Your question is confusing.
The macro call
%SYSMSTORECLEAR;
is supposed to deallocate the libref which is the value of the compile-and-stored option sasmstore.
your program is checking the list of firerefs in the autocall option sasautos
%PUT %SYSFUNC(GETOPTION(SASAUTOS));
What exactly are you trying to do?
and how does this relate to your error of clearing all the filerefs?
18 filename _all_ clear;
NOTE: Fileref INF has been deassigned.
ERROR: At least one file associated with fileref FILDES08 is still in use.
ERROR: Error in the FILENAME statement.
Ron Fehd macro maven
I do not see any error realted to sysmstoreclear.
As you are using Eguide 5.1 you should code accordingly.
- Do not use DM statements These are part of base sas.
- hands of of the system as much as possible. Your platform admin as contact for that.
- do not user libname _all_ cleare filename _all_ clear. You can hit to things that have been defined server side.
- the server is a Unix based one not Windows. Be carefull on caps usage, Unix is case-sensitive.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.