New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
YKU
Calcite | Level 5 YKU
Calcite | Level 5

Hi 

 

I am building a data dictionary by SAS with proc contents statement. However, some variable name are extremely long, exceeded 50-100 characters with special symbols. The outcome of proc content has a limited length of 32. How do I extend the output column length? 

 

Thanks

Welkin

2 REPLIES 2
Reeza
Super User
Variable names are restricted to 32 characters, you cannot have variable names longer than that. You may have variable labels that are longer?

Either way, all of this data can be queried from sashelp.vcolumn data set instead of PROC CONTENTS.
Tom
Super User Tom
Super User

@YKU wrote:

Hi 

 

I am building a data dictionary by SAS with proc contents statement. However, some variable name are extremely long, exceeded 50-100 characters with special symbols. The outcome of proc content has a limited length of 32. How do I extend the output column length? 

 

Thanks

Welkin


There is something wrong with the way you are describing your problem.  If you are running PROC CONTENTS on existing SAS datasets then the names of the variables (NAME) or dataset (MEMNAME) cannot exceed 32 bytes.  The LABEL (and MEMLABEL) attached to them can be up to 255 bytes.

 

Perhaps you mean you want to use SAS to query metadata about objects in some external database?  In that case you will need to find out what commands that database supports for getting that information out and what format it produces.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1375 views
  • 0 likes
  • 3 in conversation