The SAS Output Delivery System and reporting techniques

%ds2csv - how to remove qouble quote from each field

Reply
Occasional Contributor
Posts: 6

%ds2csv - how to remove qouble quote from each field

%ds2csv - how to remove qouble quote from each field in output files
Super Contributor
Super Contributor
Posts: 3,174

Re: %ds2csv - how to remove qouble quote from each field

Share your code that is contributing to the condition - also, did you review the available documentation? And, knowing your SAS version, OS platform, as well as contributing your code and possibly even a sample output row with the condition revealed would be most helpful.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument, this topic / post:

ds2csv site:sas.com
SAS Super FREQ
Posts: 8,743

Re: %ds2csv - how to remove qouble quote from each field

Hi:
Do you want to remove the quotes from EACH field or only from the numeric fields???

You might try using the ODS CSV method of creating a CSV file instead of %DS2CSV. It only quotes the character fields and leaves the numeric fields unquoted.

cynthia
[pre]
%ds2csv (data=sashelp.class, runmode=b, csvfile=c:\temp\ds_method.csv);

ods csv file='c:\temp\alt_method.csv';
proc print data=sashelp.class;
run;
ods csv close;
[/pre]
Occasional Contributor
Posts: 6

Re: %ds2csv - how to remove qouble quote from each field

Hi,

I want to remove quotes from EACH field.

I have input SAS table. I want to execute above code in mainframe. It will work?
SAS Super FREQ
Posts: 8,743

Re: %ds2csv - how to remove qouble quote from each field

ODS CSV will work on the mainframe (as long as you have SAS 8.2 or higher). The only difference is that the FILE= option would point to the mainframe file that you were creating, instead of a C drive location. However, unless your file is all numeric variables, it sounds like ODS CSV won't do what you want. When you use ODS CSV, character values are still quoted.

You may need to investigate writing a DATA step program where you write out the variable values to an external (sequential) file without any quotes.

cynthia
Occasional Contributor
Posts: 6

Re: %ds2csv - how to remove qouble quote from each field

Thanks Cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 762 views
  • 0 likes
  • 3 in conversation