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

Hello Experts,

 

How can I defining a primary key on a table in PROC SQL?  Under "My Libraries" I choose a table's columns, all I see a property and value.  How can I defining the primary and/or foreign key of a table. 

Describe table table_name gives me nothing but columns' property and value.  

I tried describe table constraints table_name and it said table_name does not have any integrity constraints to describe.  Which meant it doesn't have primary/foreign key, right?

 

thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

SAS is not a database system.  So you do not need to define primary or foreign keys.

For clues as to what variables might be considered the unique identifiers for a dataset you could look at the SORTED BY attribute. Or see if any INDEXes have been created.

Otherwise refer to any documentation that you have received along with the data.

View solution in original post

1 REPLY 1
Tom
Super User Tom
Super User

SAS is not a database system.  So you do not need to define primary or foreign keys.

For clues as to what variables might be considered the unique identifiers for a dataset you could look at the SORTED BY attribute. Or see if any INDEXes have been created.

Otherwise refer to any documentation that you have received along with the data.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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
  • 1700 views
  • 0 likes
  • 2 in conversation