<?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 How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701855#M214938</link>
    <description>&lt;P&gt;Good morning !&lt;/P&gt;&lt;P&gt;How to convert a field which has the format of&amp;nbsp;&amp;nbsp; MGBYTES.&amp;nbsp;&amp;nbsp;&amp;nbsp; to bytes (only numbers) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes i have entries like "100k",&amp;nbsp; sometimes entries like "35M" and I&amp;nbsp; would like to standardize all values to Bytes (only numbers).&lt;/P&gt;&lt;P&gt;Any ideas please ?&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 16:40:15 GMT</pubDate>
    <dc:creator>knobwan</dc:creator>
    <dc:date>2020-11-26T16:40:15Z</dc:date>
    <item>
      <title>How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701855#M214938</link>
      <description>&lt;P&gt;Good morning !&lt;/P&gt;&lt;P&gt;How to convert a field which has the format of&amp;nbsp;&amp;nbsp; MGBYTES.&amp;nbsp;&amp;nbsp;&amp;nbsp; to bytes (only numbers) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes i have entries like "100k",&amp;nbsp; sometimes entries like "35M" and I&amp;nbsp; would like to standardize all values to Bytes (only numbers).&lt;/P&gt;&lt;P&gt;Any ideas please ?&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:40:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701855#M214938</guid>
      <dc:creator>knobwan</dc:creator>
      <dc:date>2020-11-26T16:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701858#M214940</link>
      <description>&lt;P&gt;Look at the proc contents of the dataset with that variable.&amp;nbsp; Is it numeric or character?&amp;nbsp; If it is numeric with the SIZEKMG format attached to it then just use a different format for displaying the values.&lt;/P&gt;
&lt;P&gt;If it is character do you want to&amp;nbsp;make a new variable that has a number in it?&amp;nbsp;Or change the strings in the current variable?&amp;nbsp; If the latter is the variable defined long enough to store the longer strings it will require?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 17:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701858#M214940</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-26T17:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701859#M214941</link>
      <description>&lt;P&gt;Separate the string into a number and the "unit" part with the help of the NOTDIGIT function.&lt;/P&gt;
&lt;P&gt;INPUT the number, and use an informat to convert the unit to a multiplicator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By supplying example data in usable form (data step with datalines), you make it easy for us to come up with code suggestions.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 17:08:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701859#M214941</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-26T17:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701874#M214944</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Proc contents shows this :&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;VARIABLE TYPE  LEN  FORMAT
-------- ----- --- ---------
SIZEA     NUM   5   MGBYTES.&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="2"&gt;I'm basically printing this variable with put in the output file: &lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;DATA _NULL_;
SET ;
FILE FOUT NOPRINT ;

IF _N_ = 1 THEN DO ;
  PUT 'SYSTEM|'
      'SIZE|';&lt;BR /&gt;&lt;BR /&gt;PUT SYSTEM '|'
     SIZEA '|';

RUN;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="2"&gt;I also checked the NOTDIGIT.. but my sas experience is limited. No clue on how to use to have the number converted to bytes.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 19:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701874#M214944</guid>
      <dc:creator>knobwan</dc:creator>
      <dc:date>2020-11-26T19:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701875#M214945</link>
      <description>&lt;P&gt;Since your variable is numeric, just remove the format with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;format sizea;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the data step.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 19:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701875#M214945</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-26T19:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701882#M214948</link>
      <description>&lt;P&gt;The code didn't end in error. But issue a warning and printed the same values... 300K, 50M&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701882#M214948</guid>
      <dc:creator>knobwan</dc:creator>
      <dc:date>2020-11-26T20:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a field which is formatted as MGBYTES.  to bytes (only numbers) ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701885#M214951</link>
      <description>&lt;P&gt;Please post the complete log of the step. Copy/paste it into a window opened with the &amp;lt;/&amp;gt; button.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:08:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-a-field-which-is-formatted-as-MGBYTES-to-bytes/m-p/701885#M214951</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-26T20:08:23Z</dc:date>
    </item>
  </channel>
</rss>

