<?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 How to stop the nested loop but carry on with the main loop till certain condition met. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-stop-the-nested-loop-but-carry-on-with-the-main-loop-till/m-p/549697#M152562</link>
    <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please help me to achieve something as below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;list1 contains a list of continuous and categorical variables altogether &amp;amp; sublist contains only continuous variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the sublist contains more then 2 variables then 'else do' step runs&amp;nbsp;twice or more.&lt;/P&gt;&lt;P&gt;Would it be possible to put a stop or condition on the 'J'&amp;nbsp; loop that it should&amp;nbsp;only run once for list1 variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;i =&amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%sysfunc&lt;/SPAN&gt;(countw(&amp;amp;list1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;j =&amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%sysfunc&lt;/SPAN&gt;(countw(&amp;amp;sublist));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;main&amp;amp;i. =&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%scan&lt;/SPAN&gt;(&amp;amp;list1,&amp;amp;i,&lt;SPAN style="color: blue;"&gt;%str&lt;/SPAN&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;sub&amp;amp;j. =&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%scan&lt;/SPAN&gt;(&amp;amp;sublist,&amp;amp;j,&lt;SPAN style="color: blue;"&gt;%str&lt;/SPAN&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;amp;&amp;amp;main&amp;amp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;.&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;= &amp;amp;&amp;amp;sub&amp;amp;&lt;SPAN style="color: teal;"&gt;j.&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%then&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green;"&gt;/*Some steps */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%else&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/**other steps**/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 16:37:10 GMT</pubDate>
    <dc:creator>Sami1234</dc:creator>
    <dc:date>2019-04-09T16:37:10Z</dc:date>
    <item>
      <title>How to stop the nested loop but carry on with the main loop till certain condition met.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-stop-the-nested-loop-but-carry-on-with-the-main-loop-till/m-p/549697#M152562</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you please help me to achieve something as below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;list1 contains a list of continuous and categorical variables altogether &amp;amp; sublist contains only continuous variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the sublist contains more then 2 variables then 'else do' step runs&amp;nbsp;twice or more.&lt;/P&gt;&lt;P&gt;Would it be possible to put a stop or condition on the 'J'&amp;nbsp; loop that it should&amp;nbsp;only run once for list1 variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;i =&amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%sysfunc&lt;/SPAN&gt;(countw(&amp;amp;list1));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;j =&amp;nbsp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;1&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%to&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%sysfunc&lt;/SPAN&gt;(countw(&amp;amp;sublist));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;main&amp;amp;i. =&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%scan&lt;/SPAN&gt;(&amp;amp;list1,&amp;amp;i,&lt;SPAN style="color: blue;"&gt;%str&lt;/SPAN&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;sub&amp;amp;j. =&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%scan&lt;/SPAN&gt;(&amp;amp;sublist,&amp;amp;j,&lt;SPAN style="color: blue;"&gt;%str&lt;/SPAN&gt;( ));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;amp;&amp;amp;main&amp;amp;&lt;STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal;"&gt;.&lt;/SPAN&gt;&lt;/STRONG&gt;&amp;nbsp;= &amp;amp;&amp;amp;sub&amp;amp;&lt;SPAN style="color: teal;"&gt;j.&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%then&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green;"&gt;/*Some steps */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%else&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;&amp;nbsp;&lt;SPAN style="color: blue;"&gt;%do&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/**other steps**/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue;"&gt;%end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 16:37:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-stop-the-nested-loop-but-carry-on-with-the-main-loop-till/m-p/549697#M152562</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2019-04-09T16:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to stop the nested loop but carry on with the main loop till certain condition met.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-stop-the-nested-loop-but-carry-on-with-the-main-loop-till/m-p/549771#M152596</link>
      <description>&lt;P&gt;Actually,&amp;nbsp;it's sorted now by removing the second nested loop. and only comparing the variable list in sublist with the first list.&lt;/P&gt;&lt;P&gt;if yes then first step otherwise the other step.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 18:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-stop-the-nested-loop-but-carry-on-with-the-main-loop-till/m-p/549771#M152596</guid>
      <dc:creator>Sami1234</dc:creator>
      <dc:date>2019-04-09T18:53:05Z</dc:date>
    </item>
  </channel>
</rss>

