BookmarkSubscribeRSS Feed
Rakesh93
Fluorite | Level 6
While validating my dataset, it's showing Variable length is too long for actual data.
5 REPLIES 5
PGStats
Opal | Level 21

You can either create a new dataset with a LENGTH statement for your variable, or use the ALTER TABLE statement in PROC SQL with the MODIFY clause to change the variable length in your original table.

 

Example:

 

/* create example table */
data class; set sashelp.class; run;

/* Modify length of variable NAME */
proc sql;
alter table class 
modify name character(6);
quit;
PG
Rakesh93
Fluorite | Level 6
Pls tell me any macro available for trucation??
PaigeMiller
Diamond | Level 26

@Rakesh93 wrote:
Pls tell me any macro available for trucation??

 

Are you asking about macros because you have a lot of variables to truncate? If so, please explain further.

--
Paige Miller
PGStats
Opal | Level 21

No macro needed, please refer to edited message above.

PG

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3555 views
  • 1 like
  • 4 in conversation