<?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: How to revisit observations in DS2 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188885#M35679</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is a &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.1428575515747px; background-color: #ffffff;"&gt;&lt;EM&gt;non fixed and traverse-able data type&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 18:42:23 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-10-17T18:42:23Z</dc:date>
    <item>
      <title>How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188874#M35668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I wonder whether it is possible to revisit observations with DS2. The condition is that I don't know beforehand how many times I will revisit an observation. This can be the case if for instance I use a newton raphson procedure to maximize a function, and I dont know how many iterations I need to get convergence. For each itereation I need to go through all observations. The reason why I want to use DS2 is to get access to the matrix package.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the ordinary datastep I know of two ways to get random access to observations: The open() function and the point= option. Simple examples of their use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test2; do obs=1 to 3;output;end;run;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; dsid=open('test2');&lt;/P&gt;&lt;P&gt;&amp;nbsp; call set(dsid);&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to attrn(dsid,'nobs');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obsid=fetchobs(dsid,j);&lt;/P&gt;&lt;P&gt; put obs=;&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to 2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do j=1 to 3 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set test2 point=j ;&lt;/P&gt;&lt;P&gt; put obs= ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; stop;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, none of these two methods are possible with DS2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 11:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188874#M35668</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-10-17T11:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188875#M35669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In DS2 you could get set key= functionality using the sqlstmt package&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:10:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188875#M35669</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-10-17T12:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188876#M35670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use the hash or hash iterator package. That should allow you to iterate through the data as many times as you need.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188876#M35670</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-10-17T12:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188877#M35671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have a lot of experience with DS2 - but isn't SQLSTMT only used in a Federation Server context?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:28:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188877#M35671</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-10-17T12:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188878#M35672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tought about that solution (the hash and iterator).&amp;nbsp; I think it will work in far most cases. Only problem is, that it require me to load all data into the a hash-object, which in worst case can cause some memory-problems. But it is not so difficult to implement, so I think I will try it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I under stand the suggestion from FriedEgg correct, then I need to create an index on my source data (which is not a problem), and the key= allow me to visit any observations as many times I want. I don't think it will work efficient enugh, my experience with indexes is that it becomes slow if I want to go through all observations in a large dataset. It is only efficient if I only want to look up a few observations from a possible large dataset.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188878#M35672</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-10-17T12:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188879#M35673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe - only believe - that what FriedEgg suggests would require the Federation Server. Is this how you're accessing your data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188879#M35673</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-10-17T13:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188880#M35674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are confusing some not necessarily related things.&amp;nbsp; The SAS Federation Server product and SAS FedSQL language.&amp;nbsp; Which, given their names and such, I don't blame you for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FedSQL is a implementation, by SAS, of ANSI SQL:1999, and attempts to be a 'vendor neutral SQL' that is compliant with most any DBMS that has a SQL interpreter.&amp;nbsp; FedSQL in SAS is used as the SQL language in PROC FEDSQL and PROC DS2.&amp;nbsp; These procedures and the FedSQL language are in no way dependent on the Federation Server product.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188880#M35674</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-10-17T14:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188881#M35675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All I am suggesting is that is it possible to emulate the function of using set with the key= option by using the SQLSTMT package in DS2.&amp;nbsp; The usefulness of said proposition is dependent on the situation at hand and can certainly lead to either excellent or very poor performance (or anywhere in between).&amp;nbsp; As mentioned, another option is to utilize the hash packages.&amp;nbsp; However, both of these choices clearly do not directly mimic set point=, which is certainly a functionality that seems beneficial to have available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188881#M35675</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-10-17T14:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188882#M35676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Good to know. I have definitely some more reading to do. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've seen the value of DS2 for CI implementations using the Federation Server and I start to understand some of the other areas where it could add value (proc hpds2). I haven't found a real life application in my own line of work yet. But that's may be only because I don't fully understand. Still hoping for some exciting white papers showing how it's actually used in practice (I know that some solutions use it "in the background").&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 14:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188882#M35676</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-10-17T14:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188883#M35677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, both, for your suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though, I tend to conclude that DS2 at present will make my program more complex and/or less timeefficient than an ordinary datastep. Even though DS2 has its matrix-package it is easier to write the code in ordinary datastep language (using my homemade matrix package &lt;A _jive_internal="true" href="https://communities.sas.com/ideas/1570"&gt;https://communities.sas.com/ideas/1570&lt;/A&gt;). That is of course not true in general, just for my present problem. It will be interesting to see how DS2 will be developed in the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 15:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188883#M35677</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-10-17T15:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188884#M35678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the most common tasks I utilize PROC DS2 for is model scoring.&amp;nbsp; Have seen significant benefits from the threading for these high compute tasks.&amp;nbsp; Semantically, I also really like DS2.&amp;nbsp; While it may take a few more lines of code to duplicate simple data steps, in many situations I find myself being able to overall reduce complexities, especially with highly recursive routines.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some additional stream of consciousness thought:&lt;/P&gt;&lt;P&gt;From what I gathered at SGF2014, a lot of focus in DS2 is being placed on integration with Hadoop.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am very excited about the recent release of the HTTP package and hope the ability to have non fixed and traverse-able data types will come soon so that I can start dynamically ingesting/creating and JSON and XML data to interact with WebService api's more simply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 17:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188884#M35678</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-10-17T17:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188885#M35679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fried,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is a &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.1428575515747px; background-color: #ffffff;"&gt;&lt;EM&gt;non fixed and traverse-able data type&lt;/EM&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 18:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188885#M35679</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-10-17T18:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188886#M35680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A better word may be, non-sized instead of fixed.&amp;nbsp; Is a hierarchical/self-defining data structure, such as JSON/XML that could be received in DS2 without necessary prior knowledge of it's size or components and then traversed as an iterable object to get the key/data components.&amp;nbsp; Similar to a hash object, in essence, where instead of putting a dataset into the object, I instead put a JSON/XML document into it...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 19:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188886#M35680</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-10-17T19:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188887#M35681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am missing the insights on programming language concepts. It is part of "applied computer science" &lt;A href="http://en.wikipedia.org/wiki/Computer_science" title="http://en.wikipedia.org/wiki/Computer_science"&gt;Computer science - Wikipedia, the free encyclopedia&lt;/A&gt; as are a lot of other dedicated area-s.&amp;nbsp; The association to a physical piece of hardware "the computer" may be is confusing. In my language the word "informatica" is used. Probably better as it about processing of information.&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Using an Array Hash or something is more a data-structure that can be supported by using a language. &lt;A href="http://en.wikipedia.org/wiki/Data_structure" title="http://en.wikipedia.org/wiki/Data_structure"&gt;Data structure - Wikipedia, the free encyclopedia&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For transmitting data you are needing conventions for getting meaningfull descriptions. JSOM and XML are examples of those &lt;A href="http://en.wikipedia.org/wiki/JSON" title="http://en.wikipedia.org/wiki/JSON"&gt;JSON - Wikipedia, the free encyclopedia&lt;/A&gt;. These are not of the same kind as data-structures within a programming language. Getting the objects well described is a pre-requisite for understanding them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SAS datastep language.&lt;/P&gt;&lt;P&gt;This indication of datastep is needed&amp;nbsp; as SAS is having a lot of languages in their eco-system. Every proc can be an own language on his own. Proc sql - proc ds2 as examples.&lt;/P&gt;&lt;P&gt;The datastep language is designed as a 4GL. It is different to Cobol/Fortran REXX and many more as it is processing the records in an automatic way, by that having a PDV.&lt;/P&gt;&lt;P&gt;The C-language is a weird one as it used to build OS it is more a 2GL (processor level) but also using the same style as Fortran as a 3GL.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With that sequential approach of the datastep language there are advantages and disadvantages.&lt;/P&gt;&lt;P&gt;Advantage: Sequential processing can be extremely efficient when all incoming and outgoing data is also sequential.&lt;/P&gt;&lt;P&gt;Disadvantage: There is a limit on throughput / speed as all actions are a sequential process, by that is missing the opportunity of parallel processing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mentioned REXX as a language as that one is very lazy on type declarations like the sas datasteps but it has no PDV. It has no automatic record advancing and by that can interpreted own code language instream. &lt;/P&gt;&lt;P&gt;The array and hash concepts are not of the 4gl within the PDV but of the 3GL level (like Fortran/Cobol). The difference on those concepts 3Gl 4Gl&amp;nbsp; is for many difficult to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DS2 language&lt;/P&gt;&lt;P&gt;The Proc DS2 is an own language. Some are based on the SCL (SAS/AF) as of methods/declarations. Some are using naming conventions being copies form "R" the packages.&lt;/P&gt;&lt;P&gt;It is an other approach not based on the assumption of sequential processing but supporting multi-threading and supporting more consistent DBMS types. &lt;/P&gt;&lt;P&gt;We will see how it will find a place for usage.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 12:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188887#M35681</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-19T12:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188888#M35682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I couldn't get the hash-object solution to work as intended. It is not a problem to define the hash-object and also easy enough to read data into it. But how do I let each thread read different parts of the hash-object. If I use an argument to the thread, then it is the same argument to all threads,&lt;/P&gt;&lt;P&gt;The goal is that the threads should work on different parts of the data - in a way so data can be revisited.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 17:18:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188888#M35682</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-11-10T17:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188889#M35683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jacob, that makes sense that the hash object is not shared between all different threads. It would only work in a&amp;nbsp; SAS dataset structure as the other threads in a RDBMS are out of reachable area for ds2. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 18:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188889#M35683</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-10T18:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188890#M35684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the only way to do it, is to load the hash object with the hash.add() method inside the thread (Do not use "datasource" when you declare the hash object! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thread my_thread; &lt;/P&gt;&lt;P&gt;method run();&lt;/P&gt;&lt;P&gt;set my_input;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;my_hash.add();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;endthread;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way all your hash objects in different threads will be different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And probably you will use the by statement as well. I think all this makes sense only if you do by group processing.&lt;/P&gt;&lt;P&gt;At the beginning of a group (first.group_var=1) you clear your hash object ( my_hash.clear() ).&lt;/P&gt;&lt;P&gt;At every read you just store the data in the hash object (my_hash.add()).&lt;/P&gt;&lt;P&gt;At the end of a group (last.group_var=1) you start to analyze data in the hash object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 20:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188890#M35684</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2014-11-10T20:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188891#M35685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gergely, The question would be can al threads share the same memory set up by one (hash is in memory).&lt;/P&gt;&lt;P&gt;This is requiring a sychronisation process with locking as in a RDBMS and a shared entrypoint for shared memory. I do not expect it is there. It are system programming techniques close to kernel level. The multi-users address spaces where dependent of those.&lt;/P&gt;&lt;P&gt;Of course you can define a hash in every thread, but it will fail in the benefits of hash usage (collecting all random events) while pushing pressure on the memory resource.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 20:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188891#M35685</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-10T20:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188892#M35686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;I agree with you. DS2 theards do not share memory.&lt;/P&gt;&lt;P&gt;But my reply was just a short answer/idea on this topic: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.8000001907349px; background-color: #ffffff;"&gt;"The goal is that the threads should work on &lt;STRONG&gt;different parts of the data&lt;/STRONG&gt;".&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 20:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188892#M35686</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2014-11-10T20:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to revisit observations in DS2</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188893#M35687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have succeeded now to write a program where I can revisit the observations. I have used the hash object which I define in each single thread as discussed above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the method is not time-efficient, but it was a fun experiment anyway&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;. I think the problem is that all threads use the same memory-resource (as Jaap points out).&amp;nbsp; I observe that all my four cpu's are in use during the process, but in total they use only about 25% of total cpu. The log shows that real time usage is only slightly smaller than cpu-time usage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An other problem is that it is not a very stable method. Most often it run without problems but crashes are not rare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have enclosed the program for those who are interested. It is a simple estimation of parameters in a logistic regression where I have a by-group variable.&lt;/P&gt;&lt;P&gt;(only made for test purpose, my real problem is far more complicated than logistic regression)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Nov 2014 23:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-revisit-observations-in-DS2/m-p/188893#M35687</guid>
      <dc:creator>JacobSimonsen</dc:creator>
      <dc:date>2014-11-15T23:24:14Z</dc:date>
    </item>
  </channel>
</rss>

