<?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 can I import a .txt data set consisting of a single line? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522209#M16169</link>
    <description>&lt;P&gt;Hi Kurt Bremser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you yet again. I can't tell you how much I appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;</description>
    <pubDate>Tue, 18 Dec 2018 13:39:39 GMT</pubDate>
    <dc:creator>USCSS_Nostromo</dc:creator>
    <dc:date>2018-12-18T13:39:39Z</dc:date>
    <item>
      <title>How can I import a .txt data set consisting of a single line?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522181#M16165</link>
      <description>&lt;P&gt;Dear SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to import data sets for circa 60 .txt. files to SAS. Each file's data set consists of a single line of the letters and numbers 123RW in some combination. Due to the length of the data set, it is divided into two lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Attached are three examples of the data sets in the files I am working with.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish to have the data transposed into a single column with the variable name "stages".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also wish to retain the file name of the individual files and insert it as a variable in each file. Thus, for each observation in the data set variable "stages", it should be labeled with the file name (e.g., "ID") in an adjacent column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using version 9.4 SAS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked online and have made some attempts (see script below), but I have not been successful. Can you please offer me any help or advice?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data WANT;&lt;BR /&gt;infile 'C:\*.txt' dlm='09'x dsd truncover;&lt;/P&gt;&lt;P&gt;input @@;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522181#M16165</guid>
      <dc:creator>USCSS_Nostromo</dc:creator>
      <dc:date>2018-12-18T12:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a .txt data set consisting of a single line?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522183#M16166</link>
      <description>&lt;P&gt;Do you need to read single characters, or a fixed length of, say, 5?&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522183#M16166</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T12:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a .txt data set consisting of a single line?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522185#M16167</link>
      <description>&lt;P&gt;Hi Kurt Bremser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Single characters. Each observation should be a single character.&lt;/P&gt;&lt;P&gt;-Ian&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:46:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522185#M16167</guid>
      <dc:creator>USCSS_Nostromo</dc:creator>
      <dc:date>2018-12-18T12:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a .txt data set consisting of a single line?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522186#M16168</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data WANT;
length id fname $200;
infile 'C:\*.txt' filename=fname;
id = fname;
input stages $1. @@;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522186#M16168</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T12:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can I import a .txt data set consisting of a single line?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522209#M16169</link>
      <description>&lt;P&gt;Hi Kurt Bremser,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you yet again. I can't tell you how much I appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 13:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-can-I-import-a-txt-data-set-consisting-of-a-single-line/m-p/522209#M16169</guid>
      <dc:creator>USCSS_Nostromo</dc:creator>
      <dc:date>2018-12-18T13:39:39Z</dc:date>
    </item>
  </channel>
</rss>

