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.

CFC_SAS_Communities_400x225.jpgCFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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