BookmarkSubscribeRSS Feed
RamKumar
Fluorite | Level 6

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

      

9 REPLIES 9
data_null__
Jade | Level 19

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

I don't think they are related.

RamKumar
Fluorite | Level 6

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

%PUT %SYSFUNC(GETOPTION(SASAUTOS));

data_null__
Jade | Level 19

have a look at DICTIONARY.EXTFILES

also

filename fileref LIST;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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;

RamKumar
Fluorite | Level 6

It's my output,

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

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Cynthia_sas
SAS Super FREQ

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

Ron_MacroMaven
Lapis Lazuli | Level 10

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

jakarman
Barite | Level 11

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 --<-----

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 4084 views
  • 6 likes
  • 6 in conversation