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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.