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

I'm looking for a macro called %list_attrib which paper D13-2009 claims is in this community.  The macro basically lists all the variables within a SAS dataset with their attributes in the form of an attrib statement.  Neither I nor SAS TS can find it.  Does anyone know where it might be?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I don't see any reference to this site as the source in the paper, can you clarify where exactly it states that?

 

I found nothing super relevant except these which seem slight variations on what you need.

 

https://github.com/scottbass/SAS/blob/master/Macro/attrib.sas

 

http://www.datasavantconsulting.com/roland/Spectre/utilmacros/dsattrib.sas

 


@gphunt wrote:

I'm looking for a macro called %list_attrib which paper D13-2009 claims is in this community.  The macro basically lists all the variables within a SAS dataset with their attributes in the form of an attrib statement.  Neither I nor SAS TS can find it.  Does anyone know where it might be?

Thanks.


 

 

 

 

View solution in original post

3 REPLIES 3
Reeza
Super User

I don't see any reference to this site as the source in the paper, can you clarify where exactly it states that?

 

I found nothing super relevant except these which seem slight variations on what you need.

 

https://github.com/scottbass/SAS/blob/master/Macro/attrib.sas

 

http://www.datasavantconsulting.com/roland/Spectre/utilmacros/dsattrib.sas

 


@gphunt wrote:

I'm looking for a macro called %list_attrib which paper D13-2009 claims is in this community.  The macro basically lists all the variables within a SAS dataset with their attributes in the form of an attrib statement.  Neither I nor SAS TS can find it.  Does anyone know where it might be?

Thanks.


 

 

 

 

gphunt
Fluorite | Level 6

Thanks, Reeza.  This will get me what I'm looking for.

Best,

Gary

ChrisNZ
Tourmaline | Level 20

Note that if you use that attrib statement to create  a data set with the same structure, you can simply run the line:

data NEW:
  if 0 then set OLD;
run;

to copy the variables (and their attributes) from OLD to NEW.

 

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

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
  • 3 replies
  • 1291 views
  • 0 likes
  • 3 in conversation