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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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