<?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: Remove single quote before to import data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829655#M35552</link>
    <description>&lt;P&gt;You need to explain how you want to parse those lines.&lt;/P&gt;
&lt;P&gt;Your header line makes it look like there are 8 values per line.&lt;/P&gt;
&lt;P&gt;If I just use the semicolon as delimiters with the DSD option then the field with only the single quote looks like it is ending the quoted value started by the earlier field that started with a single quote.&amp;nbsp; So there are only 5 values on the line, not 8.&lt;/P&gt;
&lt;PRE&gt;1 MVTO TECNICO
2 '10011722000507
3 '10011722000507;1;5;'
4 '100000926018
5 10&lt;/PRE&gt;
&lt;P&gt;But if you read it without the DSD option then SAS will treat it as 8 fields.&lt;/P&gt;
&lt;P&gt;First let's create a file with the lines you posted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ssv temp;
options parmcards=ssv;
parcards4;
TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's read it with a simple data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile ssv dlm=';' truncover firstobs=2;
  input TIPO_MVTO :$20. NUM_SINI_TRON :$20. NUM_SINI :$20. 
        NUM_EXP NUM_MVTO_ECO 
        NUM_APOLICE_TRON :$20. NUM_APOLICE :$20. NUM_ENDOSSO 
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1661174239062.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74571i7C8A131522E2D7D2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1661174239062.png" alt="Tom_0-1661174239062.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the lines are shorter than 32,767 bytes you can modify the _INFILE_ variable to remove the single quotes.&amp;nbsp; Then you could use the DSD option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile ssv dsd dlm=';' truncover firstobs=2;
  input @;
  _infile_=compress(_infile_,"'");
  input TIPO_MVTO :$20. NUM_SINI_TRON :$20. NUM_SINI :$20. 
        NUM_EXP NUM_MVTO_ECO 
        NUM_APOLICE_TRON :$20. NUM_APOLICE :$20. NUM_ENDOSSO 
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1661174383126.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74572i6631D5C1EF8AA921/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_1-1661174383126.png" alt="Tom_1-1661174383126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 13:19:54 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-08-22T13:19:54Z</dc:date>
    <item>
      <title>Remove single quote before to import data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829648#M35550</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having problems to import a file with single quotes, can i remove that character before to import?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;follow data&lt;BR /&gt;&lt;BR /&gt;TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO&lt;BR /&gt;MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10&lt;BR /&gt;MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 13:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829648#M35550</guid>
      <dc:creator>ropjunior</dc:creator>
      <dc:date>2022-08-22T13:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Remove single quote before to import data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829655#M35552</link>
      <description>&lt;P&gt;You need to explain how you want to parse those lines.&lt;/P&gt;
&lt;P&gt;Your header line makes it look like there are 8 values per line.&lt;/P&gt;
&lt;P&gt;If I just use the semicolon as delimiters with the DSD option then the field with only the single quote looks like it is ending the quoted value started by the earlier field that started with a single quote.&amp;nbsp; So there are only 5 values on the line, not 8.&lt;/P&gt;
&lt;PRE&gt;1 MVTO TECNICO
2 '10011722000507
3 '10011722000507;1;5;'
4 '100000926018
5 10&lt;/PRE&gt;
&lt;P&gt;But if you read it without the DSD option then SAS will treat it as 8 fields.&lt;/P&gt;
&lt;P&gt;First let's create a file with the lines you posted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename ssv temp;
options parmcards=ssv;
parcards4;
TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now let's read it with a simple data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile ssv dlm=';' truncover firstobs=2;
  input TIPO_MVTO :$20. NUM_SINI_TRON :$20. NUM_SINI :$20. 
        NUM_EXP NUM_MVTO_ECO 
        NUM_APOLICE_TRON :$20. NUM_APOLICE :$20. NUM_ENDOSSO 
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1661174239062.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74571i7C8A131522E2D7D2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1661174239062.png" alt="Tom_0-1661174239062.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the lines are shorter than 32,767 bytes you can modify the _INFILE_ variable to remove the single quotes.&amp;nbsp; Then you could use the DSD option.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile ssv dsd dlm=';' truncover firstobs=2;
  input @;
  _infile_=compress(_infile_,"'");
  input TIPO_MVTO :$20. NUM_SINI_TRON :$20. NUM_SINI :$20. 
        NUM_EXP NUM_MVTO_ECO 
        NUM_APOLICE_TRON :$20. NUM_APOLICE :$20. NUM_ENDOSSO 
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_1-1661174383126.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74572i6631D5C1EF8AA921/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_1-1661174383126.png" alt="Tom_1-1661174383126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 13:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829655#M35552</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-22T13:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: Remove single quote before to import data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829668#M35555</link>
      <description>&lt;P&gt;Thank You so much&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 14:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-single-quote-before-to-import-data/m-p/829668#M35555</guid>
      <dc:creator>ropjunior</dc:creator>
      <dc:date>2022-08-22T14:27:00Z</dc:date>
    </item>
  </channel>
</rss>

