BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
breelloyd
Fluorite | Level 6

Hi Guys,

I'm stuck as far as to why one of my tables (from my SQL Database) isn't coming through into my library. Almost everything else is. I'm looking to QA it. Try and work out if there are any other tables that are missing.

So my question: how can I produce a list of all the tables that are in a SAS library that I've created?

Thanks,

Bree

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Try proc datasets.

check how long the table name is, if its over 32 characters it won't show up.

View solution in original post

8 REPLIES 8
Reeza
Super User

Try proc datasets.

check how long the table name is, if its over 32 characters it won't show up.

breelloyd
Fluorite | Level 6

it's over 32 chars long!

Is there a work around for this? or do I need to go back to the IT team?

SASKiwi
PROC Star

One workaround would be to query the "dictionary" tables of the source SQL database. Which SQL database are you using, for example Oracle, SQL Server, as each database names its dictionary tables differently.

ChrisHemedinger
Community Manager

If you want to see what's in the database (and not just what you see in a SAS library), try this technique:

Using PROC SQL to get the schema of a MySQL database - The SAS Dummy

Even though the article is about MySQL, it can apply to other databases as well.

Chris

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Haikuo
Onyx | Level 15

Hi Chris,

Information schema is not supported by Oracle?

I have been using something like ALL_VIEWS, ALL_TABLES, ALL_TAB_COLUMNS to query Oracle Metadata.

Haikuo

ChrisHemedinger
Community Manager

Yes, different databases have different schema mechanisms.  My example works with MySQL and a few others.  I just wanted to point out that you can use PROC SQL to pass a database-specific request to get information as needed.

Chris

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Reeza
Super User

You will be able to access the table using SQL Pass Thru or you can ask IT to change the name to less than 32 characters. It depends on what your needs are, what the best solution would be.

breelloyd
Fluorite | Level 6

It looks like the boys are going to build a DB for me, Basically views so I can access all the data, and we'll rename everything.

The same goes for Field names right? If I have a table with a field name that is >32 Char, what happens? does it just neglect to import that field or does it cause the whole table import to fail? We have plenty of Table names >32 Char.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 8 replies
  • 4564 views
  • 3 likes
  • 5 in conversation