Hi, I am try to export sas data sets to csv file. I want to output all the value as characters in CSV as CSV may read number with dash as date. I search online and find one solution is add '=" to the value by using the following code. I encounter one problem that the following code can not be correctly performed when value in variables have comma inside. DATA test like the following. Name Counter Comments Em, H 6-8 Test, test, test proc template; define tagset Tagsets.test; parent=tagsets.csv; define event data; put ','/ if !cmp( COLSTART , "1" ); put '=' """" / if cmp( TYPE , "string" ); put VALUE; put """" / if cmp( TYPE , "string" ); end; end; run; ods markup file="test1.csv" tagset=tagsets.test; proc print data=test label noobs; run; ods markup close; However the problem is while value has comma the code doesn't work that well and misinterpret the start value. For example, name, 'Emily, Wintson' will export as two variables which is not. I try to replace comma to tab-delimited, "09"x in template, but it even didn't work to export correctly. I know tagset.excelxp can keep the format nicely, but the file turns out using XML file which may not be supported by every client. Or Is there any other way to auto output csv since I have multiple datasets. BYW, I am using SAS9.2
... View more