<?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: %SYSCALL POKELONG. Memory allocation during SAS macro runtime. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425172#M104715</link>
    <description>&lt;P&gt;I expected this answer&amp;nbsp;&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; but no. And this can be exploited in SAS data step if actually possible to exploit in SAS, no need in pure SAS macro. I was just interested in possibility of memory management using pure SAS macro.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jan 2018 10:43:42 GMT</pubDate>
    <dc:creator>sspkmnd</dc:creator>
    <dc:date>2018-01-05T10:43:42Z</dc:date>
    <item>
      <title>%SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424984#M104663</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I need to allocate memory (directly in RAM), then write values to it, and then read them. There are a set of SAS functions usually references as APP:&amp;nbsp;ADDR, PEEK, PEEKC, the CALL POKE routine, and their so-called LONG 64-bit counterparts. There are several papers with many examples on how to do so:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings14/1510-2014.pdf" target="_self"&gt;Paper 1510-2014 Direct Memory Data Management Using the APP Tools&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://www2.sas.com/proceedings/sugi29/264-29.pdf" target="_self"&gt;SUGI 29 Paper 264-29 A-P-P Advanced Data Management Functions&lt;/A&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;but only in the case of using SAS data step. Allocation memory in this case is just declaring a variable (not really a runtime case, but at least something).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data debug;
    length v $200;
    pv = addrlong(v);
    call pokelong('just a value', pv);
    v2 = peekclong(pv);
    put 'address: ' pv $hex16.;
    put 'value:   ' v2;
run;

/*
address: 9FFFFFFFEC0A18B0
value:   just a value
*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;I need to "migrate" this to pure SAS macro. The first problem which I don't how to resolve is how to allocate memory - receive a pointer where I can write to. Does anyone have any ideas?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks and kind regards,&lt;/DIV&gt;&lt;DIV&gt;Igor&lt;/DIV&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424984#M104663</guid>
      <dc:creator>sspkmnd</dc:creator>
      <dc:date>2018-01-04T16:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424990#M104664</link>
      <description>&lt;P&gt;I don't see how you can.&amp;nbsp; Macro is&lt;U&gt;&lt;STRONG&gt; not&lt;/STRONG&gt;&lt;/U&gt; and executable language.&amp;nbsp; It is a text find replace system.&amp;nbsp; It is there to simplify the task of writing text, nothing else.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I would advise that if you having to use these kind of functions in the first place, there is something wrong with the process, and putting it into macro is only going to exacerbate your problems.&amp;nbsp; There are other ways of working with large numbers.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:57:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424990#M104664</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-04T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424995#M104665</link>
      <description>I think you need to explain more of what you're doing.  You're not going to be able to use the macro language in %SYSFUNC etc. to just write directly to random memory.  &lt;BR /&gt;&lt;BR /&gt;Can you post a short, runnable example of a function that you'd like to turn into pure macro language, and why you want to do so?</description>
      <pubDate>Thu, 04 Jan 2018 17:14:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/424995#M104665</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2018-01-04T17:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425112#M104699</link>
      <description>The code is in the question, I need to do the same using SAS macro: allocate memory, write to it, read it.</description>
      <pubDate>Fri, 05 Jan 2018 00:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425112#M104699</guid>
      <dc:creator>sspkmnd</dc:creator>
      <dc:date>2018-01-05T00:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425113#M104700</link>
      <description>Completely agree with you that question is kinda weird. But I am interested if this actually possible.</description>
      <pubDate>Fri, 05 Jan 2018 00:59:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425113#M104700</guid>
      <dc:creator>sspkmnd</dc:creator>
      <dc:date>2018-01-05T00:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425116#M104702</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27696"&gt;@sspkmnd&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Why? Is this just an experiment or is this for an actual use case? And if it's for an actual use case then can you please explain what you have and what you're actually trying to achieve? Using pokelong() etc. is something rarely done and needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt;&amp;nbsp;wrote it already but here again: SAS Macro language is your "automatic typewriter" allowing you to dynamically generate SAS code which then gets executed. Why does this need to be in a macro?&lt;/P&gt;
&lt;P&gt;If you just want to write your own function or call routine then may be have a look into Proc FCMP.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 01:41:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425116#M104702</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-01-05T01:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425145#M104711</link>
      <description>&lt;P&gt;What do you want to poke into memory?&lt;/P&gt;
&lt;P&gt;Are you trying to find a way to take advantage of the newly announce MELTDOWN security bug in INTEL processors?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 06:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425145#M104711</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-01-05T06:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: %SYSCALL POKELONG. Memory allocation during SAS macro runtime.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425172#M104715</link>
      <description>&lt;P&gt;I expected this answer&amp;nbsp;&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; but no. And this can be exploited in SAS data step if actually possible to exploit in SAS, no need in pure SAS macro. I was just interested in possibility of memory management using pure SAS macro.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 10:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SYSCALL-POKELONG-Memory-allocation-during-SAS-macro-runtime/m-p/425172#M104715</guid>
      <dc:creator>sspkmnd</dc:creator>
      <dc:date>2018-01-05T10:43:42Z</dc:date>
    </item>
  </channel>
</rss>

