DATA Step, Macro, Functions and more

sas

Reply
Occasional Contributor
Posts: 10

sas

Hi

      I need to concatenate two varaibles is dataset. two variables are dose and doseu.

for example:

 

      dose    doseu

       20        ml

I want to create one variable by combining these two. And expecting the result like below. I need to add parentheses to the second variable.

 

newvariable

20 (ml).

 

Thanks

Rashmi.

Super User
Posts: 23,683

Re: sas

Posted in reply to rashmirao99

Try the CATT() function. 

 


rashmirao99 wrote:

Hi

      I need to concatenate two varaibles is dataset. two variables are dose and doseu.

for example:

 

      dose    doseu

       20        ml

I want to create one variable by combining these two. And expecting the result like below. I need to add parentheses to the second variable.

 

newvariable

20 (ml).

 

Thanks

Rashmi.


 

Super User
Posts: 6,754

Re: sas

Posted in reply to rashmirao99

One variation:

 

newvariable = catx( ' (', dose, doseu) || ')' ;

Ask a Question
Discussion stats
  • 2 replies
  • 76 views
  • 0 likes
  • 3 in conversation