<?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: Importing and Merging Pipe Delimited files in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584634#M14212</link>
    <description>Does the first file have the variable types? Or any other relevant information? &lt;BR /&gt;How do they currently look?&lt;BR /&gt;&lt;BR /&gt;What do you want as final output? A lot of this depends on exactly how the file are laid out. The 'names' could be a single row of data or could be a column of data with variable types and lengths or other variations. &lt;BR /&gt;&lt;BR /&gt;It really helps if you can show:&lt;BR /&gt;1 - What are you starting with?&lt;BR /&gt;2 - What do you want as output?&lt;BR /&gt;3 - Logic to get there&lt;BR /&gt;4 - Anything you've tried so far. Sometimes you're just off a little and sometimes you can be entirely off.</description>
    <pubDate>Wed, 28 Aug 2019 16:02:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-08-28T16:02:05Z</dc:date>
    <item>
      <title>Importing and Merging Pipe Delimited files</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584623#M14208</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import two pipe delimited files, one that only contains the variable names, and the other containing the raw data. What would be the best way to import and merge these two files together. Both files are rather large ( about 2000 variables).&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 15:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584623#M14208</guid>
      <dc:creator>MoB</dc:creator>
      <dc:date>2019-08-28T15:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Importing and Merging Pipe Delimited files</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584634#M14212</link>
      <description>Does the first file have the variable types? Or any other relevant information? &lt;BR /&gt;How do they currently look?&lt;BR /&gt;&lt;BR /&gt;What do you want as final output? A lot of this depends on exactly how the file are laid out. The 'names' could be a single row of data or could be a column of data with variable types and lengths or other variations. &lt;BR /&gt;&lt;BR /&gt;It really helps if you can show:&lt;BR /&gt;1 - What are you starting with?&lt;BR /&gt;2 - What do you want as output?&lt;BR /&gt;3 - Logic to get there&lt;BR /&gt;4 - Anything you've tried so far. Sometimes you're just off a little and sometimes you can be entirely off.</description>
      <pubDate>Wed, 28 Aug 2019 16:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584634#M14212</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-28T16:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing and Merging Pipe Delimited files</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584642#M14213</link>
      <description>&lt;P&gt;The names are listed in a single row of data, ie " ID|Location|Date...." The raw data is given in a similar structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the final output I want the variable names listed in columns across the top and the observations listed below, just like they would be in a standard excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My first thought was to import the raw data first with &lt;FONT color="#0000FF"&gt;getnames&lt;/FONT&gt;=no, then rename the variables (this is before I realized there were roughly 2000 of them)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next I thought I could import them both separately then merge them together somehow but then when I try to import the names file I get the following error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unable to sample external file, no data in first 5 records.&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR: Import unsuccessful. See SAS Log for details.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 16:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584642#M14213</guid>
      <dc:creator>MoB</dc:creator>
      <dc:date>2019-08-28T16:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Importing and Merging Pipe Delimited files</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584649#M14214</link>
      <description>Read your data file with getnames=no or specify var1-var2000. I don't recommend PROC IMPORT with 2000 variables it will be wrong a lot of the time. &lt;BR /&gt;&lt;BR /&gt;Read the names file into a file with &lt;BR /&gt;&lt;BR /&gt;VariableOrder VariableName&lt;BR /&gt;1                      ID&lt;BR /&gt;2                      FirstName&lt;BR /&gt;3                      MiddleInitial&lt;BR /&gt;4                      LastName&lt;BR /&gt;&lt;BR /&gt;Then you can create a data driven rename approach that is dynamic. &lt;BR /&gt;&lt;BR /&gt;You won't be able to use a single macro variable but you can do it via proc datasets. &lt;BR /&gt;&lt;BR /&gt;This link has the code on how to rename your data from a dataset that has a list of the old names and new names. &lt;BR /&gt;&lt;A href="https://gist.github.com/statgeek/ba360dd1cf748bf6d0da7e2e16aafe66" target="_blank"&gt;https://gist.github.com/statgeek/ba360dd1cf748bf6d0da7e2e16aafe66&lt;/A&gt;</description>
      <pubDate>Wed, 28 Aug 2019 16:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584649#M14214</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-28T16:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Importing and Merging Pipe Delimited files</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584663#M14216</link>
      <description>&lt;P&gt;Thanks! I'll give it a shot&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 16:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Importing-and-Merging-Pipe-Delimited-files/m-p/584663#M14216</guid>
      <dc:creator>MoB</dc:creator>
      <dc:date>2019-08-28T16:55:14Z</dc:date>
    </item>
  </channel>
</rss>

