BookmarkSubscribeRSS Feed
kedar
Calcite | Level 5
%ds2csv - how to remove qouble quote from each field in output files
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
Cynthia_sas
SAS Super FREQ
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]
kedar
Calcite | Level 5
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?
Cynthia_sas
SAS Super FREQ
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
kedar
Calcite | Level 5
Thanks Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3438 views
  • 0 likes
  • 3 in conversation