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;
@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.
No macro needed, please refer to edited message above.
@Rakesh93 wrote:
Pls tell me any macro available for trucation??
No macro needed. Just run the code you were already given.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.