BookmarkSubscribeRSS Feed
LineMoon
Lapis Lazuli | Level 10

Please, we want to keep all sas variables attibutes in sas session by library in one file (or data).

Thank you

5 REPLIES 5
Quentin
Super User

Can you describe what you want a bit more?  You have a SAS session, that has libraries defined, and datasets in those libraries, and variables in those datatsets.  That's a lot of variables.  You want a list of all those variables?? And what attributes? 

You might start by looking at dictionary.columns

proc sql;

create table AllVars as

select * from dictionary.columns

  ;

quit;

proc print data=AllVars;

run;

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
LineMoon
Lapis Lazuli | Level 10

Thank you for your message.

Yes , I want to see all variables and thier attributes( name, type, length, ....)

It is great, if i can see if the variable is missing or not.

Thank you

Astounding
PROC Star

PROC CONTENTS does this pretty easily:

proc contents data=lib._all_ out=lib._contents_;

run;

You have the option of adding the word NOPRINT if you want the data set only but not a printed report.  Of course, you don't have to run this right away.  It can be run later, as long as you don't delete any data sets.

This stores the attributes.  That has nothing to do with missing values, which you will have to analyze separately.

Good luck.

LineMoon
Lapis Lazuli | Level 10

Yes, that's right, but I need also to know the missing variables.

If I have a data with some of the missing variables and i want to see the missing variables and the non missing variables for all the libraries

Lib  Table vaiable  type length  Missing

lb1  t11       v11       1      5        yes

..................................................

lb2  t21       v21       2      $8        no

lbn   tn1      vn1      1        3$       yes

Ksharp
Super User

Check this :

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 502 views
  • 0 likes
  • 4 in conversation