Hi All,
When I export my sas dataset to csv file. I notice that for character variable containing Address string automatically comes up with double quotes. While some records have quotes rest of the addresses don't have quotes.
For example:
address
" Unit 4, 103 apartment name"
2/3 some road name
I want the addresses without quotes. I use Export procedure to get the dataset into CSV file. I wonder if there is any way , i can avoid getting quotes in CSV file.
Just to be clearer my sas dataset doesn't contain single or double quotes.
Thanks,
Look at that address. It has a comma embedded, so if you export it like that to a CSV, how do you know where the delimiter is?
That row will have an extra comma which will cause all kinds of issues, so the convention is to add quotes and the comma in the quotes is ignored. Don't remove them.
If you really, really want to, you can use PUT statements instead which allows you to control it explicitly.
@sas_learnsups wrote:
Hi All,
When I export my sas dataset to csv file. I notice that for character variable containing Address string automatically comes up with double quotes. While some records have quotes rest of the addresses don't have quotes.
For example:
address
" Unit 4, 103 apartment name"
2/3 some road name
I want the addresses without quotes. I use Export procedure to get the dataset into CSV file. I wonder if there is any way , i can avoid getting quotes in CSV file.
Just to be clearer my sas dataset doesn't contain single or double quotes.
Thanks,
Look at that address. It has a comma embedded, so if you export it like that to a CSV, how do you know where the delimiter is?
That row will have an extra comma which will cause all kinds of issues, so the convention is to add quotes and the comma in the quotes is ignored. Don't remove them.
If you really, really want to, you can use PUT statements instead which allows you to control it explicitly.
@sas_learnsups wrote:
Hi All,
When I export my sas dataset to csv file. I notice that for character variable containing Address string automatically comes up with double quotes. While some records have quotes rest of the addresses don't have quotes.
For example:
address
" Unit 4, 103 apartment name"
2/3 some road name
I want the addresses without quotes. I use Export procedure to get the dataset into CSV file. I wonder if there is any way , i can avoid getting quotes in CSV file.
Just to be clearer my sas dataset doesn't contain single or double quotes.
Thanks,
Function dequote() does what you want.
But as said above, what you want is not what you need.
@sas_learnsups Sir/Madam, It would be more encouraging if you could rather mark @Reeza as the accepted solution for the very intuitive detailed reasoning. We then community(you included) feel encouraged with such responses to delve more and more with interesting responses. Just a thought. Sorry for the bother. Thank you!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.