Search code examples
sasfilenames

SAS Filename statement to refer an aggregate storage location


I am a beginner of SAS.

I am trying to refer an external aggregate storage location by using FILENAME statement. The statement I wrote down is the following:

FILENAME SAMPLE 'c:\users\My SAS Files\9.3';

After executing it, I got the error message in log.

9221  FILENAME SAMPLE 'C:\Users\My SAS Files\9.3';
      --------
      23
ERROR 23-2: Invalid option name FILENAME.

9221! FILENAME SAMPLE 'C:\Users\My SAS Files\9.3';
               ------
               23
ERROR 23-2: Invalid option name SAMPLE.

Does anyone know the reason and how to fix it? I read through the documentation of FILENAME statement, seems it can be used to refer a folder.


Solution

  • This is a classic example of what can happen when you leave out a semi-colon.

    The error is NOT saying there is anything wrong with your FILENAME statement. Instead it is saying the adding the keyword FILENAME to the statement that it is currently interpreting is not valid. That statement (not shown in your question) does not allow the keywords FILENAME or SAMPLE.