<?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: END OPTION in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559255#M10268</link>
    <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 May 2019 10:20:12 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2019-05-16T10:20:12Z</dc:date>
    <item>
      <title>END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559223#M10263</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the end=&amp;nbsp; options&lt;/P&gt;&lt;P&gt;in datastep can you give examples on this option&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ANAND&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 07:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559223#M10263</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-05-16T07:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559225#M10264</link>
      <description>&lt;P&gt;There could be many ways to use the end option, one of thing of end option is it identifies the last observation like in the example below&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set sashelp.class end=eof;
if eof then flag=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 08:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559225#M10264</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-05-16T08:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559230#M10266</link>
      <description>&lt;P&gt;See the &lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=p00hxg3x8lwivcn1f0e9axziw57y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=da" target="_self"&gt;Data Step Set Statement Documentation Page&lt;/A&gt;&amp;nbsp;and look at the &lt;STRONG&gt;END= Option&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, run the code below and check the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   do x=1 to 10;
      output;
   end;
run;

data want;
   set have end=end;
   lr=end;
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 May 2019 08:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559230#M10266</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-16T08:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559254#M10267</link>
      <description>&lt;P&gt;Thank u for your valuable&amp;nbsp; support&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 10:19:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559254#M10267</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-05-16T10:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559255#M10268</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 10:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559255#M10268</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2019-05-16T10:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: END OPTION</title>
      <link>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559339#M10279</link>
      <description>&lt;P&gt;A little more complicated example:&lt;/P&gt;
&lt;PRE&gt;data _null_;
   set work.rename end=LastName;
   if _n_ = 1 then do;
      Call execute ("Proc datasets library=&amp;amp;OutDataLib nodetails nolist;");
      Call execute ("modify &amp;amp;RenamedData;");
      Call execute ("rename ")  ;
   end;
   Call execute(catx(' ',name,' = ',newname)) ;
   if LastName then do;
      Call execute (";") ;
      Call execute ("quit;");
   end;
run;
&lt;/PRE&gt;
&lt;P&gt;The data set work.rename has a list of variable names that needed to be standardized so contains a Name and Newname variable.&lt;/P&gt;
&lt;P&gt;This code creates a call to proc datasets to change the names in place with the modify statement. So we need 1) the start of proc datasets with the library and data set names (strored in macro variables) and the start of a Rename block of code, 2) all of the name to newname pairs and 3) the End option comes in to generate the end of the Rename block and the call to Proc Datasets ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes the End option can be used to create a cntlin dataset for Proc Format to set the "other" value options for a format as you need a bit more than a simple list of start and label values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the Report Writing Interface for the data step the END option could be used to write what ever might appear at the bottom of any generated text.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 15:11:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/END-OPTION/m-p/559339#M10279</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-16T15:11:08Z</dc:date>
    </item>
  </channel>
</rss>

