<?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: how to remove extra character quotation marks in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736794#M28760</link>
    <description>&lt;P&gt;From the docu found &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/n1w749t788cgi2n1txpuccsuqtro.htm" target="_self"&gt;here:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1619310322388.png" style="width: 786px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58658i7B17294CAB7B6AF3/image-dimensions/786x50?v=v2" width="786" height="50" role="button" title="Patrick_0-1619310322388.png" alt="Patrick_0-1619310322388.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I probably would also add infile option&amp;nbsp;&lt;EM&gt;truncover&lt;/EM&gt; or &lt;EM&gt;missover&lt;/EM&gt;&amp;nbsp;and if this is more than an exercise would only use informats with a length specified (not just $).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;INFILE 'E:\SAS HW\Student_por.txt' dlm=';' firstobs=2 dsd truncover;&lt;/PRE&gt;</description>
    <pubDate>Sun, 25 Apr 2021 00:30:12 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-04-25T00:30:12Z</dc:date>
    <item>
      <title>how to remove extra character quotation marks</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736790#M28759</link>
      <description>&lt;P&gt;How do I remove extra character quotation marks that appear in the output of my sas code after I run it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TITLE 'Problem 2 (1)';&lt;/P&gt;&lt;P&gt;DATA Student_por;&lt;BR /&gt;INFILE 'E:\SAS HW\Student_por.txt' dlm=';' firstobs=2;&lt;BR /&gt;INPUT school $ sex $ age address $ famsize $ Pstatus $ Medu $ Fedu $ Mjob ~$12. Fjob ~$12. reason ~$14. guardian ~$10. traveltime studytime failures schoolsup $&lt;BR /&gt;famsup $ paid $ activities $ nursery $ higher $ internet $ romantic $ famrel $ freetime $ goout $ Dalc $ Walc $ health $ absences G1 $ G2 $ G3 $;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=Student_por (firstobs=630);&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All of the character values in this code have a single set of quotation marks except for school, which does not have any quotation marks. But, when I run this, all of the character values in the output receive an extra set of quotations (ex. ""F"" instead of just "F") and school receives one quotation at the beginning (ex. "MS instead of just MS). How do I fix this and keep my output formatted the same as the txt file?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2021 23:16:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736790#M28759</guid>
      <dc:creator>kariarchie</dc:creator>
      <dc:date>2021-04-24T23:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove extra character quotation marks</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736794#M28760</link>
      <description>&lt;P&gt;From the docu found &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/n1w749t788cgi2n1txpuccsuqtro.htm" target="_self"&gt;here:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1619310322388.png" style="width: 786px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58658i7B17294CAB7B6AF3/image-dimensions/786x50?v=v2" width="786" height="50" role="button" title="Patrick_0-1619310322388.png" alt="Patrick_0-1619310322388.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I probably would also add infile option&amp;nbsp;&lt;EM&gt;truncover&lt;/EM&gt; or &lt;EM&gt;missover&lt;/EM&gt;&amp;nbsp;and if this is more than an exercise would only use informats with a length specified (not just $).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;INFILE 'E:\SAS HW\Student_por.txt' dlm=';' firstobs=2 dsd truncover;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Apr 2021 00:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736794#M28760</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-04-25T00:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to remove extra character quotation marks</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736865#M28768</link>
      <description>&lt;P&gt;Quotes in a delimited file are just there in case the values of the fields contain the delimiter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the DSD option on the INFILE statement and SAS will automatically remove them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To insert an informat into your INPUT statement and NOT have it read exactly that number of characters use the : modifier, not the ~ modifier.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TITLE 'Problem 2 (1)';

DATA Student_por;
  INFILE 'E:\SAS HW\Student_por.txt' dlm=';' firstobs=2 dsd truncover;
  INPUT school $ sex $ age address $ famsize $ Pstatus $ Medu $ Fedu $
        Mjob :$12. Fjob :$12. reason :$14. guardian :$10. 
        traveltime studytime failures schoolsup $ famsup $ 
        paid $ activities $ nursery $ higher $ internet $ 
        romantic $ famrel $ freetime $ goout $ Dalc $ Walc $ 
        health $ absences G1 $ G2 $ G3 $
  ;
RUN;

PROC PRINT DATA=Student_por (firstobs=630);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You appear to be using the informats in your INPUT statement as a way to give SAS a hint that you would like the variable defined longer than the default 8 bytes for character variables.&amp;nbsp; &amp;nbsp;If you define the variables before hand you don't need to include the informat in this way.&amp;nbsp; In fact if you define the variables in the order that you want to read them then the INPUT statement can be trivially simple.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Student_por;
  INFILE 'E:\SAS HW\Student_por.txt' dlm=';' firstobs=2 dsd truncover;
  LENGTH school $8 sex $8 age 8 address $8 famsize $8 Pstatus $8 
        Medu $8 Fedu $8 Mjob $12 Fjob $12 reason $14 guardian $10
        traveltime 8 studytime 8 failures 8 schoolsup $8 famsup $8 
        paid $8 activities $8 nursery $8 higher $8 internet $8 
        romantic $8 famrel $8 freetime $8 goout $8 Dalc $8 Walc $8 
        health $8 absences 8 G1 $8 G2 $8 G3 $8
  ;
  INPUT school -- G3 ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 25 Apr 2021 16:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-remove-extra-character-quotation-marks/m-p/736865#M28768</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-25T16:14:04Z</dc:date>
    </item>
  </channel>
</rss>

