Solved

SAS Character function - Question

Posted on 2012-03-31
1
394 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 500 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now