<?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: Reading raw data from a text file-decoding text file with symbols in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568941#M17431</link>
    <description>&lt;P&gt;Here's a quick code snippet that might help you figure out the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME CCREP "some file.txt";

data _null_;
	infile CCREP;
	input;
	file log;
	put _infile_;

	if _n_ = 5 then
		stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;First of all, you should get some diagnostics on the characteristics of the dataset. Second, it will print the contents of the first five records, so you can get some idea of if the lengths make sense and if the contents are correct. From there, you (and we, if necessary) can try to figure out what's up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Tue, 25 Jun 2019 22:08:17 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2019-06-25T22:08:17Z</dc:date>
    <item>
      <title>Reading raw data from a text file-decoding text file with symbols</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568933#M17430</link>
      <description>&lt;P&gt;Good afternoon.&lt;/P&gt;&lt;P&gt;I need to read a fixed text file (mainframe data; length 522).&amp;nbsp; This file has characters, numbers and symbols (e.g. squares/blocks). &amp;nbsp;&amp;nbsp; I have read in SAS (v 9.3) the same file directly from mainframe without problems (below SAS code) .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME CCREP FTP " ' mainframe file name' " USER='XXXXX' PROMPT&lt;/P&gt;&lt;P&gt;LRECL=412 RECFM=FB HOST='XXXX.XXXX.XX.XX';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This time I received a text file with 11 new variables.&amp;nbsp; I have added the new variables into my SAS program, but I am encountering problems reading the text file (below SAS code).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FILENAME CCREP "File location and name.txt";&lt;/P&gt;&lt;P&gt;Data REPORTA; INFILE CCREP LRECL=522 RECFM=FB;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA acf800.REPORTA;&lt;BR /&gt;INFILE CCREP;&lt;/P&gt;&lt;P&gt;INPUT&lt;/P&gt;&lt;P&gt;@1 GRNTYPE $EBCDIC1. @2 DISPO $EBCDIC1....;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have received the following errors and notes:&lt;/P&gt;&lt;P&gt;-Invalid value for the RECFM option.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-0 records were read from the infile CCREP&lt;/P&gt;&lt;P&gt;several notes&amp;nbsp; for:&lt;/P&gt;&lt;P&gt;Invalid data for X variable in line 1 3-7 (for example)&lt;/P&gt;&lt;P&gt;-Lost Card&lt;/P&gt;&lt;P&gt;-Invalid errors for file CCREP occurred outside the printed range&lt;/P&gt;&lt;P&gt;-Increase available buffer lines with the INFILE n=option&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, let me know if additional information is required.&amp;nbsp; Thank you in advanced for the assistance. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 21:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568933#M17430</guid>
      <dc:creator>mlopezvalentin</dc:creator>
      <dc:date>2019-06-25T21:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw data from a text file-decoding text file with symbols</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568941#M17431</link>
      <description>&lt;P&gt;Here's a quick code snippet that might help you figure out the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME CCREP "some file.txt";

data _null_;
	infile CCREP;
	input;
	file log;
	put _infile_;

	if _n_ = 5 then
		stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;First of all, you should get some diagnostics on the characteristics of the dataset. Second, it will print the contents of the first five records, so you can get some idea of if the lengths make sense and if the contents are correct. From there, you (and we, if necessary) can try to figure out what's up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 22:08:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568941#M17431</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2019-06-25T22:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading raw data from a text file-decoding text file with symbols</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568945#M17432</link>
      <description>&lt;P&gt;Instead of describing error message you would be better off to copy from the log the entire data step and all the messages and then paste them into a code box opened using the forum's {I} or "running man" icon. The code box is important to retain formatting as many error messages, including the invalid data type, include diagnostics that the message windows here will reformat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then we&amp;nbsp; won't have to ask a whole bunch of leading questions about stuff that should be obvious from your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 23:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Reading-raw-data-from-a-text-file-decoding-text-file-with/m-p/568945#M17432</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-25T23:07:08Z</dc:date>
    </item>
  </channel>
</rss>

