<?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: Can I use a proc step within another proc step in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426510#M68359</link>
    <description>&lt;P&gt;This is what I have&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;proc nlmixed data = Work.final ;
  parms b0=0 b1=0;
  mu = exp(b0 + b1*Age);
  if SMD650 ~= 10 then
  ll = log(((mu**SMD650)*exp(-mu))/gamma(SMD650+1));
  else
  proc iml;
  v = {5,6,7,8,9,10,11,12,13,14};
  z = j(10,1,.);
  do i = 1 to 6;
   z[i] = ((v[i]-5)/5)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
  end;
  do i = 7 to 10;
   z[i] = ((v[i]-4)/4)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
  end;
  ll=log(sum(z));
  
  model SMD650 ~ general(ll);
run;	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words the second last line (model SND50...) is part of the proc nlmixed, the if statement is also part of proc nlmixed. but the else part will have to go through the proc iml. So they are intertwined in that I can not create out= because the proc nlmixed will not be complete without proc iml.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2018 15:58:11 GMT</pubDate>
    <dc:creator>john1111</dc:creator>
    <dc:date>2018-01-10T15:58:11Z</dc:date>
    <item>
      <title>Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426395#M68351</link>
      <description>I am writing a Proc nlmixed code and for my likelihood function I want to used some values generated from a proc iml procedure. So I am wondering if there is a way of using proc iml inside a proc nlmixed code.&lt;BR /&gt;I have read from support sas and I see I am being advised to use proc fcmp......Could someone give me an example if possible.&lt;BR /&gt;&lt;BR /&gt;proc nlmixed data = xxx;&lt;BR /&gt;parms b0=0 b1=0;&lt;BR /&gt;mu = exp(b0 + b1*Age);&lt;BR /&gt;ll = log(((mu**y)*exp(-mu))/gamma(y+1));&lt;BR /&gt;model y~ general(ll);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc iml;&lt;BR /&gt;v = {5,6,7,8,9,10,11,12,13,14};&lt;BR /&gt;z = j(10,1,.);&lt;BR /&gt;do i = 1 to 6;&lt;BR /&gt;z[i] = ((v[i]-5)/5)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);&lt;BR /&gt;end;&lt;BR /&gt;ll=log(sum(z));&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;The idea is to use mu from the first proc step inside the second proc step but the ll from both steps should be inside nlmixed&lt;BR /&gt;</description>
      <pubDate>Wed, 10 Jan 2018 12:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426395#M68351</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-01-10T12:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426426#M68352</link>
      <description>&lt;P&gt;No, its not possible.&amp;nbsp; From the proc iml you would save the output data;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/04/18/writing-data-from-a-matrix-to-a-sas-data-set.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2011/04/18/writing-data-from-a-matrix-to-a-sas-data-set.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would then use this output data, or merge it with other data and feed that into your proc mixed.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426426#M68352</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-10T13:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426437#M68353</link>
      <description>&lt;P&gt;You could use proc nlmixed insider proc iml.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc iml;&lt;/P&gt;
&lt;P&gt;.........&lt;/P&gt;
&lt;P&gt;submit ;&lt;/P&gt;
&lt;P&gt;proc nlmixed;&lt;/P&gt;
&lt;P&gt;......&lt;/P&gt;
&lt;P&gt;endsubmit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;calling&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 13:40:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426437#M68353</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-10T13:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426460#M68354</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; executing proc iml alone is not possible because it uses some data from proc nlmixed.....i.e. mu from the above code.</description>
      <pubDate>Wed, 10 Jan 2018 14:32:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426460#M68354</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-01-10T14:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426464#M68355</link>
      <description>&lt;P&gt;Then put an out= to create a dataset from the proc nlmixed and use that in your iml.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 14:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426464#M68355</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-01-10T14:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426504#M68358</link>
      <description>Its the other way round. proc iml inside proc nlmixed</description>
      <pubDate>Wed, 10 Jan 2018 15:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426504#M68358</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-01-10T15:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426510#M68359</link>
      <description>&lt;P&gt;This is what I have&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;proc nlmixed data = Work.final ;
  parms b0=0 b1=0;
  mu = exp(b0 + b1*Age);
  if SMD650 ~= 10 then
  ll = log(((mu**SMD650)*exp(-mu))/gamma(SMD650+1));
  else
  proc iml;
  v = {5,6,7,8,9,10,11,12,13,14};
  z = j(10,1,.);
  do i = 1 to 6;
   z[i] = ((v[i]-5)/5)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
  end;
  do i = 7 to 10;
   z[i] = ((v[i]-4)/4)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
  end;
  ll=log(sum(z));
  
  model SMD650 ~ general(ll);
run;	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In other words the second last line (model SND50...) is part of the proc nlmixed, the if statement is also part of proc nlmixed. but the else part will have to go through the proc iml. So they are intertwined in that I can not create out= because the proc nlmixed will not be complete without proc iml.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 15:58:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426510#M68359</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-01-10T15:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426827#M68384</link>
      <description>&lt;P&gt;Your 'proc iml' part does not contain any matrix operations, so you can implement it by using &lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_nlmixed_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_self"&gt;the programming statements that are supported by PROC NLMIXED&lt;/A&gt;. You can use the ARRAY statement to define the v array. The PROC NLMIXED syntax also supports a DO loop. Within a DO loop, you can accumulate the sum of z. You do not need z to be an array in order to compute sum(z).It might look something like this (untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc nlmixed data = Work.final ;
  array v[10];
  do i = 1 to 10;
     v[i] = i + 4;
   end;
  parms b0=0 b1=0;
  mu = exp(b0 + b1*Age);
  if SMD650 ~= 10 then
  ll = log(((mu**SMD650)*exp(-mu))/gamma(SMD650+1));
  else do;
     sum = 0;
     do i = 1 to 6;
      sum = sum + ((v[i]-5)/5)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
     end;
     do i = 7 to 10;
      sum = sum + ((v[i]-4)/4)*((mu**v[i])*exp(-mu))/gamma(v[i]+1);
     end;
     ll=log(sum);
  end;
  
  model SMD650 ~ general(ll);
run;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 10:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426827#M68384</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-11T10:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426840#M68386</link>
      <description>&lt;P&gt;Thanks a lot! this works perfectly but I can not figure out how I would add another else statement;&amp;nbsp; I mean if I have the following; How would I rearrange the commented section, with an inclusion array variable n.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;nlmixed&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; Work&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;final &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token statement"&gt;array&lt;/SPAN&gt; v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  do i &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; to &lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; i &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
   end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  parms b0&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt; b1&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  mu &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;b0 &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt; b1&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;Age&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; SMD650 &lt;SPAN class="token operator"&gt;~=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;10 and SMD650 ~=20&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt;
  ll &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;mu&lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;SMD650&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;mu&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;gamma&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;SMD650&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/**********&lt;BR /&gt;  else if SMD650= 20 then &lt;BR /&gt;  p=0;&lt;BR /&gt;&amp;nbsp; do n = 15 to 20;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; p = p+((n[i]-15)/5)*((mu**n[i])*exp(-mu))/gamma(n[i]+1);&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; do n= 21 to 24;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p = p+((24-n[i])/4)*((mu**n[i])*exp(-mu))/gamma(n[i]+1);&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;  ll=log(p)&lt;BR /&gt;*********/&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;
  &lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; do&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     &lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     do i &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;1&lt;/SPAN&gt; to &lt;SPAN class="token number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;5&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;mu&lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;mu&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;gamma&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     do i &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;7&lt;/SPAN&gt; to &lt;SPAN class="token number"&gt;10&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;mu&lt;SPAN class="token operator"&gt;**&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;exp&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;-&lt;/SPAN&gt;mu&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;gamma&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;v&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;+&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
     ll&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;log&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;sum&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  end&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  
  &lt;SPAN class="token procnames"&gt;model&lt;/SPAN&gt; SMD650 &lt;SPAN class="token operator"&gt;~&lt;/SPAN&gt; general&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;ll&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;	&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 11:25:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426840#M68386</guid>
      <dc:creator>john1111</dc:creator>
      <dc:date>2018-01-11T11:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use a proc step within another proc step</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426851#M68387</link>
      <description>&lt;P&gt;You must use a DO/END block with the IF-THEN/ELSE statement if you want the body of the IF/THEN to contain more than one statement. Notice&amp;nbsp;how I used DO/END in my example. In your example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;else if SMD650= 20 then DO;
   p=0; 
   /* put more statements here */
END;
else  DO;
   /* put more statements here */
END; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Jan 2018 12:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Can-I-use-a-proc-step-within-another-proc-step/m-p/426851#M68387</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-11T12:31:35Z</dc:date>
    </item>
  </channel>
</rss>

