data have:
input libref $ path$30.;
cards;
sai C:\Users\SAIKIRAN PATEL\Desktop\SPRETNOST
ravi C:\Users\SAIKIRAN PATEL\Desktop\new
rahul C:\Users\SAIKIRAN PATEL\Desktop\oldest
;
run;
Here i want create all libraries at once ?
Many thanks
Use the LIBNAME function.
Use the libname function.
data want;
set have;
rc = libname(libref, path);
run;
rc will hold the return values.
From the docs:
The LIBNAME function assigns or clears a libref from a SAS library. When you use the LIBNAME function with two or more arguments, SAS attempts to assign the libref. When you use one argument, SAS attempts to clear the libref. Return codes are generated depending on the value of the arguments that are used in the LIBNAME function and whether the libref is assigned.
When assigning a libref, the return code is 0 if the libref is successfully assigned. If the return code is nonzero and the SYSMSG function returns a warning message or a note, then the assignment was successful.
If the SYSMSG function returns an error, then the assignment was unsuccessful.
If a library is already assigned, and you attempt to assign a different name to the library, the libref is assigned, the LIBNAME function returns a nonzero return code, and the SYSMSG function returns a note.
@shravanisreeyan wrote:
data have:
input libref $ path$30.;
cards;
sai C:\Users\SAIKIRAN PATEL\Desktop\SPRETNOST
ravi C:\Users\SAIKIRAN PATEL\Desktop\new
rahul C:\Users\SAIKIRAN PATEL\Desktop\oldest
;
run;
Here i want create all libraries at once ?
Many thanks
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.