?
Solved

SAS Character function - Question

Posted on 2012-03-31
1
Medium Priority
?
449 Views
Last Modified: 2012-04-04
Hi all,

I have a question:

str1 = ('2011-01-02, 2011-01-03, 2011-01-04');


I wanted to convert the string to as below:

str2 = ('2011-01-02' , '2011-01-03' , '2011-01-04');


Can any please help!!

Thanks in advance.
0
Comment
Question by:aruku
1 Comment
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 2000 total points
ID: 37792429
Hi

I'll test this on Monday when I have access to SAS again, but have you tried the TRANWRD function?

Str2 = TRANWRD(Str1, ","  , " ',' ");

This should replace all the commas with commas in single quotes. You need to copy the code above to see where I've used single and double quotes...
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question