<?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: Integer binary formats in CAS in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816045#M20366</link>
    <description>&lt;P&gt;Note that SAS/Studio is just an interface you can use to compose and submit SAS code.&amp;nbsp; You can use it to connect to VIYA and Base SAS installations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So PIB will create strings that contain binary representations of positive (unsigned) integers.&amp;nbsp; So all of the bits are used for the value of the number instead of reserving one bit to indicate that the number is negative.&amp;nbsp; That means you can use PIB1. to store integers from 0 to 255 in a one byte character string.&amp;nbsp; Or PIB4. to store integers from 0 to 256**4-1 in a four byte character string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure what value it will unless you are trying to recreate some binary file format for exchange with some other application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 16:16:51 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-06-01T16:16:51Z</dc:date>
    <item>
      <title>Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815827#M20353</link>
      <description>&lt;P&gt;Hi! I am running SAS in CAS (Cloud Analytic Services). The SAS format&amp;nbsp; IB4. is available there.&lt;/P&gt;
&lt;P&gt;In my SAS program&amp;nbsp; integer numbers are converted from character form into numeric form, many times. See example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; proc format;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; value testf&amp;nbsp; &amp;nbsp;0-10 = "1"&lt;/P&gt;
&lt;P&gt;&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; 11-20 = "2";&amp;nbsp; /** etc. */&lt;BR /&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is used in a Data step:&amp;nbsp; &amp;nbsp;nnewval =&amp;nbsp; &amp;nbsp;INPUT(&amp;nbsp; PUT(nval, testf.), 2.);&lt;/P&gt;
&lt;P&gt;The part&amp;nbsp; INPUT(PUT)&amp;nbsp; is executed MANY, MANY times, so I want to use SAS formats like IB8.&lt;/P&gt;
&lt;P&gt;However this is NOT supplied in CAS SAS.&lt;/P&gt;
&lt;P&gt;Is there any other "integer binary" format that can be used?&lt;/P&gt;
&lt;P&gt;My thought:&amp;nbsp; In the right hand side of the format definition, do not write the character integer,&lt;/P&gt;
&lt;P&gt;but rather a binary representation of the integer. That takes slightly more time in the creation of the format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;In the next step, when using the format,&amp;nbsp; the INPUT will be somewhat faster, since 2. is replaced by an "integer format".&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;I tested this in WPS SAS, with&amp;nbsp; IB8.&amp;nbsp; The computations were speeded up. It was worth the extra programming!&lt;BR /&gt;Many thanks in advance for any suggestions.&lt;/P&gt;
&lt;P&gt;CAS SAS is great to use!&lt;/P&gt;
&lt;P&gt;/Br Anders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 13:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815827#M20353</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-05-31T13:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815828#M20354</link>
      <description>Typing error:  Should be  "The SAS format  IB4. is NOT available there."</description>
      <pubDate>Tue, 31 May 2022 13:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815828#M20354</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-05-31T13:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815832#M20356</link>
      <description>&lt;P&gt;I don't understand why you need the IB format.&amp;nbsp; How would that help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you are just dividing by 10.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;nnewval =  ceil(nval/10);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 May 2022 14:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815832#M20356</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-31T14:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815834#M20357</link>
      <description>Hi! When creating the user format, numeric integers are converted into character integers.&lt;BR /&gt;When using the format, the character numbers in the right hand side are used. But I want them as numbers. So I have to convert them back to numeric integers.&lt;BR /&gt;Perhaps my exampla was too simple. No I do not want to divide by 10.</description>
      <pubDate>Tue, 31 May 2022 14:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815834#M20357</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-05-31T14:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815843#M20359</link>
      <description>&lt;P&gt;Informats convert text to values.&lt;/P&gt;
&lt;P&gt;Formats convert values to text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to move from text to numbers you can use an INFORMAT.&lt;/P&gt;
&lt;P&gt;If you want to move from numbers to text you can use a FORMAT.&lt;/P&gt;
&lt;P&gt;If you want to move from text to text you can use either.&lt;/P&gt;
&lt;P&gt;If you want to move from numbers to numbers then you either need to use your INPUT(PUT()) sandwich or define a function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in any case I cannot see how the IB format would be of any value.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 14:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815843#M20359</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-31T14:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815851#M20361</link>
      <description>Hi!  I have a long answer, but it is too long to post here. I hope I can include it in a few weeks,</description>
      <pubDate>Tue, 31 May 2022 14:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/815851#M20361</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-05-31T14:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816029#M20365</link>
      <description>Hi!  The title was NOT correct.  This is not in CAS.&lt;BR /&gt;  Mea culpa!&lt;BR /&gt;&lt;BR /&gt;The solution i SAS Studio (running on Linux):  PIB8.   turned out to be the best.&lt;BR /&gt;I write a lot of integer numbers as characters. Later I read them from the char acyter variabl, to recreate the integer number.</description>
      <pubDate>Wed, 01 Jun 2022 15:23:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816029#M20365</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-06-01T15:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816045#M20366</link>
      <description>&lt;P&gt;Note that SAS/Studio is just an interface you can use to compose and submit SAS code.&amp;nbsp; You can use it to connect to VIYA and Base SAS installations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So PIB will create strings that contain binary representations of positive (unsigned) integers.&amp;nbsp; So all of the bits are used for the value of the number instead of reserving one bit to indicate that the number is negative.&amp;nbsp; That means you can use PIB1. to store integers from 0 to 255 in a one byte character string.&amp;nbsp; Or PIB4. to store integers from 0 to 256**4-1 in a four byte character string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure what value it will unless you are trying to recreate some binary file format for exchange with some other application.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 16:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816045#M20366</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-01T16:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816111#M20367</link>
      <description>&lt;P&gt;Be careful about using the IB8. format. Base SAS uses 8 byte floating point numeric data, which is only capable of storing 15 significant digits. If you try to convert one of these numbers using IB8., the result might be inaccurate.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 20:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816111#M20367</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2022-06-01T20:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Integer binary formats in CAS</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816206#M20368</link>
      <description>&lt;P&gt;Hi!&amp;nbsp;&amp;nbsp;First of all:&amp;nbsp; I use SAS Studio - which is in Linux. (NOT CAS - I was quite wrong). My falut!&amp;nbsp; Mea culpa!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your comment is QUITE good!&lt;/P&gt;
&lt;P&gt;I will look into that!&lt;/P&gt;
&lt;P&gt;Many thanks&amp;nbsp; &amp;nbsp;Anders&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2022 15:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Integer-binary-formats-in-CAS/m-p/816206#M20368</guid>
      <dc:creator>AndersS</dc:creator>
      <dc:date>2022-06-02T15:13:43Z</dc:date>
    </item>
  </channel>
</rss>

