<?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: re: Importing Text file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230744#M41898</link>
    <description>&lt;P&gt;Hi PaigeMiller......I did give the DEQUOTE function a try.....it did remove the double quotation marks but it remove part of the product name....for the example I had submitted.....the product name ended up being New Era Combination&lt;/P&gt;</description>
    <pubDate>Tue, 20 Oct 2015 14:08:47 GMT</pubDate>
    <dc:creator>twildone</dc:creator>
    <dc:date>2015-10-20T14:08:47Z</dc:date>
    <item>
      <title>re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230730#M41894</link>
      <description>&lt;P&gt;Hi....I am trying to import a text file containg product names where the delimiter is a comma and Text Qualifier is the double quotation mark. Whenever the product name has double quotation marks inside the the actual product name, the Text Qualifer remains around the product name in the dataset. Here is an example what I get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"New Era Combination "A" Biochemic Tissue Salts"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would like to have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New Era Combination "A" Biochemic Tissue Salts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an option that need to include to allows this? Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 13:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230730#M41894</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-10-20T13:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230734#M41895</link>
      <description>&lt;P&gt;In a SAS data step, use the DEQUOTE function&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 13:41:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230734#M41895</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-20T13:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230744#M41898</link>
      <description>&lt;P&gt;Hi PaigeMiller......I did give the DEQUOTE function a try.....it did remove the double quotation marks but it remove part of the product name....for the example I had submitted.....the product name ended up being New Era Combination&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230744#M41898</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-10-20T14:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230756#M41900</link>
      <description>&lt;P&gt;Please be specific. What is the exact code that you tried? What is the result that isn't what you want?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 14:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230756#M41900</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2015-10-20T14:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230760#M41902</link>
      <description>&lt;P&gt;Hi, in lieu if trying the QUOTE informat or DEQUOTE function, you could try ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile datalines dsd;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input x stuff :$50. y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;stuff = substr(stuff,2,length(stuff)-2);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;34,"New Era Combination "A" Biochemic Tissue Salts",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;35,"Old Era "B"&amp;nbsp;Biochemic Tissue Peppers",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;data set X ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stuff&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34&amp;nbsp;&amp;nbsp;&amp;nbsp; New Era Combination "A" Biochemic Tissue Salts&amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 35&amp;nbsp;&amp;nbsp;&amp;nbsp; Old Era "B"&amp;nbsp;Biochemic Tissue Peppers&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; 99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ps&amp;nbsp; In looking at DEQUOTE in online help, there are&amp;nbsp;no examples of what happens with double quote within double quotes.&amp;nbsp; If you try this, DEQUOTE did nothing to the&amp;nbsp;input record ...&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;z = dequote(_infile_);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;34,"New Era Combination "A" Biochemic Tissue Salts",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;35,"Old Era "B"&amp;nbsp; Biochemic Tissue Peppers",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs&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;&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;&amp;nbsp; z&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 34,"New Era Combination "A" Biochemic Tissue Salts",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 35,"Old Era "B"&amp;nbsp; Biochemic Tissue Peppers",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 15:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230760#M41902</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-20T15:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230943#M41960</link>
      <description>&lt;P&gt;Hi MikeZdeb.....Thanks for your help and suggestions. I did try it but it wouldn't work for me. But I did figure out a way to get what I wanted although maybe not the most efficeint way to achieve the end results. Here is what I ended up doing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA PRODUCTS2;&lt;BR /&gt;&amp;nbsp;SET Products;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;NAME1 = SUBSTR(PRODUCT_NAME,1,1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;NAME2 = SUBSTR(PRODUCT_NAME,2,LENGTH(PRODUCT_NAME)-1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;NAME3 = SUBSTR(PRODUCT_NAME,1,LENGTH(PRODUCT_NAME)-1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;NAME4 = SUBSTRN(PRODUCT_NAME,MAX(1,LENGTH(PRODUCT_NAME)-0),1);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;NAME5 = SUBSTR(NAME2,1,LENGTH(NAME2)-1);&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;DATA PRODUCTS3; &lt;BR /&gt;&amp;nbsp;SET PRODUCTS2;&lt;/P&gt;
&lt;P&gt;IF NAME1 ^= '"' AND NAME4 = '"' THEN&lt;BR /&gt;&amp;nbsp;NEW_NAME = STRIP(NAME3)||STRIP(NAME4);&lt;BR /&gt;ELSE IF NAME1 = '"' AND NAME4 ^= '"' THEN&lt;BR /&gt;&amp;nbsp;NEW_NAME = STRIP(NAME1)||STRIP(NAME2);&lt;BR /&gt;ELSE IF NAME1 = '"' AND NAME4 = '"' THEN&lt;BR /&gt;&amp;nbsp;NEW_NAME = STRIP(NAME5);&lt;BR /&gt;ELSE IF NAME1 ^= '"' AND NAME4 ^= '"' THEN&lt;BR /&gt;&amp;nbsp;NEW_NAME = PRODUCT_NAME;&lt;BR /&gt;ELSE NEW_NAME = ' ';&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 14:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230943#M41960</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-10-21T14:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230987#M41970</link>
      <description>&lt;P&gt;Hi, curious, what did not work? &amp;nbsp;Here's a data step with your variable names and the output ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data products;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;infile datalines dsd;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;input x product_name :$50. y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;product_name = substr(product_name,2,length(product_name)-2);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;34,"New Era Combination "A" Biochemic Tissue Salts",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;35,"Old Era "B" Biochemic Tissue Peppers",99&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs product_name &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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 &amp;nbsp; New Era Combination "A" Biochemic Tissue Salts&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 2 &amp;nbsp; Old Era "B" Biochemic Tissue Peppers &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN style="line-height: normal;"&gt;Using that same data and your method I get ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NEW_NAME&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 &amp;nbsp; New Era Combination "A" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 2 &amp;nbsp; Old Era "B" Biochemic Tissue Peppers&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks the same to me. &amp;nbsp;Can you give me some examples where my method did not work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I&amp;nbsp;rewrote some of your code so you can see that you can use CAT functions ... and, these&amp;nbsp;statements ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NEW_NAME = STRIP(NAME3)||STRIP(NAME4);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NEW_NAME = STRIP(NAME5);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;are the same as ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NEW_NAME = STRIP(NAME3)||NAME4;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;NEW_NAME =&amp;nbsp;NAME5;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;since the trailing blanks on NAME4 and on NAME5 are still there in the new variable NEW_NAME. &amp;nbsp;If NEW_NAME has a length of 50, then the missing portion of the value is always padded on the right with blanks. &amp;nbsp;Your statements are trying to give NEW_NAME a different length for different observations, not possible.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;CAT functions (and two data steps combined into one) ...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="line-height: normal; font-family: 'courier new', courier;"&gt;data products2;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;length new_name $50.;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set products;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;name1 = substr(product_name,1,1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;name2 = substr(product_name,2,length(product_name)-1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;name3 = substr(product_name,1,length(product_name)-1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;name4 = substrn(product_name,max(1,length(product_name)-0),1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;name5 = substr(name2,1,length(name2)-1);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if name1 ^= '"' and name4 = '"' &amp;nbsp;then new_name = cats(name3,name4);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;else &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if name1 = '"' and name4 ^= '"'&amp;nbsp;&amp;nbsp;then new_name = cats(name1,name2);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if name1 = '"' and name4 = '"' &amp;nbsp; then new_name = name5;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;else &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if name1 ^= '"' and name4 ^= '"' then new_name = product_name;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;else call missing(new_name);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 15:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/230987#M41970</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-21T15:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231002#M41974</link>
      <description>&lt;P&gt;Hi MikeZdeb.....When I tried and ran your code, it actually did remove the double quoatation marks that were the first and last character but it also removed the first and last digit/letter to those product names that were not in double quotation marks. Here is the data step that I used and the output that I did get;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA PRODUCTS;&lt;BR /&gt;&amp;nbsp;SET Products;&lt;BR /&gt;new_name = substr(product_name,2,length(product_name)-2);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PRODUCT_NAME&amp;nbsp;new_name&lt;BR /&gt;Red Bull Energy Drink&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;&amp;nbsp;&amp;nbsp; ed Bull Energy Drin&lt;BR /&gt;Vitamin D 400 Iu&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;itamin D 400 I&lt;BR /&gt;Echinacea And Goldenseal&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chinacea And Goldensea&lt;BR /&gt;Flax Seed Oil 1000 Mg&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; lax Seed Oil 1000 M&lt;BR /&gt;Vitamin D&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itamin&lt;BR /&gt;Allicin Rich Garlic&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; llicin Rich Garli&lt;BR /&gt;Glucosamine Sulfate&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; lucosamine Sulfat&lt;BR /&gt;Vitamin C&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itamin&lt;BR /&gt;Glucosamine Chondroitin Complex&amp;nbsp;lucosamine Chondroitin Comple&lt;BR /&gt;Vitamin B6&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itamin B&lt;BR /&gt;Vitamin B2&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itamin B&lt;BR /&gt;Vitamin C Timed Release&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;itamin C Timed Releas&lt;BR /&gt;Vitamin C 1000 Mg Timed Release&amp;nbsp;itamin C 1000 Mg Timed Releas&lt;BR /&gt;Milk Thistle&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; ilk Thistl&lt;BR /&gt;Now Wheat Germ Oil Softgels&amp;nbsp;&amp;nbsp;&amp;nbsp; ow Wheat Germ Oil Softgel&lt;BR /&gt;"New Era Combination "S" Biochemic Tissue Salts"&amp;nbsp;New Era Combination "S" Biochemic Tissue Salts&lt;BR /&gt;"New Era Combination "I" Biochemic Tissue Salts"&amp;nbsp;New Era Combination "I" Biochemic Tissue Salts&lt;BR /&gt;"New Era Combination "J" Biochemic Tissue Salts"&amp;nbsp;New Era Combination "J" Biochemic Tissue Salts&lt;BR /&gt;"New Era Combination "K" Biochemic Tissue Salts"&amp;nbsp;New Era Combination "K" Biochemic Tissue Salts&lt;BR /&gt;"New Era Combination "L" Biochemic Tissue Salts"&amp;nbsp;New Era Combination "L" Biochemic Tissue Salts&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 17:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231002#M41974</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-10-21T17:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231012#M41978</link>
      <description>&lt;P&gt;Hi, try this&amp;nbsp;that first checks for the presence of the outside quotes before using the SUBSTR function. Worked fine with the data you posted. &amp;nbsp;Also, the comments I made in an earlier posting about use of STRIP not being of use in cewrtain situations only applies to its removal of trailing blanks, not leading blanks. &amp;nbsp;If it's just leading blanks that are the concern, the LEFT function could also be used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;data y;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;set x;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;if char(stuff,1) eq '"' and char(stuff,length(stuff)) eq '"' then &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; stuff = substr(stuff,2,length(stuff)-2);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run; &amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data set Y ...&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;Obs stuff&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;1 &amp;nbsp; Red Bull Energy Drink&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 2 &amp;nbsp; Vitamin D 400 Iu&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 3&amp;nbsp; &amp;nbsp;Echinacea And Goldenseal&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 4 &amp;nbsp; Flax Seed Oil 1000 Mg&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 5 &amp;nbsp; Vitamin D&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 6 &amp;nbsp; Allicin Rich Garlic&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 7 &amp;nbsp; Glucosamine Sulfate&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 8 &amp;nbsp; Vitamin C&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 9 &amp;nbsp; Glucosamine Chondroitin Complex&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 10 &amp;nbsp;Vitamin B6&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 11 &amp;nbsp;Vitamin B2&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 12 &amp;nbsp;Vitamin C Timed Release&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 13 &amp;nbsp;Vitamin C 1000 Mg Timed Release&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 14 &amp;nbsp;Milk Thistle&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 15 &amp;nbsp;Now Wheat Germ Oil Softgels&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 16 &amp;nbsp;New Era Combination "S" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 17 &amp;nbsp;New Era Combination "I" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 18 &amp;nbsp;New Era Combination "J" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 19 &amp;nbsp;New Era Combination "K" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt; 20 &amp;nbsp;New Era Combination "L" Biochemic Tissue Salts&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 18:12:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231012#M41978</guid>
      <dc:creator>MikeZdeb</dc:creator>
      <dc:date>2015-10-21T18:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: re: Importing Text file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231131#M42014</link>
      <description>&lt;P&gt;Hi MikeZdeb...Thanks once again for your help. I ran both codes and got the exact same results but had to make a slight modification to use a IF/THEN/ELSE as I was only getting output for the new_name to those products that were in double quptation marks and had increase the length of the new_name variable. Thanks once again!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA NHPPRODUCTS2;&lt;BR /&gt;LENGTH new_name $180.;&lt;BR /&gt;SET Products;&lt;BR /&gt;&amp;nbsp;IF char(PRODUCT_NAME,1) eq '"' AND char(PRODUCT_NAME,length(PRODUCT_NAME)) eq '"' THEN&lt;BR /&gt;&amp;nbsp;&amp;nbsp;new_name = substr(PRODUCT_NAME,2,length(PRODUCT_NAME)-2);&lt;BR /&gt;&amp;nbsp;ELSE new_name = PRODUCT_NAME;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 12:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/re-Importing-Text-file/m-p/231131#M42014</guid>
      <dc:creator>twildone</dc:creator>
      <dc:date>2015-10-22T12:44:29Z</dc:date>
    </item>
  </channel>
</rss>

