<?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: About Ranuni function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570347#M160808</link>
    <description>&lt;P&gt;I don't think you have to use Ranuni here. Simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Two;
   set One;
   dayofdeath=(yrofdeath-1)*365+rand('integer', 1, 365);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Jul 2019 18:54:05 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-07-01T18:54:05Z</dc:date>
    <item>
      <title>About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570339#M160806</link>
      <description>&lt;P&gt;Hello programmers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset in which only the year of death relative to baseline (not the actual days till death ) is provided.&lt;/P&gt;&lt;P&gt;For example. If yrofdeath=1, the person died in year 0-1 (within 365&amp;nbsp; days);&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;if yrofdeath=2, the person died in year 1-2 (days 366-730)&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; If yrofdeath=3, the person died in year 2-3(731 -1096)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use a rauni function to assign the number of days until death based off the given yrofdeath in the dataset and to round it up using the round function. I have read papers and texts on ranuni but i have no idea how to approach this particular problem. How can i convert 0-1 to 0-365? I know for yrofdeath 2 and 3, i also have to add 365 and 730 respectively. How do i do this?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data one;
input site id yrofdeath cause;
datalines; 
3 1 2 195 
3 19 3 414 
3 26 2 431 
3 27 2 414 
3 29 1 414 
3 40 2 414 
3 42 3 188 
3 52 1 557 
3 55 3 429 
3 56 2 153 
3 56 2 153 
3 59 3   
3 67 2 496 
3 79 2 414 
3 80 3 440 
3 81 2 157 
3 82 2 199 
3 94 1 414 
3 95 1 414 
3 99 2 436 
3 105 1 507 
3 119 2 153 
3 127 1 414 
3 143 3 599 
3 145 3 410 
3 158 2 162 
3 165 1 496 
3 172 1 414 
3 177 3 481 
3 188 3 174 
3 199 3 414 
3 202 2 414 
3 203 1 185 
3 203 1 185 
3 211 3 518 
3 220 2 153 
3 223 2 154 
3 226 1 414 
3 233 2 429 
3 243 3 402 
3 251 1 145 
3 266 3 162 
3 269 3 429 
3 271 3 410 
3 274 3 414 
3 281 1 518 
3 289 3 575 
3 296 2 496 
; run;


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 18:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570339#M160806</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-01T18:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570347#M160808</link>
      <description>&lt;P&gt;I don't think you have to use Ranuni here. Simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Two;
   set One;
   dayofdeath=(yrofdeath-1)*365+rand('integer', 1, 365);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 18:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570347#M160808</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-01T18:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570348#M160809</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA Processed;
	Set One;
	IF YrOfDeath = 1 THEN DateDeath = RAND("integer",0,365);
	ELSE IF YrOfDeath = 2 THEN DateDeath = RAND("integer",366,730);
	ELSE DateDeath = RAND("integer",731, 1095);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570348#M160809</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-07-01T19:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570349#M160810</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;Your solution is superior as it will work for any year of death and not restricted to 1, 2 and 3. Simple and elegant solution.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570349#M160810</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-07-01T19:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570351#M160811</link>
      <description>&lt;P&gt;Glad you like it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570351#M160811</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-07-01T19:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570356#M160812</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:13:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570356#M160812</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-01T19:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: About Ranuni function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570357#M160813</link>
      <description>&lt;P&gt;Thank you very much for the solution!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 19:14:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/About-Ranuni-function/m-p/570357#M160813</guid>
      <dc:creator>ChuksManuel</dc:creator>
      <dc:date>2019-07-01T19:14:28Z</dc:date>
    </item>
  </channel>
</rss>

