DATA Step, Macro, Functions and more

need to insert a space when joining two variables

Accepted Solution Solved
Reply
Regular Contributor
Posts: 180
Accepted Solution

need to insert a space when joining two variables

I just need a space!  But i'm not getting one Smiley Sad

 

_1=strip(put(mean, 8.1)) ||  " (" || strip(put(std, 10.2)) || ")");

 

so output should look like:  64.0 (11.00) .  But i'm getting 64.0(11.00)    

 

 

Thanks!


Accepted Solutions
Solution
‎11-30-2017 02:34 PM
Super User
Posts: 6,542

Re: need to insert a space when joining two variables

Well, it's not possible to test your code since it doesn't work.  But if you were to remove the extra closing parenthesis at the end, it gives the result you are asking for.

View solution in original post


All Replies
Solution
‎11-30-2017 02:34 PM
Super User
Posts: 6,542

Re: need to insert a space when joining two variables

Well, it's not possible to test your code since it doesn't work.  But if you were to remove the extra closing parenthesis at the end, it gives the result you are asking for.

Regular Contributor
Posts: 180

Re: need to insert a space when joining two variables

Posted in reply to Astounding
thx. i should have checked my log! i need more coffee.
Super User
Posts: 13,066

Re: need to insert a space when joining two variables

You should investigate the CAT, CATT, CATS and CATX functions as well. Then you don't need all the strip function calls

 

data example;
   mean= 64;
   std = 11;
   _1 = catx(' ',put(mean,8.1),cats('(',put(std,10.2),')') );
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 145 views
  • 1 like
  • 3 in conversation