Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FILENAME statement with %include 1

Status
Not open for further replies.

iren

Technical User
Mar 8, 2005
106
0
0
US
Hello everyone,

After I reviewed the reference, I got still confused about the FILENAME concept which I had never used before (and which I just had happened to see in somebody’s code that I needed to modify.

Does FILENAME statement means that one can keep multiple files under the same storage using %include ?

Then I still do not understand… why not to use library statement instead for each file? Is it a kind of alternative? Or library statement lacks something that Filename with later %include does ?

Thanks in advance,

Iren
 
No FILENAME and %INCLUDE are two different concepts.
One is a MACRO substitution and the other is a BASE SAS statement.

You use the %include (or %inc) statements for instances where you would like to include the code segment (at the include location) in your program. Think of it as a text substitution (as in the PERL language). SAS takes the file located at the pointed location and reads it into the environment and executes the lines found as if it was written in your calling program.

The FILENAME statment is used in a SAS program to read in data. The SAS program can use the file found at the location as it would a SAS dataset.

Hope this helps you,
Klaz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top