<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Hi.proc export giving additional quotes to quoted character fields. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927051#M364858</link>
    <description>&lt;P&gt;Agree!!I am also getting the result what you have given like " " but the requirement is if its character then "" and if its numeric ,, Now space is coming for characters i mean " ".&lt;/P&gt;&lt;P&gt;the only difference is to distinguish which one is char and which one is numeric by seeing the file.&lt;/P&gt;&lt;P&gt;if it is ,, for all missing then we don't know the data types but if we give quotes then it is char missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem is now is " "; How to remove this space while using ~modifier.&lt;/P&gt;&lt;P&gt;if i use if then to remove the blank space inside the quote, then it is not giving me the quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 04 May 2024 20:11:01 GMT</pubDate>
    <dc:creator>Puspita_1</dc:creator>
    <dc:date>2024-05-04T20:11:01Z</dc:date>
    <item>
      <title>Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926975#M364823</link>
      <description>Proc export giving additional quotes to the quoted char values.and if u use data step for that it is giving a space or . To numeric values which is not required . Needs to change nothing.now it is , , but want ,, no space no .for missing numeric value.</description>
      <pubDate>Sat, 04 May 2024 03:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926975#M364823</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T03:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926978#M364824</link>
      <description>Please reply if anyone came across this</description>
      <pubDate>Sat, 04 May 2024 03:47:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926978#M364824</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T03:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926982#M364828</link>
      <description>&lt;P&gt;Please provide a fully working code sample (sample data included) that allows us to replicate what you describe (=run in our environment) and explain/show the desired result.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 09:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926982#M364828</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-04T09:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926989#M364831</link>
      <description>On Sat, 4 May 2024 at 3:57 PM, Puspita Padhi&lt;BR /&gt;wrote:&lt;BR /&gt;</description>
      <pubDate>Sat, 04 May 2024 10:29:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/926989#M364831</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T10:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927000#M364836</link>
      <description>&lt;P&gt;As a bare minimum share the code that generated the output.&lt;/P&gt;
&lt;P&gt;Better to show the log with the code and any notes or messages.&lt;/P&gt;
&lt;P&gt;Best is to include example data, before export an after export.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;/&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that depending on the file name created the tools that open the output may change the appearance of values. Example CSV files opened in spreadsheet software make many assumptions about what is "intended" with some unusual output.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 11:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927000#M364836</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-04T11:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927005#M364838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the output from proc export.&lt;/P&gt;&lt;P&gt;here extra quotes are coming.for character only one set of double quotes needed.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Puspita_1_0-1714825022815.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96176i07400DB17AB0A909/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Puspita_1_0-1714825022815.png" alt="Puspita_1_0-1714825022815.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;when you do this with datastep for numeric columns having missing value is diplaying . so to change that converted blank .but needed is ,, not , ,.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Puspita_1_1-1714825030795.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/96177i054D1EED89ECEC45/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Puspita_1_1-1714825030795.png" alt="Puspita_1_1-1714825030795.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for numeric columns if it is missing value it should be ,, now it is , ,.&lt;/P&gt;&lt;P&gt;filename TRAI 'exe.csv';&lt;BR /&gt;PROC EXPORT data = work.ext_accounts&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTFILE =TRAI&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbms=csv&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select name into :namelist separated by ','&amp;nbsp;&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where upcase(libname)="WORK" and upcase(memname)="EXT_ACCOUNTS";&lt;BR /&gt;quit;&lt;BR /&gt;%put "&amp;amp;namelist.";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;options missing='';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;option noquotelenmax;&lt;BR /&gt;data _null_;&lt;BR /&gt;set ext_accounts;&lt;BR /&gt;original_balance=strip(original_balance);&lt;BR /&gt;file&amp;nbsp; "E:\exe.csv" dlm=',';&lt;BR /&gt;if _n_=1 then put "&amp;amp;namelist.";&lt;BR /&gt;put (_all_)(+0);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 12:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927005#M364838</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T12:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927013#M364845</link>
      <description>&lt;P&gt;The photograph you shared of the PROC EXPORT result looks correct to me.&amp;nbsp; If the value being written to the CSV file has a comma in it then the value needs be quoted so the file can be parsed.&amp;nbsp; So quotes around a value are NOT part of the value.&amp;nbsp; So any value actually does contain a quote that value needs to be quoted also so that the quotes are not removed when the CSV file is read back in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The reason the photography you shared of the second text file has spaces for empty values is because you did NOT use the DSD option on the FILE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the values of your character variables have quotes around them that you do not want to write into the CSV file then perhaps you should first remove those?&amp;nbsp; You can use the DEQUOTE() function to do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If for some reason you want to add extra (ie unneeded) quotes around the values of some variables then use the ~ modifier in the PUT statement for those variables.&amp;nbsp; See this other recent thread:&amp;nbsp;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Programming/How-to-keep-char-format-when-export-data-to-csv/m-p/927011/highlight/true#M364844" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/How-to-keep-char-format-when-export-data-to-csv/m-p/927011/highlight/true#M364844&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 13:34:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927013#M364845</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-04T13:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927028#M364852</link>
      <description>&lt;P&gt;hi for the 2nd statement if I use dsd then again 3 quotes are coming for data step.&lt;/P&gt;&lt;P&gt;what is the other way not to display the space&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 15:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927028#M364852</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T15:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927031#M364854</link>
      <description>&lt;P&gt;but yes, if you use DSD the space is not coming&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 15:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927031#M364854</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T15:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927038#M364855</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427506"&gt;@Puspita_1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hi for the 2nd statement if I use dsd then again 3 quotes are coming for data step.&lt;/P&gt;
&lt;P&gt;what is the other way not to display the space&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why did you add quotes around the values if you did not want them to be part of the value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Share an example of your data to get help writing a CSV file from it.&amp;nbsp; It does not need to be your real data, just enough to demonstrate the issue.&amp;nbsp; To share your data please post TEXT of the data.&amp;nbsp; Preferable as a data step that creates the data.&amp;nbsp; Make sure to use the Insert SAS Code button in the menu bar so you get a pop-up window to paste/edit the text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile cards dsd truncover;
  input name :$30. test_date :date. score ;
  format test_date date9.;
cards;
Bob,02APR2024,85
Susan,03MAR2023,100
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So a normal CSV file created from that dataset would look like this:&lt;/P&gt;
&lt;PRE&gt;name,test_date,score
Bob,02APR2024,85
Susan,03MAR2023,100&lt;/PRE&gt;
&lt;P&gt;What do you want that is different than that?&amp;nbsp; Why do you want something different? Are you transferring the data to some other software? What software? What options did you use to read the CSV file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 16:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927038#M364855</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-04T16:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927043#M364856</link>
      <description>&lt;P&gt;so for the above data set i want like this character data should be quoted&amp;nbsp; "" and numeric no quotes.&lt;/P&gt;&lt;P&gt;for missing value for character "" and for numeric ,, no space no dots.Thank you&lt;/P&gt;&lt;PRE&gt;name,test_date,score
"Bob","02APR2024",85
"Susan","03MAR2023",100&lt;BR /&gt;"Puspita","",,&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 18:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927043#M364856</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T18:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927050#M364857</link>
      <description>&lt;P&gt;But WHY???&amp;nbsp; What is the point of adding the quotes that are not necessary?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lets read in your example as two character and one numeric variable.&amp;nbsp; The code might look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile 'myfile.csv' dsd truncover firstobs=2;
  input name :$10. test_date :$9. score ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;Obs    name       test_date    score

 1     Bob        02APR2024      85
 2     Susan      03MAR2023     100
 3     Puspita                    .

&lt;/PRE&gt;
&lt;P&gt;If we write that as a CSV file but add the ~ modifier after the character variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename csv temp;
proc transpose data=have(obs=0) out=names;
  var _all_;
run;

data _null_;
  file csv dsd ;
  set names;
  put _name_ @ ;
run;

data _null_;
  file csv dsd mod ;
  set have;
  put name ~ test_date ~ score;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;We get&lt;/P&gt;
&lt;PRE&gt;name,test_date,score
"Bob","02APR2024",85
"Susan","03MAR2023",100
"Puspita"," ",
&lt;/PRE&gt;
&lt;P&gt;The only difference seems to be that empty strings are represents as a quoted single space.&amp;nbsp; But since there isn't really any different between a string that is only spaces and an empty one (definitely in SAS and also it most other normal applications) then that should be good enough.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try using ODS CSV.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods csv file=csv;
options missing=' ';
proc print data=have noobs;
run;
options missing='.';
ods csv close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will add quotes around the character variables.&amp;nbsp; It will also represent the missing character value as a null string instead either a quoted space or two quotes with nothing between them.&lt;/P&gt;
&lt;PRE&gt;"name","test_date","score"
"Bob","02APR2024",85
"Susan","03MAR2023",100
"Puspita",,
&lt;/PRE&gt;
&lt;P&gt;Again what is the difference between a empty value and a value that is two quotes with nothing between them?&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 19:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927050#M364857</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-04T19:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927051#M364858</link>
      <description>&lt;P&gt;Agree!!I am also getting the result what you have given like " " but the requirement is if its character then "" and if its numeric ,, Now space is coming for characters i mean " ".&lt;/P&gt;&lt;P&gt;the only difference is to distinguish which one is char and which one is numeric by seeing the file.&lt;/P&gt;&lt;P&gt;if it is ,, for all missing then we don't know the data types but if we give quotes then it is char missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only problem is now is " "; How to remove this space while using ~modifier.&lt;/P&gt;&lt;P&gt;if i use if then to remove the blank space inside the quote, then it is not giving me the quotes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 20:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927051#M364858</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-04T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927056#M364859</link>
      <description>&lt;P&gt;Hi Is that possible to remove the space by using any other approach.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 00:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927056#M364859</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-05T00:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927066#M364865</link>
      <description>&lt;P&gt;But you still haven't said why it makes any difference.&amp;nbsp; Are you using some poorly designed internal program to read the CSV files? Can't you just fix that program?&amp;nbsp; Or are you using some commercial program to read the CSV file?&amp;nbsp; If so let us know so what program.&amp;nbsp; Perhaps there is an option in that program to read a NORMAL csv file.&amp;nbsp; Or if nothing else so we know to avoid using that program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the time it takes to make the file matter?&amp;nbsp; If not the just write each variable independently so that you can test if it is empty and write something different in those cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set have;
  file csv dsd ;
  if missing(name) then put '"",' @; else put name ~ @;
  if missing(test_date) then put '"",' @; else put test_date ~ @;
  put score @;
  put ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;"Bob","02APR2024",85
"Susan","03MAR2023",100
"Puspita","",
&lt;/PRE&gt;
&lt;P&gt;Note if the character variable is the last on the line then do not include the comma in the alternative text to be written.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 03:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927066#M364865</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-05T03:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927069#M364867</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427506"&gt;@Puspita_1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Is that possible to remove the space by using any other approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your required csv format is a bit unusual which is why I assume there isn't anything ready-made available. Using SAS you can always write your own code to exactly get what you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class;
  length row_num 8;
  set sashelp.class;
  if _n_=2 then call missing(of _all_);
  if _n_=3 then call missing(name, height);
  format height 16.4;
  row_num=_n_;
run;

%macro MyDs2csv(
  inds=,
  outfile=,
  header=Y
  );
  filename codegen temp;
  data _null_;
    stop;
    file codegen;
  run;

  %local lib ds;
  %let lib=%upcase(%scan(work.&amp;amp;inds,-2));
  %let ds =%upcase(%scan(work.&amp;amp;inds,-1));

  /* generate code */

  %if %sysfunc(substr(%upcase(&amp;amp;header),1,1))=Y %then
    %do;
      data _null_;
        file codegen mod;
        set sashelp.vcolumn(where=(libname="&amp;amp;lib" and memname="&amp;amp;ds")) end=last;
        if _n_=1 then put 'if _n_=1 then do;';
        put "put '" name @;
        if not last then put +(-1) ",' @;" ;
        else put +(-1) "';" / "end;";
      run;
    %end;

  data _null_;
    file codegen mod;
    set sashelp.vcolumn(where=(libname="&amp;amp;lib" and memname="&amp;amp;ds")) end=last;
    retain hold '@';
    if type='char' then
      do;
        put 'if not missing(' name +(-1) ') then put ''"'' ' name '+(-1) ''"'' ' hold ';' 'else put ''""'' ' hold ';' ;
      end;
    else
      do;
        put 'if not missing(' name +(-1) ') then put ' name '+(-1) ' hold ';' ;
      end;
    if not last then put "put ',' @;";
    else put "put;";
  run;

  /* execute generated code */
  data _null_;
    file "&amp;amp;outfile";
    set &amp;amp;inds;
    %include codegen /source2;
  run;
  filename codegen clear;
%mend;

%MyDs2csv(inds=work.class,outfile=c:\temp\test.csv);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 May 2024 06:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/927069#M364867</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-05-05T06:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928100#M365178</link>
      <description>&lt;P&gt;this is when type=char but this is not applying when date is ddmmyy10. format and character date fileld.what will be the solution for this&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 10:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928100#M365178</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-13T10:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928103#M365179</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427506"&gt;@Puspita_1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;this is when type=char but this is not applying when date is ddmmyy10. format and character date fileld.what will be the solution for this&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What solution did you have in mind?&amp;nbsp; Do you want the unneeded quotes around all DATE values also?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are trying to automate something then you can use the FMTINFO() to find the category of format that is attached to a variable.&amp;nbsp; Then you could generate the extra quotes for both character and date variables, but not for other numeric variables.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 11:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928103#M365179</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-05-13T11:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928481#M365298</link>
      <description>&lt;P&gt;While executing the macro the error comes like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;WARNING: Apparent invocation of macro SYSFUNCT not resolved.&lt;BR /&gt;ERROR: Required operator not found in expression:&amp;nbsp; ne 1&amp;nbsp;&lt;BR /&gt;ERROR: The macro PERFEND will stop executing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Specially for this macro.PERFEND.the macro is executing multiple times and at last this msg pops up.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 14:23:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928481#M365298</guid>
      <dc:creator>Puspita_1</dc:creator>
      <dc:date>2024-05-15T14:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Hi.proc export giving additional quotes to quoted character fields.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928483#M365299</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/427506"&gt;@Puspita_1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;While executing the macro the error comes like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;WARNING: Apparent invocation of macro SYSFUNCT not resolved.&lt;BR /&gt;ERROR: Required operator not found in expression:&amp;nbsp; ne 1&amp;nbsp;&lt;BR /&gt;ERROR: The macro PERFEND will stop executing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Specially for this macro.PERFEND.the macro is executing multiple times and at last this msg pops up.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That warning most likely means there is a typo of %SYSFUNCT instead of %SYSFUNC somewhere in the code.&lt;/P&gt;
&lt;P&gt;Fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The %syfunc did not execute and anything relying on the result will not have the expected input.&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 14:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Hi-proc-export-giving-additional-quotes-to-quoted-character/m-p/928483#M365299</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-15T14:34:57Z</dc:date>
    </item>
  </channel>
</rss>

