<?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: Enterprise Guide vs Base SAS infile problem in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278210#M55954</link>
    <description>&lt;P&gt;The file was loaded perfectly using EG. It matches the original text file; no garbled text, etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The note at the top of the EG generated code mentions some kind of character translation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;Note: In preparation for running the following code, the Import&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Data wizard has used internal routines to transfer the source data&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;file from the local file system to SASApp. There is no SAS code&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;available to represent this action.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Some characters embedded within the text file were translated to&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;alternative characters so as to avoid transmission errors.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original text file is ANSI and I think I may have found a possible problem. The very last line of the file contains an onk&amp;nbsp;&amp;#12;&amp;#12;&amp;#12;character. I'm not really sure how to remove this. I cant find the character on any special character tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thoughts?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2016 15:00:10 GMT</pubDate>
    <dc:creator>Ody</dc:creator>
    <dc:date>2016-06-17T15:00:10Z</dc:date>
    <item>
      <title>Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/277990#M55895</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've used EG to import a test file, primarily so I didn't have to write out all the code. The file imported successfully and all the data looks good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I copied the generated code to Base SAS to include it in a larger program. I replaced the file location generated from EG with the actual network directory. When I try running the code in Base SAS I get a successful import message in my log:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;NOTE: The infile "\\co\sit\FP\EP-JB1\Ltion\port.txt" is:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; Filename=\&lt;SPAN&gt;\co\sit\FP\EP-JB1\Ltion\port.txt&lt;/SPAN&gt;,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; RECFM=V,LRECL=131068,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; File Size (bytes)=23747766,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; Last Modified=16Jun2016:03:47:16,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; Create Time=09Dec2013:13:22:35&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;NOTE: 32136 records were read from the infile&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; "\&lt;SPAN&gt;\co\sit\FP\EP-JB1\Ltion\port.txt&lt;/SPAN&gt;".&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; The minimum record length was 1.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; The maximum record length was 737.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366FF"&gt;NOTE: The data set WORK.CHK has 32136 observations and 63 variables.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: DATA statement used (Total process time):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; real time 1.29 seconds&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt; cpu time 0.51 seconds&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;NOTE: Remote submit to EMSVR complete.&lt;/FONT&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;However, when I open the table it's blank. When I go back to the EG log I notice the following note at the top&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/* --------------------------------------------------------------------&lt;BR /&gt; &lt;FONT color="#008000"&gt;Code generated by a SAS task&lt;/FONT&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#008000"&gt; Generated on Thursday, June 16, 2016 at 12:04:48 PM&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; By task: Import Data Wizard&lt;/FONT&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#008000"&gt; Source file: &lt;SPAN&gt;\co\sit\FP\EP-JB1\Ltion\port.txt&lt;/SPAN&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; Server: Local File System&lt;/FONT&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#008000"&gt; Output data: WORK.port&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; Server: SASApp&lt;/FONT&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;FONT color="#008000"&gt; Note: In preparation for running the following code, the Import&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; Data wizard has used internal routines to transfer the source data&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; file from the local file system to SASApp. There is no SAS code&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; available to represent this action.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; Some characters embedded within the text file were translated to&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt; alternative characters so as to avoid transmission errors.&lt;/FONT&gt;&lt;BR /&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;It seems EG is some how manipulating the original text file prior to import. I suspect because some of the fields have an NPSC character values of "?".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the EG generated code. Note, I removed the lengthy variable list for the sake of sanity.&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;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.port;
LENGTH
var1
var2
var3
etc...
;

FORMAT
var1
var2
var3
etc... 
;

INFORMAT
var1
var2
var3
etc...
;

INFILE 'J:\SASWORK\PLI01040IIHU\#LN00056'
LRECL=4843278
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD 
;

INPUT
var1
var2
var3
etc...
;

RUN;&lt;/CODE&gt;&lt;/PRE&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;Here is my copy over to Base SAS with the updated directory which does not seem to work:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.port;
LENGTH
var1
var2
var3
etc...
;

FORMAT
var1
var2
var3
etc... 
;

INFORMAT
var1
var2
var3
etc...
;

INFILE '&lt;SPAN&gt;\\co\sit\FP\EP-JB1\Ltion\port.txt&lt;/SPAN&gt;'
LRECL=4843278
ENCODING="WLATIN1"
TERMSTR=CRLF
DLM='7F'x
MISSOVER
DSD 
;

INPUT
var1
var2
var3
etc...
;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I suspect because of the special characters in the original text file it's not properly importing the data. I've reviewed using the compress function to change the "?" but every thing Ive done so far has had the same result. I'd appreciate any assistance with this. Many thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 18:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/277990#M55895</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-06-16T18:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278095#M55928</link>
      <description>&lt;P&gt;What do you mean it is blank?&lt;/P&gt;
&lt;P&gt;The log shows &lt;FONT color="#3366ff"&gt;&amp;nbsp;32136 observations and 63 variables.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Every variable in every observation has length=0?&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#3366ff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 03:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278095#M55928</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-06-17T03:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278175#M55948</link>
      <description>&lt;P&gt;It's strange, I know. When I use Base SAS to run the infile the log shows that it was successfully imported but when I open the table every column is blank. The headers are correct but there is no visible data in any of the fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I could be wrong but my suspicion is that it is due to the special characters in a few of the columns which EG somehow fixes (based on the note it creates) before the import process. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 12:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278175#M55948</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-06-17T12:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278182#M55949</link>
      <description>&lt;P&gt;Can you look at both the original file and the file as transferred by EG?&lt;/P&gt;
&lt;P&gt;If every observation is messed up then you just need to look at the first two lines to see what is happening. First try just using the LIST command. In most instances if the line contains non-ASCII characters then that will trigger SAS to display the hexcodes for the characters in the line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   infile 'myfile'  obs=2;
   input;
   list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 13:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278182#M55949</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-17T13:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278210#M55954</link>
      <description>&lt;P&gt;The file was loaded perfectly using EG. It matches the original text file; no garbled text, etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The note at the top of the EG generated code mentions some kind of character translation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;Note: In preparation for running the following code, the Import&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Data wizard has used internal routines to transfer the source data&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;file from the local file system to SASApp. There is no SAS code&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;available to represent this action.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;Some characters embedded within the text file were translated to&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#008000"&gt;alternative characters so as to avoid transmission errors.&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The original text file is ANSI and I think I may have found a possible problem. The very last line of the file contains an onk&amp;nbsp;&amp;#12;&amp;#12;&amp;#12;character. I'm not really sure how to remove this. I cant find the character on any special character tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thoughts?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 15:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278210#M55954</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-06-17T15:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278217#M55955</link>
      <description>&lt;P&gt;Instead of trying to specifically replace the onk I was able to use compress and keep just the write-able data. I also change the DLM to "|" from the original given by EG.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still need to verify the data translated successfuly but at least I now have data to verify.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data chk;
infile "myfile" 
lrecl = 32767
TERMSTR = CRLF
DLM = '|'
MISSOVER
DSD
;

input @;
_infile_ = compress(_infile_, ,"kw")
;


INPUT
var1
var2
var3
etc...
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jun 2016 15:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278217#M55955</guid>
      <dc:creator>Ody</dc:creator>
      <dc:date>2016-06-17T15:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Enterprise Guide vs Base SAS infile problem</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278311#M55986</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;* create a file with a bunch of problem characters;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data specialchars;&lt;BR /&gt;/* pdd has control type chars '01'x-'09'x */;&lt;BR /&gt;retain odd '00010203040506070809'x;&lt;BR /&gt;retain bf4 'ABCDEFGHIJ' aft '0123456789';&lt;BR /&gt;file "d:/txt/specialchars.txt";&lt;BR /&gt;do i=1 to 10;&lt;BR /&gt;put&lt;BR /&gt;bf4 $char10. odd $char10. aft $char10.;&lt;BR /&gt;end;&lt;BR /&gt;stop;&lt;BR /&gt;;run;quit;&lt;BR /&gt;&lt;BR /&gt;* use the list option to see what hex codes may be present;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data lookatthem;&lt;BR /&gt;infile "d:/txt/specialchars.txt";&lt;BR /&gt;input;&lt;BR /&gt;list;&lt;BR /&gt;stop;&lt;BR /&gt;;run;quit;&lt;BR /&gt;&lt;BR /&gt;LOG has&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;The stragler 30 is the record length&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;NOTE: The infile "d:/txt/specialchars.txt" is:&lt;BR /&gt;Filename=d:\txt\specialchars.txt,&lt;BR /&gt;RECFM=V,LRECL=384,File Size (bytes)=320,&lt;BR /&gt;Last Modified=17Jun2016:15:48:23,&lt;BR /&gt;Create Time=17Jun2016:15:48:23&lt;BR /&gt;&lt;BR /&gt;RULE: ----+----1----+----2----+----3----+--&lt;BR /&gt;&lt;BR /&gt;1 CHAR ABCDEFGHIJ..........0123456789 30&lt;BR /&gt;&lt;BR /&gt;ZONE 444444444400000000003333333333&lt;BR /&gt;NUMR 123456789A01234567890123456789&lt;BR /&gt;&lt;BR /&gt;A better way to look at the file is with fslist.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;But you need full SAS for this.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;proc fslist file="d:/txt/specialchars.txt";&lt;BR /&gt;;run;quit;&lt;BR /&gt;&lt;BR /&gt;* this will give you a full screen visual of all 10 records&lt;BR /&gt;with the mappings, but best of all you get a command line.&lt;BR /&gt;&lt;BR /&gt;On the command line type 'nums on;hex on;' &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;You can do finds for hex codes ie find '02'x.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Unfortunately the past function in the SAS forum does not show the SAS font mappings&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;of the specual characters, only FSLIST can ti this.&lt;BR /&gt;&lt;BR /&gt;ABCDEFGHIJ &amp;#1;&amp;#2;&amp;#3;&amp;#4;&amp;#5;&amp;#6;&amp;#7;&amp;#8; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0123456789&lt;BR /&gt;&lt;BR /&gt;444444444400000000003333333333&lt;BR /&gt;123456789A01234567890123456789&lt;BR /&gt;&lt;BR /&gt;ABCDEFGHIJ &amp;#1;&amp;#2;&amp;#3;&amp;#4;&amp;#5;&amp;#6;&amp;#7;&amp;#8; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0123456789&lt;BR /&gt;&lt;BR /&gt;444444444400000000003333333333&lt;BR /&gt;123456789A01234567890123456789&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2016 20:02:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Enterprise-Guide-vs-Base-SAS-infile-problem/m-p/278311#M55986</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2016-06-17T20:02:44Z</dc:date>
    </item>
  </channel>
</rss>

