<?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 Reading EBCDIC Files with null characters ('00'x) in fields in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55673#M11856</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest, first, that you delete this discussion, change your password, and start a new discussion.&amp;nbsp; The log you posted has your ip address, user name and password included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you repost, yes the code and log would help, but seeing at least a snippet of the data would also be quite helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Apr 2012 13:23:56 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-04-04T13:23:56Z</dc:date>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55670#M11853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to read some files in EBCDIC from a Mainframe, to our HP-UX SAS Servers.&lt;/P&gt;&lt;P&gt;I'm accessing the files directly in the Mainframe using filename ftp.&lt;/P&gt;&lt;P&gt;The resulting datasets look fine but i'm facing a problem on some fields where there are null ('00'x) characters in the midle of some fields, as the info in those fields gets truncated as the first null charecter is found.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next is a hexadecimal representation of one of those fields, with a length of 30, taken from the _infile_ variable. I've underlined the severel ocurrences of the null characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F2F0F2F5F6F0F0F0F0F0F1F4F1C2&lt;SPAN style="text-decoration: underline;"&gt;0000000000&lt;/SPAN&gt;0CF2F0F1F2F0F3F2F0&lt;SPAN style="text-decoration: underline;"&gt;0000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When i translate these fields from EBCDIC to ASCII, using the $ebcdic30. informat in the input statement, all the info after the first null gets truncated leaving me with an incomplete record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F2F0F2F5F6F0F0F0F0F0F1F4F1C2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what i could already analyse, the information read from the input buffer is correct, i've analysed the source record in TSO and the hex representation matches the one i'm reading in SAS.&lt;/P&gt;&lt;P&gt;The problem seems to be when converting with the ebcdic informat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea on how to overcome this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll attach the code and some partial log for any debuging needs (The table "estruturas" has the structure of the information to be read in the LOG file):&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 11:43:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55670#M11853</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T11:43:15Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55671#M11854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the filename option: encoding=unicode&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 12:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55671#M11854</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-04T12:25:06Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55672#M11855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It gives a Warning message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: A character that could not be transcoded was encountered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and no obs are written to the datasets as the value that controls wich dataset to output (log_tabela) is not correctly translated&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;log_tabela=’’’’’’’’’’’’’’’’’’&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 12:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55672#M11855</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T12:48:44Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55673#M11856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would suggest, first, that you delete this discussion, change your password, and start a new discussion.&amp;nbsp; The log you posted has your ip address, user name and password included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you repost, yes the code and log would help, but seeing at least a snippet of the data would also be quite helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 13:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55673#M11856</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-04T13:23:56Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55674#M11857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thks for the warning.&lt;/P&gt;&lt;P&gt;The IP address is from a closed internal network so there's not a problem there. The user and pass might be a problem if you can access the internal network.&lt;/P&gt;&lt;P&gt;I've changed the pwd anyways and edited the log file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure on what data i can show you as i can only access the file trough a TSO terminal. The file is variable length and, as you can see in the code, it's read based on a structure file wich indicates what to read in each record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 13:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55674#M11857</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T13:38:38Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55675#M11858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It has been too many years since I've worked with Mainframe systems, thus I can only guess.&amp;nbsp; However, looking at the snippet of data that I could see in your log, it definitely doesn't appear to be unicode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following, from the documentation, might help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DL&gt;&lt;DT style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;$CHARZB&lt;SPAN class="emph" style="font-style: italic;"&gt;w.&lt;/SPAN&gt;&lt;/DT&gt;&lt;DD style="font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; margin-bottom: 1.4em; background-color: #ffffff;"&gt;&lt;P style="margin-bottom: 1.4em; line-height: 1.25em;"&gt;&lt;A name="a000551170" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;reads character data and converts any byte that contains a binary zero to a blank.&lt;/P&gt;&lt;/DD&gt;&lt;DT style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;A name="a000551171" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;$EBCDIC&lt;SPAN class="emph" style="font-style: italic;"&gt;w.&lt;/SPAN&gt;&lt;/DT&gt;&lt;DD style="font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; margin-bottom: 1.4em; background-color: #ffffff;"&gt;&lt;P style="margin-bottom: 1.4em; line-height: 1.25em;"&gt;&lt;A name="a000551172" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;converts character data to EBCDIC. Under z/OS, $EBCDIC and $CHAR are equivalent.&lt;/P&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 13:51:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55675#M11858</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-04-04T13:51:27Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55676#M11859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm getting somewhere with the $CHARZBw. informat.&lt;/P&gt;&lt;P&gt;When inputing the data with that informat the nulls are replaced with '20'x (hex code for space in ASCII). If afterwards i apply the $EBCDICw. informat the data is well translated to ASCII but instead of blanks in place of nulls i get '€' wich is the EBCDIC symbol for the '20'x hex code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i just have to find how the $CHARZBw. informat translates to EBCDIC space hex code and not ASCII space hex code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the end, '€' character might be as good garbage as the null characters that were in the field. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any more comments are much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 14:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55676#M11859</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T14:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55677#M11860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Read it using $CHAR.&lt;/P&gt;&lt;P&gt;Translate the '00'x to '40'x (that is space in EBCDIC).&lt;/P&gt;&lt;P&gt;Convert to ASCII using $EBCDIC informat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;57&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;58&amp;nbsp;&amp;nbsp;&amp;nbsp; hex='F0F2F5F6F0F0F0F0F0F1F4F1C200000000000CF2F0F1F2F0F3F2F0000000';&lt;/P&gt;&lt;P&gt;59&amp;nbsp;&amp;nbsp;&amp;nbsp; raw=input(hex,$hex60.);&lt;/P&gt;&lt;P&gt;60&amp;nbsp;&amp;nbsp;&amp;nbsp; fix=translate(raw,'40'x,'00'x);&lt;/P&gt;&lt;P&gt;61&amp;nbsp;&amp;nbsp;&amp;nbsp; ascii=input(fix,$ebcdic30.);&lt;/P&gt;&lt;P&gt;62&amp;nbsp;&amp;nbsp;&amp;nbsp; put hex=/ (raw fix ascii) (= $hex. /) / ascii=;&lt;/P&gt;&lt;P&gt;63&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hex=F0F2F5F6F0F0F0F0F0F1F4F1C200000000000CF2F0F1F2F0F3F2F0000000&lt;/P&gt;&lt;P&gt;raw=F0F2F5F6F0F0F0F0F0F1F4F1C200000000000CF2F0F1F2F0F3F2F0000000&lt;/P&gt;&lt;P&gt;fix=F0F2F5F6F0F0F0F0F0F1F4F1C240404040400CF2F0F1F2F0F3F2F0404040&lt;/P&gt;&lt;P&gt;ascii=3032353630303030303134314220202020200C3230313230333230202020&lt;/P&gt;&lt;P&gt;ascii=025600000141B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;20120320&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you string includes '0C'x which is normally a page feed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 15:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55677#M11860</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-04T15:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55678#M11861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;art or anyone else,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any trick to make SAS consider converting the binary 0s to EBCDIC space hex code ('40'x) instead of ASCII hex code ('20'x) when using informat $CHARZB&lt;SPAN class="emph" style="font-style: italic;"&gt;w?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph" style="font-style: italic;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph"&gt;It turns out that having a € for the binary 0 doesn't suit my problem, i really need it to be converted to spaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph"&gt;Regards.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="emph"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 15:56:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55678#M11861</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T15:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55679#M11862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Tom and will reiterate his note, '0C'x is a form feed (page break) so be aware of this in your data and probably be prepared to remove it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;/* resemble your file */&lt;/P&gt;&lt;P&gt;filename tmp temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; file tmp;&lt;/P&gt;&lt;P&gt; hex='F0F2F5F6F0F0F0F0F0F1F4F1C200000000000CF2F0F1F2F0F3F2F0000000'x;&lt;/P&gt;&lt;P&gt; put hex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* read your file */&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; infile tmp;&lt;/P&gt;&lt;P&gt; input @;&lt;/P&gt;&lt;P&gt; _infile_=prxchange('s/\x00/@/',-1,_infile_);&lt;/P&gt;&lt;P&gt; input want $ebcdic30.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;want=025600000141B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;20120320&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55679#M11862</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-04-04T16:15:23Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55680#M11863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading the file with the $CHARw informat has the same behaviour than with $EBCDICw truncating the field after it encounters the null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Picking in your sugestion, i'm creating one variable containing the whole _infile_ buffer converted to hexdecimal to apply your translation code afterwards. After this parsing i'll have to substring to get every column. This seems a very heavy solution but it is, until now, the best one i have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55680#M11863</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T16:24:08Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55681#M11864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just use the _INFILE_ trick as posted above by FriedEgg.&amp;nbsp; The regex is overkill though for such a simple problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; infile .... ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input @;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _infile_=translate(_infile_,'40'x,'00'x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input field1 $ebcdic20. field2 $ecbcdic12. .... ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55681#M11864</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-04-04T16:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55682#M11865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PAzevedo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See my posting, you can read the columns with a normal input statement after adjusting the buffer as I did in the example, here I parse your data into a series of numeric and character variables for each byte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; infile tmp;&lt;/P&gt;&lt;P&gt; input @;&lt;/P&gt;&lt;P&gt; _infile_=prxchange('s/\x00/@/o',-1,_infile_); *or translate, like Tom, I just prefer regex;&lt;/P&gt;&lt;P&gt; input (v1-v12) (s370ff1.) (v13-v19) ($ebcdic1.) (v20-v30) (s370ff1.);&lt;/P&gt;&lt;P&gt; put 32*'-' / (v1-v30) (10*3. /) / 32*'-';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0&amp;nbsp; 2&amp;nbsp; 5&amp;nbsp; 6&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp; 4&amp;nbsp; 1B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; 0&amp;nbsp; 1&amp;nbsp; 2&amp;nbsp; 0&amp;nbsp; 3&amp;nbsp; 2&amp;nbsp; 0&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;&lt;P&gt;--------------------------------&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55682#M11865</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-04-04T16:40:24Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55683#M11866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi FriedEgg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That specific character isn't a problem for me as SAS has no problem in storing it, although others like '0A'x, '0D'x, '3F'x, '25'x are.&lt;/P&gt;&lt;P&gt;There is a bunch of garbage in our Mainframe tables that have given us a lot of headaches trough time!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to give the almost full picture, we are changing all our SAS applications to start getting the info we need directly from the Mainframe, trough FTP, instead of beeing the mainframe to do the parsing of the files and then sending them to our SAS servers (a new offload policy). This means that every parsing being made nowadays in the applications that send us the files needs to be done exactly the same way (e.g. delimiters, special characters, etc.) by our SAS Apps or else there is a huge risk on the new data not matching the one we have nowadays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The '0C'x isn't currently being parsed by the Mainframe apps so it will stay the same in the new SAS App.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, now that you and Tom mentioned it, i'm starting to feel that there isn't really a simple and light solution for my problem as i expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've runned away from pearl expressions for a long time but i believe now it's the right time to dive into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:41:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55683#M11866</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T16:41:55Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55684#M11867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hadn't read FriedEgg's post when i answeared you. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:44:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55684#M11867</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T16:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55685#M11868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it, thks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have to escuse me as it takes a while for me to write the answears so that the english errors are minimum!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And now the big doubt is... who gets the 4 points and who gets just 3. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55685#M11868</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55686#M11869</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use \s instead of \x00 to catch all 'white-space' characters and convert them to '40'x (@ in ascii)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;filename tmp temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; file tmp;&lt;/P&gt;&lt;P&gt; hex='000A0D3F250C00F2F4F6000A0D3F250C00F2F4F6000A0D3F250C00F2F4F6'x;&lt;/P&gt;&lt;P&gt; put hex;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; infile tmp recfm=f lrecl=31 truncover; *this is 31 instead of 30 because of construction above in unix adds LF;&lt;/P&gt;&lt;P&gt; input @;&lt;/P&gt;&lt;P&gt; _infile_=prxchange('s/\s/@/',-1,_infile_);&lt;/P&gt;&lt;P&gt; input (v1-v30) ($ebcdic1.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 16:58:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55686#M11869</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-04-04T16:58:45Z</dc:date>
    </item>
    <item>
      <title>Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55687#M11870</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't quite get what you mean by 'white-space' characters. I see that it removes all the characters i mentioned before but not the '0C'x.&lt;/P&gt;&lt;P&gt;What is the difference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55687#M11870</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T17:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55688#M11871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it.It was one google search away! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if i can remove all 'white-spaces' for the same reason i've got to keep the '0C'x so that the data read before the new SAS App matches the one read after. I'll look into it a i'll for sure start looking a lot more into pearl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55688#M11871</guid>
      <dc:creator>PAzevedo</dc:creator>
      <dc:date>2012-04-04T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading EBCDIC Files with null characters ('00'x) in fields</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55689#M11872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whitespace character information:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://en.wikipedia.org/wiki/White_space_(computer_science)"&gt;http://en.wikipedia.org/wiki/White_space_(computer_science)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why it seems to be not including some of them in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt; infile tmp recfm=f lrecl=31 truncover; *this is 31 instead of 30 because of construction above in unix adds LF;&lt;/P&gt;&lt;P&gt; input @;&lt;/P&gt;&lt;P&gt; _infile_=prxchange('s/[\x00\x0A\x0D\x3F\x25\x0C]/@/',-1,_infile_);&lt;/P&gt;&lt;P&gt; list;&lt;/P&gt;&lt;P&gt; input (v1-v30) ($ebcdic1.);&lt;/P&gt;&lt;P&gt; put (v1-v30) (10*3. /);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; 2&amp;nbsp; 4&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; 2&amp;nbsp; 4&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; 2&amp;nbsp; 4&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;RULE:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @@@@@@@òôö@@@@@@@òôö@@@@@@@òôö@&lt;/P&gt;&lt;P&gt;&lt;SPAN style="white-space: normal; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Apr 2012 17:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-EBCDIC-Files-with-null-characters-00-x-in-fields/m-p/55689#M11872</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-04-04T17:30:08Z</dc:date>
    </item>
  </channel>
</rss>

