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.
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.
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.
Thanks, Reeza. This will get me what I'm looking for.
Best,
Gary
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.