DATA Step, Macro, Functions and more

Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

Reply
Regular Contributor
Posts: 168

Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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

      

Respected Advisor
Posts: 3,777

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

Are you sure that the FILEREF "FILDES08" is associated with the SASMSTORE LIBEREF?

I don't think they are related.

Regular Contributor
Posts: 168

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

Do we've any options like below (or any other) to find whether SASMSTORE LIBEREF and FILEREF are related?

%PUT %SYSFUNC(GETOPTION(SASAUTOS));

Respected Advisor
Posts: 3,777

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

have a look at DICTIONARY.EXTFILES

also

filename fileref LIST;

Super User
Super User
Posts: 7,413

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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;

Regular Contributor
Posts: 168

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

It's my output,

("SASEnviornment/SASMacro" !SASROOT/sasautos')

Super User
Super User
Posts: 7,413

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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.

SAS Super FREQ
Posts: 8,743

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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

Regular Contributor
Posts: 200

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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

Valued Guide
Posts: 3,208

Re: Unable to clear the stored compiled macro with %SYSMSTORECLEAR;

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.  

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 9 replies
  • 1712 views
  • 6 likes
  • 6 in conversation