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

Hi!

 

I need some help trouble shooting a little piece of my code.  I'm getting error, but not sure why...

 

I need the output to look like mean(std)  or  x.x(x.xx)  --

 

sord=2;
_1=cat(strip(put(mean, 8.1)), ' (' strip(put(std, 10.2))')');
output;

 

 

and second, the next output to look like Min,Max  x,x 

 

 sord = 4;
_1=cat(strip(put(MIN,8.)),", "(put(MAX,8.)));
output;

 

I'm getting syntax errors an probably missing a parenthesis somewhere...but please help!  thx!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

If it's parenthesis, count them. 

I think you're missing comma's actually - put each item on it's own line to see this, with the comma at the front of the item.

 

Use CATT or CATS instead of CAT.

 

_1=cat(
    strip(put(mean, 8.1))
, ' (' 

<MISSING COMMA HERE>

strip(put(std, 10.2))
<MISSING COMMA HERE>

')'

);

 

 

View solution in original post

2 REPLIES 2
Reeza
Super User

If it's parenthesis, count them. 

I think you're missing comma's actually - put each item on it's own line to see this, with the comma at the front of the item.

 

Use CATT or CATS instead of CAT.

 

_1=cat(
    strip(put(mean, 8.1))
, ' (' 

<MISSING COMMA HERE>

strip(put(std, 10.2))
<MISSING COMMA HERE>

')'

);

 

 

jenim514
Pyrite | Level 9
thank you!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 692 views
  • 0 likes
  • 2 in conversation