<?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: How to assign macro to the values in the first and the last row of the table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109537#M22736</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll add 2 "but if"s to Paige's post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are concerned about missing values in response_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old&lt;STRONG&gt;(where=(response_date ne .))&lt;/STRONG&gt; end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then call symputx('start_date',response_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then call symputx('end_date',response_date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the chronological start and end dates, and aren't sure that your dataset is sorted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=old ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var response_date ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=new min=day1 max=day2 ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set new ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('start_date',day1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('end_date,day2) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Feb 2013 16:51:37 GMT</pubDate>
    <dc:creator>willhunt</dc:creator>
    <dc:date>2013-02-14T16:51:37Z</dc:date>
    <item>
      <title>How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109534#M22733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am doing this in a length way so wondering is there is anything simpler - How do I keep only first row and the last row in a table? I need to assign a macro to the date value in the first row and another macro to the date value in last row of the Date variable. Example:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="64"&gt;Name&lt;/TD&gt;&lt;TD class="xl64" width="64"&gt;Response&lt;/TD&gt;&lt;TD class="xl64" width="64"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;01-Jan-13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;B&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;02-Jan-13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;02-Jan-13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;A&lt;/TD&gt;&lt;TD align="right"&gt;40&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;03-Jan-13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;C&lt;/TD&gt;&lt;TD align="right"&gt;40&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;03-Jan-13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I need two macros: &lt;STRONG&gt;Start_date&lt;/STRONG&gt; which should have 01-JAN-13 (whatever is the date value in the first row) and E&lt;STRONG&gt;nd_Date&lt;/STRONG&gt; 03-Jan-13 (whatever is the date value in the last row).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Approach:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; count(*) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; :last_obs from Old &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; not missing(response_date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: navy; font-family: 'Courier New';"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; New;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; old;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; not missing (response_date) &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; Days+&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: teal; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: navy; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; new2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; new;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; not missing (response_date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; days = &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; symput (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: 'Courier New';"&gt;'Start_Date'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;,response_date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; days=&amp;amp;last_obs &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; symput (&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: purple; font-family: 'Courier New';"&gt;'End_Date'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;,response_date);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; days;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &amp;amp;start_date; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt; &amp;amp;End_Date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: blue; font-family: 'Courier New';"&gt;endrsubmit&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; background: white; color: black; font-family: 'Courier New';"&gt;Thanks as always.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 15:18:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109534#M22733</guid>
      <dc:creator>sachin01663</dc:creator>
      <dc:date>2013-02-14T15:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109535#M22734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simple is in the eye of the beholder. What you have should work, so I'm not sure what the problem is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But here's my attempt ... (and by the way, you are assigning these date values to macro variables, not to macros as you state)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then call symputx('start_date',response_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then call symputx('end_date',response_date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 15:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109535#M22734</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-02-14T15:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109536#M22735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably need two steps if you don't want any missing values in macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*first, make sure no missing values*/ &lt;/P&gt;&lt;P&gt;Data new;&lt;/P&gt;&lt;P&gt;set old;&lt;/P&gt;&lt;P&gt;if not missing (response_date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*The second step only reads two obs, so it shouldn't slow you down much*/ &lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; do n=1,nobs;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set new nobs=nobs point=n;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if n=1 then call symputx('start_date',response_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if n=nobs then call symputx('end_date',response_date);&lt;/P&gt;&lt;P&gt; end;&lt;/P&gt;&lt;P&gt; stop;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 15:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109536#M22735</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2013-02-14T15:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109537#M22736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll add 2 "but if"s to Paige's post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are concerned about missing values in response_date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old&lt;STRONG&gt;(where=(response_date ne .))&lt;/STRONG&gt; end=eof;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_=1 then call symputx('start_date',response_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if eof then call symputx('end_date',response_date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the chronological start and end dates, and aren't sure that your dataset is sorted:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc summary data=old ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var response_date ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output out=new min=day1 max=day2 ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set new ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('start_date',day1) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx('end_date,day2) ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 16:51:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109537#M22736</guid>
      <dc:creator>willhunt</dc:creator>
      <dc:date>2013-02-14T16:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109538#M22737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you really just want the min/max non-missing dates:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;select&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; min(response_date) format=best20. as MinResponse,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; max(response_date) format=best20. as MaxResponse&lt;/P&gt;&lt;P&gt;into&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :Start_Date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,:End_Date&lt;/P&gt;&lt;P&gt;from have&lt;/P&gt;&lt;P&gt;where response_date is not null;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2013 17:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109538#M22737</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2013-02-14T17:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109539#M22738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without wondering too much about your end goal--or whether or not you even need to use a data step, rather than just peeking inside of the table, the following code should work. The table "old" is your original table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/***********************************************************&lt;/P&gt;&lt;P&gt;***********************************************************/&lt;/P&gt;&lt;P&gt;data new2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set old (where=(not missing (response_date))) end = my_last_obs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _N_ =1 then call symput ('Start_Date',response_date);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if my_last_obs then call symput ('End_Date',response_date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;start_date; %put &amp;amp;End_Date;&lt;/P&gt;&lt;P&gt;/***********************************************************&lt;/P&gt;&lt;P&gt;***********************************************************/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 15:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109539#M22738</guid>
      <dc:creator>optimist</dc:creator>
      <dc:date>2013-02-15T15:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign macro to the values in the first and the last row of the table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109540#M22739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. That's simpler than what I wrote. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Feb 2013 14:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-macro-to-the-values-in-the-first-and-the-last-row/m-p/109540#M22739</guid>
      <dc:creator>sachin01663</dc:creator>
      <dc:date>2013-02-17T14:50:19Z</dc:date>
    </item>
  </channel>
</rss>

