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

Hello team,

 

I wonder if I want to refer to a variable name in SAS I can use this apporach:

libname + datasetname + variablename.

 

Please confirm it.

Regards,

blueblue

Blue Blue
1 ACCEPTED SOLUTION
5 REPLIES 5
ballardw
Super User

Where to you think you need to use this?

 

Show an example of how this is to be used.

My first instinct is "no" but I don't use EG for much.

 

The SAS/AF Screen Control Language uses multilevels but the third is typically property of an object.

 

For any procedure that is using a specific data set the libname and dataset name are moot once loaded.

ChrisHemedinger
Community Manager

Can you provide an example where you might do that? It's not specific to SAS Enterprise Guide, but I'm wondering what type of SAS code you have where that would be a useful construct.  Since SAS procedures are already (often) scoped to a particular data set...

 

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!
GN0001
Barite | Level 11

Thanks for the input:

 

Here is example:

Proc sql,

Create table as mytable

select libname.tablename,columnname

from libname.tablename

quit

 

regards,

blueblue

Blue Blue

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 5 replies
  • 1094 views
  • 4 likes
  • 5 in conversation