BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jen123
Fluorite | Level 6
Hi,

I have 3 columns in a dataset I would like to combine into one column. I used the CONCATENATE function, but kept getting an error that "CONCATENATE REQUIRES CHARACTER OPERANDS". Below is part of the error log. Any advice regarding line 15?
Thanks!

***********************

/* Concatenate */
15 (Name=Event_Month || Operators || Queue_Name) AS Concatenate
16 FROM WORK._2011_05_11_COMBINED_NCL_BY_QUEU AS t1
17 GROUP BY t1.Site, t1.Event_Month, t1.OPERATORS, t1.QUEUE_NAME, (CALCULATED Concatenate);
ERROR: Concatenation (||) requires character operands.
ERROR: The following columns were not found in the contributing tables: Name.
1 ACCEPTED SOLUTION

Accepted Solutions
DBailey
Lapis Lazuli | Level 10
What format do you want the event_month to be in your concatenated string? Just put that in the put command.

put(event_month,yymmdd8.)||operators||queue_name

View solution in original post

5 REPLIES 5
DBailey
Lapis Lazuli | Level 10
I'm presuming event_month is a numeric variable. You'll need to use the put command to convert it to character as in
put(event_month,z2.0)||operators||queue_name
jen123
Fluorite | Level 6
THanks for the help! I am a brand new user...with very little programming background.

Event_month is Date9.

I used your code below and the results are the name of the operators and queue name....no event month.

Thanks again!
DBailey
Lapis Lazuli | Level 10
What format do you want the event_month to be in your concatenated string? Just put that in the put command.

put(event_month,yymmdd8.)||operators||queue_name
jen123
Fluorite | Level 6
That worked! Thanks very much.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Also, you may want to consider the CAT functions (there are several) depending on the desired result (SAS behavior, such as automatic trim) - CATT, CATS, CATX.

Scott Barry
SBBWorks, Inc.

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

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
  • 26207 views
  • 2 likes
  • 3 in conversation