BookmarkSubscribeRSS Feed
ross47
Calcite | Level 5

I'm trying to get a list of SAS datasets from a working directory other than the SAS install directory.  This is the connect string that I use:

 

Provider=SAS.BaseSASProvider;Data Source=local;SAS Executable=C:\Program Files\SASHome\SASFoundation\9.4\sas.exe;SAS Parameters=-initstmt %sasodbc(local) -icon -nosplash;SAS Working Directory=D:\MySASDatasetFolder

 

The OpenSchema method of the ADODB Connection object only returns tables for datasets in the SAS Executable directory.

 

How can I return tables for datasets in the D:\MySASDatasetFolder directory?

1 REPLY 1
ross47
Calcite | Level 5

I'm trying to get a list of SAS datasets from a working directory other than the SAS install directory.  This is the connect string that I use:

 

Provider=SAS.BaseSASProvider;Data Source=local;SAS Executable=C:\Program Files\SASHome\SASFoundation\9.4\sas.exe;SAS Parameters=-initstmt %sasodbc(local) -icon -nosplash;SAS Working Directory=D:\MySASDatasetFolder

 

The OpenSchema method of the ADODB Connection object only returns tables for datasets in the SAS Executable directory:

 

_ConnectionPtr m_Conn;
m_Conn.CreateInstance(__uuidof(Connection));

_bstr_t connString(getConnectionString());
_bstr_t username(getUsername());
_bstr_t password(getPassword());

m_Conn->Open(connString, username, password, adModeUnknown);

 

_RecordsetPtr OSchema = m_Conn->OpenSchema(adSchemaTables);

 

How can I return tables for datasets in the D:\MySASDatasetFolder directory?  I suspect that it is a problem with my connect string but can't locate suitable documentation for confirmation. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 711 views
  • 0 likes
  • 1 in conversation