Question-: Can I create fileref for the entire directory which has multiple files in it?
Answer: Yes, you can create the same way as you created in above example, but instead of specific file change the path to the directory and in the infile statement you have to specify the filename as in below example.
Question-: What is the SAS Library?
Answer: SAS Library is a collection of SAS files, which can include SAS data sets or SAS files. And this entire collection is referenced as a unit. In Windows env. One SAS Library is equal to one folder and in Unix based env. It is equal to a directory.
Question-: Which SAS statement you can use to create the SAS libref?
Answer: We can use LIBNAME statement to create the libref. In the single LIBNAME statement we can create more than one libref as well. LIBNAME statement is a Global statement.
Question-: How long libref is effective?
Answer: Once libref is created it would remain effective until you change it, cancel it or until your SAS session is alive. The libref is mandatory for all the permanent SAS library which you want to refer and Work is also a libref for the temporary SAS Library.