DATA Step, Macro, Functions and more

propcase issu

Reply
Occasional Contributor
Posts: 15

propcase issu

Here attached the data step. just i want change to var a="New OTC Or Rx drug addedOr change to small or. how to change it

 


data exp;
a="New OTC Or Rx drug added";
b="New OTC or Rx drug added";
run; 

Super User
Posts: 9,870

Re: propcase issu

Use the tranwrd() function.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 36

Re: propcase issu

a=lowcase("New OTC Or Rx drug added");
Super User
Posts: 9,870

Re: propcase issu

Posted in reply to emrancaan

@emrancaan wrote:
a=lowcase("New OTC Or Rx drug added");

This changes all capitals to lowercase, which is not what the OP intended.

27         data exp;
28         a=lowcase("New OTC Or Rx drug added");
29         put a=;
30         run;

a=new otc or rx drug added
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 36

Re: propcase issu

Posted in reply to KurtBremser

I C he just wanted Or in small 

 

so

a=tranwrd("New OTC Or Rx drug added",'Or','or');
Ask a Question
Discussion stats
  • 4 replies
  • 92 views
  • 0 likes
  • 3 in conversation