BookmarkSubscribeRSS Feed
R_Win
Calcite | Level 5
Hi

I am having 90 character variable in a dataset now i want to find the length of all the variables.

How can i do it by using macros and how can i pass them
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Do you want to know the SAS "defined" LENGTH attribute or the "data value" internal length for your variables - big difference.

Scott Barry
SBBWorks, Inc.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Explore using the SAS-maintained DICTIONARY table information called COLUMNS (or SAS view SASHELP.VCOLUMN) to get the SAS variable names and associated LENGTH information. You can use this information to generate and execute SAS code on-the-fly.

Scott Barry
SBBWorks, Inc.

Programming with the SQL Procedure

Accessing SAS System Information by Using DICTIONARY Tables
http://support.sas.com/documentation/cdl/en/sqlproc/62086/HTML/default/a001385596.htm

Using Metadata and Project Data for Data-Driven Programming
Brian Varney, COMSYS IT Partners, Inc., Kalamazoo, Michigan
http://www2.sas.com/proceedings/sugi31/045-31.pdf

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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