<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="IncrediMail 1.0" name=GENERATOR>
<STYLE>
v\:* {behavior:url (#default#vml);}
</STYLE>
<style>v\:* {
        BEHAVIOR: url (#default#vml)
}
</style>
<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>BA285063-5BCE-11D4-AF8D-0050DAC67E11</X-FID>
<X-FVER>2.0</X-FVER>
<X-FIT>Letter</X-FIT>
<X-FILE>Letter\rice_fields.imf</X-FILE>
<X-FCOL>Elegant Paper</X-FCOL>
<X-FCAT>Stationery</X-FCAT>
<X-FDIS>Rice Fields</X-FDIS>
<X-Extensions>SU1CTDEsNDEsgUmBSTAkkcGNgZmVTY0wNCxNhYUoiU0kOMEoTYGBjYEoJDSZnSyFhUksSU1CTDIsMCwsSU1CTDMsMCws</X-Extensions>
<X-BG>cid:0645C37A-CC20-4B22-A324-49EDA801EF60</X-BG>
<X-BGT>repeat</X-BGT>
<X-BGC>#eff3f7</X-BGC>
<X-BGPX>left</X-BGPX>
<X-BGPY>top</X-BGPY>
<X-ASN>ANIM3D00-NONE-0000-0000-000000000000</X-ASN>
<X-ASNF>0</X-ASNF>
<X-ASH>ANIM3D00-NONE-0000-0000-000000000000</X-ASH>
<X-ASHF>1</X-ASHF>
<X-AN>6486DDE0-3EFD-11D4-BA3D-0050DAC68030</X-AN>
<X-ANF>0</X-ANF>
<X-AP>6486DDE0-3EFD-11D4-BA3D-0050DAC68030</X-AP>
<X-APF>1</X-APF>
<X-AD>C3C52140-4147-11D4-BA3D-0050DAC68030</X-AD>
<X-ADF>0</X-ADF>
<X-AUTO>X-ASN,X-ASH,X-AN,X-AP,X-AD</X-AUTO>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY style="BACKGROUND-POSITION: left top; FONT-SIZE: 12pt; MARGIN: 0px 10px 10px; COLOR: #00005b; BACKGROUND-REPEAT: repeat; FONT-FAMILY: Arial" text=#00005b bgColor=#eff3f7 background=cid:0645C37A-CC20-4B22-A324-49EDA801EF60 scroll=yes SIGCOLOR="0">
<TABLE id=INCREDIMAINTABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR>
<TD id=INCREDITEXTREGION style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 12pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" vAlign=top width="100%">
<DIV>Hello.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I wish to translate a SAS data file to text, and do not have the professional</DIV>
<DIV>version of SAS to do so.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have the student version of SAS, and have translated the shortest of 4 SAS</DIV>
<DIV>data sets given.</DIV>
<DIV>&nbsp;</DIV>
<DIV>For the other 3, I wish to construct a python program to read the characters in, one</DIV>
<DIV>at a time, translate them to hexadecimal, then figure out how the data matches</DIV>
<DIV>the data dictionary that I have.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I experimented with writing code in C++ to do this.</DIV>
<DIV>&nbsp;</DIV>
<DIV>My first experiment, in C++&nbsp; is</DIV>
<DIV>&nbsp;</DIV>
<DIV>#include &lt;stdio.h&gt;<BR>#include &lt;iostream&gt;<BR>#define TRUE&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Define some handy constants&nbsp; */<BR>#define FALSE&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Define some handy constants&nbsp; */<BR>ifstream f("CMT_MCAID",ios_base::binary);<BR>ofstream G("mcaid.txt",ios_base::app);<BR>char ch<BR>int k<BR>int kh,kl<BR>int limit<BR>limit = 1000</DIV>
<DIV>&nbsp;</DIV>
<DIV>for (int I=1;I&lt;= limit;I++) </DIV>
<DIV>&nbsp;</DIV>
<DIV>{<BR>f &gt;&gt; ch;<BR>k = ch;<BR>kl = k%16;<BR>kh = (k -kl)/16;<BR>G &lt;&lt; kh," ",kl," ";<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>How can I begin to experiment using python?&nbsp; What would be python code equivalent</DIV>
<DIV>to the above C++ code?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Kermit&nbsp; &lt;&nbsp; <A href="mailto:kermit@Polaris.net">kermit@Polaris.net</A>&nbsp; &gt;</DIV>
<DIV>&nbsp;</DIV></TD></TR>
<TR>
<TD id=INCREDIFOOTER width="100%">
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD width="100%"></TD>
<TD id=INCREDISOUND vAlign=bottom align=middle></TD>
<TD id=INCREDIANIM vAlign=bottom align=middle></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>