<?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 Data - Direct from the network / phantom character getting added in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/323985#M271270</link>
    <description>&lt;P&gt;By moving to a server setup I assume you mean you moving onto Unix SAS from Windows based SAS? &amp;nbsp;If so then that would explain why you have the extra character. &amp;nbsp;Windows uses CR+LF to dictate the end of a line, Unix only uses CR, hence one hidden symbol difference. &amp;nbsp;Your FTP software software should have an option to sort this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://winscp.net/eng/docs/faq_line_breaks" target="_blank"&gt;https://winscp.net/eng/docs/faq_line_breaks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your process, using proc import - which is a guessing procedure - can give different results as it is guessing what the data is. &amp;nbsp;Depending on various options, it may guess your data is different than on the other system. &amp;nbsp;I would always recommend writing a datastep import (you can generate from the proc import code), and fix lengths/formats etc. so you get an exact match without guessing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, you will need an FTP setup to access files, I don't think there is a way to directly access windows network areas from UNix and vice versa.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 16:13:05 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-01-11T16:13:05Z</dc:date>
    <item>
      <title>Importing Data - Direct from the network / phantom character getting added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/323982#M271269</link>
      <description>&lt;P&gt;We are&amp;nbsp;discontinuing the&amp;nbsp;use of desktop SAS as we do 99% of our work on a server. &amp;nbsp;Basically the only time we process locally is when we are uploading files from local network drives. &amp;nbsp;As we are transitioning our code to bystep local processing, we are encountering issues--we really only need to solve one&amp;nbsp;of the issues below (solving one will eliminate the need for the other).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(1) Is there a way to point SAS, through remote processing, to a local network drive? &amp;nbsp;Currently we are copying files from the network to the server and then uploading them (but having the issue described below). &amp;nbsp;We've tried several re-writes but can't find a way to get SAS to recognize a network drive within a remote libname statement. &amp;nbsp;Is there a way to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(2) When we copy files from the network to the server (generally with the program WinSCP) and then upload, a phantom character gets added to every observation, causing the data to not be useable. &amp;nbsp;The data loads, looks like it is formatted correctly, but there is a phantom character at the end of observations that has to be stripped off using the substr function. &amp;nbsp;So, we have a fix, but it would be better to understand why this happening. &amp;nbsp;An example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For a very simple upload, we have a file with one variable, a 9-number value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we run the below code locally, loading a file from the network drive, it runs perfectly and creates a character variable that is 9 characters long, which is exactly what we want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc import out = workwin.test
datafile = "Q:\generic\filename.csv"
DBMS=CSV REPLACE;
GETNAMES=NO;
DATAROW=2;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, if we first transfer the file to the server and then load it, using the same code, just changning the file location and adding remote submits, it reads each observation in as a 10-character value, where the tenth character is a phantom:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;
proc import out = workwin.test
datafile = "/opt/sas/users/generic/filename.csv"
DBMS=CSV REPLACE;
GETNAMES=NO;
DATAROW=2;
run;
endrsubmit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm calling the tenth character a "phantom" because if we try to search the uploaded values, we can't match them no matter what we try. &amp;nbsp;For example, if the variable is 'order_id' and a value is '123456789', if we search where order_id = '123456789' SAS claims there is no match. &amp;nbsp;We also tried '123456789 ' and '123456789_' and just as numeric, but in no cases can it find the match, so I don't even know what that tenth character is that gets added. &amp;nbsp;Again, if we use substr and strip off the tenth character, it works, but it'd be nice to not have to do this to every piece of data we're trying to upload.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas on this are GREATLY appreciated! &amp;nbsp;(FYI, we are on SAS 9.3)&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 16:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/323982#M271269</guid>
      <dc:creator>dolldata</dc:creator>
      <dc:date>2017-01-11T16:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data - Direct from the network / phantom character getting added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/323985#M271270</link>
      <description>&lt;P&gt;By moving to a server setup I assume you mean you moving onto Unix SAS from Windows based SAS? &amp;nbsp;If so then that would explain why you have the extra character. &amp;nbsp;Windows uses CR+LF to dictate the end of a line, Unix only uses CR, hence one hidden symbol difference. &amp;nbsp;Your FTP software software should have an option to sort this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://winscp.net/eng/docs/faq_line_breaks" target="_blank"&gt;https://winscp.net/eng/docs/faq_line_breaks&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your process, using proc import - which is a guessing procedure - can give different results as it is guessing what the data is. &amp;nbsp;Depending on various options, it may guess your data is different than on the other system. &amp;nbsp;I would always recommend writing a datastep import (you can generate from the proc import code), and fix lengths/formats etc. so you get an exact match without guessing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And yes, you will need an FTP setup to access files, I don't think there is a way to directly access windows network areas from UNix and vice versa.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 16:13:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/323985#M271270</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-11T16:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Importing Data - Direct from the network / phantom character getting added</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/324004#M271271</link>
      <description>&lt;P&gt;Hi RW9!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, we are&amp;nbsp;transferring from Windows to Unix...modifying the FTP transfer settings (from "Binary" to "Text") worked perfectly.&amp;nbsp; Also, your recommendation of using the datastep import, modified from the proc import, was very useful--and&amp;nbsp;saves us several steps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the explanation on this!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 17:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-Data-Direct-from-the-network-phantom-character-getting/m-p/324004#M271271</guid>
      <dc:creator>dolldata</dc:creator>
      <dc:date>2017-01-11T17:18:39Z</dc:date>
    </item>
  </channel>
</rss>

