Solved

SAS Character function - Question

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Display multiple images in report 12 118
get most recent and second most recent date in SQL Server 24 90
Update in Sql 7 37
Download OAB 0x8004010f An object cannot be found 12 99
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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…

809 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