<?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: nested data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144784#M261900</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;A data step is boundary is met when another data statement is encountered and so data steps cannot be nested.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2013 12:11:47 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2013-11-15T12:11:47Z</dc:date>
    <item>
      <title>nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144783#M261899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to run nested data step in sas or &lt;/P&gt;&lt;P&gt;how to call a data step in another data step ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 09:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144783#M261899</guid>
      <dc:creator>gupta_shubham</dc:creator>
      <dc:date>2013-11-15T09:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144784#M261900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;A data step is boundary is met when another data statement is encountered and so data steps cannot be nested.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 12:11:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144784#M261900</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-11-15T12:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144785#M261901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is actually arguably possible to nest datastep with SAS9.2 but it requires tedious efforts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using PROC FCMP, you can create a routine that you can call in your outer data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the RUN_MACRO and dosubl tools in proc FCMP, you can force SAS to execute the inner data step that you would preemptively have wrapped in a macro. The RUN_MACRO allows you to execute the macro right away rather than piling it up to be executed at the end of your current data step like with call execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Typically, there would be other better ways around so if you are not an experienced SAS user, you would probably be better detailing the intention behind your code as there are very likely ways around that. However, if you are in for a nice self-learning experience, look into&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings12/227-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/227-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/227-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 12:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/144785#M261901</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-11-15T12:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756230#M261902</link>
      <description>&lt;P&gt;I don't know of a way to creating a nested data step but you can use PROC SQL and then create nested select statements. Something like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
	CREATE TABLE want AS
	(
		SELECT 
			*
		FROM have1
		WHERE var1 IN
		(
			SELECT var1 FROM have2 WHERE cond1 = 'THING'
		)
	);
QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 14:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756230#M261902</guid>
      <dc:creator>dakum_paul</dc:creator>
      <dc:date>2021-07-23T14:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756790#M261903</link>
      <description>&lt;P&gt;No need for FCMP.&amp;nbsp; You can put code into a string and then call it with DOSUBL inside a data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;

    rc = dosubl('proc format; value something 1=1; run;');
    rc = dosubl('proc format; value somethingelse 2=2; run;');
    
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see the SAS log for the executed code, but I don't know if it's possible to see the source lines as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 20:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756790#M261903</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2021-07-26T20:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: nested data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756792#M261904</link>
      <description>&lt;P&gt;There are several SAS Global Forum papers on dosubl:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/search/search_sgf.php?q=dosubl" target="_blank"&gt;https://www.lexjansen.com/search/search_sgf.php?q=dosubl&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start with papers by Rick Langston and Mike Rhoads, in addition to the paper by Jason Secosky that has already been mentioned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings13/032-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/032-2013.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings12/004-2012.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings12/004-2012.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 20:24:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/nested-data-step/m-p/756792#M261904</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2021-07-26T20:24:59Z</dc:date>
    </item>
  </channel>
</rss>

