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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 695 views
  • 0 likes
  • 2 in conversation