<?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: Is it possible to get the data in ONE data step? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277960#M55880</link>
    <description>&lt;P&gt;I'm lat to this discussion, but just wanted to point ouf that the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;sampleID&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;doesn't do what you think it does. You might as well use &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed=2;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;which is equivalent, since &lt;A href="http://blogs.sas.com/content/iml/2012/01/30/random-number-seeds-only-the-first-seed-matters.html" target="_self"&gt;the first call to RANNOR sets the seed &lt;/A&gt;to be 2 and all subsequent seeds are ignored.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jun 2016 16:26:23 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2016-06-16T16:26:23Z</dc:date>
    <item>
      <title>Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277572#M55755</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure I should post this here or in IML. My question is quite simple: for the below code with 3 data steps I get data UV1, however could I reach the same target with ONLY ONE data step? I tried the Call Streaminit, but it seems I can't reach my expectation. Please help me if you can. Appreciated!!!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let n_patient=25;/*Half NUmber of subjects enrolled*/
%let loop=20;/*Total number of loops conducted in the simulation*/
/***First Group***/
%let sigma1=1.5;/*Patient group sigma*/
%let sigma0=1;/*Healthy group sigma*/
%let mu1=1;   /*Patient group mean of measurements*/
%let mu0=0;   /*Healthy group mean of measurements*/
/***2nd Group***/
%let sigma1_=1.5;/*Patient group sigma*/
%let sigma0_=1;/*Healthy group sigma*/
%let mu1_=1;   /*Patient group mean of measurements*/
%let mu0_=0;   /*Healthy group mean of measurements*/
/***END***/

/***Sample 1 theory values***/
%let AUC_Theory=%sysfunc(round(%sysfunc(probnorm(%sysevalf((&amp;amp;mu1.-&amp;amp;mu0.)/%sysfunc(sqrt(%sysevalf(&amp;amp;sigma1.**2+&amp;amp;sigma0.**2)))))),0.00001));

/***Sample 2 theory values;***/
%let AUC_Theory_=%sysfunc(round(%sysfunc(probnorm(%sysevalf((&amp;amp;mu1_.-&amp;amp;mu0_.)/%sysfunc(sqrt(%sysevalf(&amp;amp;sigma1_.**2+&amp;amp;sigma0_.**2)))))),0.00001));

%put &amp;amp;AUC_Theory;
%put AUC_Theory=&amp;amp;AUC_Theory.
     sigma1=&amp;amp;sigma1.;


***%let cor=10;/*Number of correlation coefficients used; Correlation coefficient =rho/10*/


data UV0;
	do sampleID=1 to &amp;amp;loop.;
      do i=1 to &amp;amp;n_patient.;
                   seed=2**sampleID;
				   U=rannor(seed);
				   V=rannor(seed);
			       goldstandard_P=1;
				   goldstandard_H=0;
				   output;
		  end;
		end;
run;
/*Used to calculate Sample 1;**/
data UV0_1;
	set UV0;
    do rho=0,1;
	    output;
	end;
run;


/*Calculate the measurement for sample 1;*/

data UV1(keep=sampleID rho i U V SBJ1N_P SBJ1N_H goldstandard_P goldstandard_H);
    set UV0_1;
		sigma1=&amp;amp;sigma1.;
		sigma0=&amp;amp;sigma0.;
		mu1=&amp;amp;mu1.;
		mu0=&amp;amp;mu0.;
		SBJ1N_P=sigma1*U+mu1;
		SBJ1N_H=sigma0*((rho/10)*U+sqrt(1-(rho/10)**2)*V)+mu0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jun 2016 14:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277572#M55755</guid>
      <dc:creator>Jack2012</dc:creator>
      <dc:date>2016-06-15T14:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277575#M55757</link>
      <description>&lt;P&gt;Cant test at the moment, but I seen no reason you can't just move the code into one datastep?&lt;/P&gt;
&lt;PRE&gt;data UV0;
  do sampleID=1 to &amp;amp;loop.;
    do i=1 to &amp;amp;n_patient.;
      do rho=0,1;
        seed=2**sampleID;
        U=rannor(seed);
        V=rannor(seed);
        goldstandard_P=1;
        goldstandard_H=0;
        sigma1=&amp;amp;sigma1.;
	sigma0=&amp;amp;sigma0.;
	mu1=&amp;amp;mu1.;
	mu0=&amp;amp;mu0.;
	SBJ1N_P=sigma1*U+mu1;
	SBJ1N_H=sigma0*((rho/10)*U+sqrt(1-(rho/10)**2)*V)+mu0;
        output;
      end;
    end;
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jun 2016 14:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277575#M55757</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-06-15T14:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277581#M55758</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xUV1(keep=sampleID rho i U V SBJ1N_P SBJ1N_H goldstandard_P goldstandard_H);
   do sampleID=1 to &amp;amp;loop.;
      do i=1 to &amp;amp;n_patient.;
         seed=2**sampleID;
         U=rannor(seed);
         V=rannor(seed);
         goldstandard_P=1;
         goldstandard_H=0;
         do rho=0,1;
      		sigma1=&amp;amp;sigma1.;
      		sigma0=&amp;amp;sigma0.;
      		mu1=&amp;amp;mu1.;
      		mu0=&amp;amp;mu0.;
      		SBJ1N_P=sigma1*U+mu1;
      		SBJ1N_H=sigma0*((rho/10)*U+sqrt(1-(rho/10)**2)*V)+mu0;
            output;
            end;
         end;
      end;
   run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It tested by running PROC COMPARE against your UV1.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 14:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277581#M55758</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-06-15T14:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277582#M55759</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Do you mean you want to move PROBNORM calls into the data step&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What has STREAMINIT got to do with RANNOR?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2016 14:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277582#M55759</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2016-06-15T14:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277739#M55807</link>
      <description>&lt;P&gt;Many thanks for your swift action. Call streaminit is used when the randomoization number is generated by the RAND function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does has no relationship with RANNOR function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you have produced the right results in your previous post.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277739#M55807</guid>
      <dc:creator>Jack2012</dc:creator>
      <dc:date>2016-06-16T02:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277740#M55808</link>
      <description>&lt;P&gt;This is the original code I used. And this is not what I wanted to see.&lt;/P&gt;
&lt;P&gt;Anyhow you have changed the code and meet my expectation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks again for your quick response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jack.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:37:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277740#M55808</guid>
      <dc:creator>Jack2012</dc:creator>
      <dc:date>2016-06-16T02:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277741#M55809</link>
      <description>&lt;P&gt;The difficulty I faced is the vagueness of the control of the corder of the "Do rho=0 to 10" statement order coompare with with the do i=.. statement order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277741#M55809</guid>
      <dc:creator>Jack2012</dc:creator>
      <dc:date>2016-06-16T02:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277960#M55880</link>
      <description>&lt;P&gt;I'm lat to this discussion, but just wanted to point ouf that the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;sampleID&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;doesn't do what you think it does. You might as well use &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; seed=2;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token punctuation"&gt;which is equivalent, since &lt;A href="http://blogs.sas.com/content/iml/2012/01/30/random-number-seeds-only-the-first-seed-matters.html" target="_self"&gt;the first call to RANNOR sets the seed &lt;/A&gt;to be 2 and all subsequent seeds are ignored.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2016 16:26:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/277960#M55880</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-06-16T16:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to get the data in ONE data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/281973#M57242</link>
      <description>&lt;P&gt;Really? I am not aware of this. The intention is to generate different for each sampleID and I can reproduce this in the future. I will take a look at it more closely with your notification and adivce. Many thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jack&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jul 2016 09:46:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-it-possible-to-get-the-data-in-ONE-data-step/m-p/281973#M57242</guid>
      <dc:creator>Jack2012</dc:creator>
      <dc:date>2016-07-04T09:46:46Z</dc:date>
    </item>
  </channel>
</rss>

