how to get sql server schema data into sas for automation purpose
SAS provides access modules to interface with data bases (like SAS Access to SQL Server or SAS Access to ODBC). If you've got one of these access modules licensed and installed then it's just a question of configuration to access a SQL Server database.
Can you provide a bit more detail? Where are you at right now? Do you have the required SAS modules licensed? Do you already have a working connection to the database? Can you "see" any of the tables?
What exactly do you want to automate?
Are the tables registered in sas metadata? If yes, you can query sashelp.vcolumns to get the tables metadata.
libname cdm odbc uid= pwd= dsn=cdm schema=dbo
in this i have access but i have data in another schemas like payments_aru and resposnsys,
Then define another libname with this schema.
its getting error
You don't need to register the tables in SAS Metadata unless you use the META engine in the libname statement.
@Patrick wrote:
You don't need to register the tables in SAS Metadata unless you use the META engine in the libname statement.
Of course not, but it makes using data (and the metadata) somewhat easier, while new to sas.
Let's agree to disagree. I tend to think that the concept of SAS Metadata is for "Base SAS users" 2nd level and most of the time only of importance for BI/DIS applications - or if using Metadata security.
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.