Help using Base SAS procedures

Passing macros

Reply
Regular Contributor
Posts: 229

Passing macros

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Passing macros

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.
Super Contributor
Super Contributor
Posts: 3,174

Re: Passing macros

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
Ask a Question
Discussion stats
  • 2 replies
  • 114 views
  • 0 likes
  • 2 in conversation