Hello:
I have libname program shown as below. I am wondering if I could assign a folder pathway after I generate the libname "RVS". Thanks.
Libname RVS OLEDB
provider="sqloledb"
properties=("Data Source"="Inquire/2018"
"Persist Security Info"="True"
"User ID"="test"
"Password"="&pin"
"Initial Catalog"="RVS")
schema=dbo;
@ybz12003 wrote:
Hello:
I have libname program shown as below. I am wondering if I could assign a folder pathway after I generate the libname "RVS". Thanks.
Libname RVS OLEDB provider="sqloledb" properties=("Data Source"="Inquire/2018" "Persist Security Info"="True" "User ID"="test" "Password"="&pin" "Initial Catalog"="RVS") schema=dbo;
You can have multiple folders in a library. Open your SAS configuration file for examples involving the SASHELP library or see if the default Key setting of CTRL-B brings up your library list to see what the path for SASHELP looks like.
However since libraries tend to be read and write when you use an external DB as the target for a library I suspect you would have many bad things happen if you tried to assign a path and a DB at the same time as you would be writing to two different file standards: SAS data set or DB table.
As mentioned a second libname statement would overwrite an existing libname of the same name. If that is the behavior you want go for it but expect to have issues debugging things later when looking for tables you thought were written to the DB but actually want to a different folder because the libname executed in between.
Please explain what you mean by "assign a folder pathway".
For example, I could like to do the following as well after the OLEDB.
libname RSV 'Pathway\RSV\2018';
You could, but it would overwrite your other library. You could give it a different name though, but I don't think you can combine librefs from different sources, though I haven't tried it.
@ybz12003 wrote:
For example, I could like to do the following as well after the OLEDB.
libname RSV 'Pathway\RSV\2018';
@ybz12003 wrote:
For example, I could like to do the following as well after the OLEDB.
libname RSV 'Pathway\RSV\2018';
Is this suposed to be "RVS" or "RSV".
In you initial post you mentioned "RVS" and now your assigning "RSV". If this is your situation, you can do that without any issues or if you want to assign the same name that was previously assigned, you can do that and first one will be replaced by the later one. If you want to check how that libname is defined then run LIBNAME RVS list; or you can also query sashelp.vlibnam views.
@ybz12003 wrote:
Hello:
I have libname program shown as below. I am wondering if I could assign a folder pathway after I generate the libname "RVS". Thanks.
Libname RVS OLEDB provider="sqloledb" properties=("Data Source"="Inquire/2018" "Persist Security Info"="True" "User ID"="test" "Password"="&pin" "Initial Catalog"="RVS") schema=dbo;
You can have multiple folders in a library. Open your SAS configuration file for examples involving the SASHELP library or see if the default Key setting of CTRL-B brings up your library list to see what the path for SASHELP looks like.
However since libraries tend to be read and write when you use an external DB as the target for a library I suspect you would have many bad things happen if you tried to assign a path and a DB at the same time as you would be writing to two different file standards: SAS data set or DB table.
As mentioned a second libname statement would overwrite an existing libname of the same name. If that is the behavior you want go for it but expect to have issues debugging things later when looking for tables you thought were written to the DB but actually want to a different folder because the libname executed in between.
Thanks for your reply.
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.