BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Konkordanz
Pyrite | Level 9

Hi,

 

with SQL I want to create a new table from another and want to add a emtpy character-column. That works. But: The length is only 1 and only the first letter appears. Question: Does the sql-step has the option to define the length? For example like that (doesnt work):

 

proc sql;
create table test as select 
"" char(20) as GKL2,sum(bev) as bev 
from XY;
quit;

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Konkordanz,

 

Replace char(20) with length=20 and it will work. You can also put the length specification after the variable name and either way length 20 works as well.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @Konkordanz,

 

Replace char(20) with length=20 and it will work. You can also put the length specification after the variable name and either way length 20 works as well.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 817 views
  • 1 like
  • 2 in conversation