<?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: SAS Programming Help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693615#M211529</link>
    <description>Wondering if my if statement looks right.&lt;BR /&gt;&lt;BR /&gt;data medicine;&lt;BR /&gt;input patient date;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;retain date2;&lt;BR /&gt;format date2 date9.;&lt;BR /&gt;&lt;BR /&gt;if first.patient then date2 = date;&lt;BR /&gt;else if not first.patient then date=date2;&lt;BR /&gt;else date2=date;</description>
    <pubDate>Thu, 22 Oct 2020 21:26:08 GMT</pubDate>
    <dc:creator>Curious4</dc:creator>
    <dc:date>2020-10-22T21:26:08Z</dc:date>
    <item>
      <title>SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693596#M211516</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://i.imgur.com/pT4ZZEE_d.webp?maxwidth=728&amp;amp;fidelity=grand" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do these steps in&amp;nbsp; this image but my code is not working very much.&lt;/P&gt;&lt;P&gt;Here's what I have&lt;/P&gt;&lt;PRE&gt;data medicine;
input patient date;


RETAIN date2 date9.;

datalines;
REC PATIENT DATE DATE2
1 1001 01FEB2009
2 1001 02FEB2009
3 1001 04FEB2009
4 1001 06FEB2009
5 1002 17FEB2009
6 1002 18FEB2009
7 1002 19FEB2009
8 1003 12FEB2009
9 1003 16FEB2009
10 1003 19FEB2009
;

I keep getting an error with my retain statement saying:

 172        data medicine;
 173        input patient date date2;
 174        
 175        
 176        RETAIN date2 date9.;
                         ______
                         22
                         201
 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, 
               a missing value, (, -, :, ;, _ALL_, _CHARACTER_, _CHAR_, _NUMERIC_.  
 
 ERROR 201-322: The option is not recognized and will be ignored.
 &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693596#M211516</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T19:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693597#M211517</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/351456"&gt;@Curious4&lt;/a&gt;&amp;nbsp; I am curious to know why you are formatting the date2 variable in a RETAIN statement?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693597#M211517</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-10-22T19:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693598#M211518</link>
      <description>Because thats what the assignment asked me to do in the image I posted.</description>
      <pubDate>Thu, 22 Oct 2020 19:10:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693598#M211518</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T19:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693599#M211519</link>
      <description>"We will create a variable date2 that we RETAIN, format this as dat9. (For printing)"</description>
      <pubDate>Thu, 22 Oct 2020 19:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693599#M211519</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T19:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693600#M211520</link>
      <description>Those are separate programming steps though. You need both a RETAIN and a FORMAT statement.&lt;BR /&gt;&lt;BR /&gt;retain date2;&lt;BR /&gt;format date2 date9.;</description>
      <pubDate>Thu, 22 Oct 2020 19:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693600#M211520</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-22T19:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693602#M211522</link>
      <description>&lt;P&gt;Some homework assignments from Prof. Kurt:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;determine if there is a format option available in a &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p0t2ac0tfzcgbjn112mu96hkgg9o.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;RETAIN&lt;/A&gt; statement&lt;/LI&gt;
&lt;LI&gt;find a &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=p0gct6ariiecuhn15jkq8pzfzgef.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;statement&lt;/A&gt; that lets you assign a FORMAT to a variable.&lt;/LI&gt;
&lt;LI&gt;find the option of an &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;INFILE&lt;/A&gt; statement that lets you skip a header line in the data&lt;/LI&gt;
&lt;LI&gt;explain the reason for reading only two columns, when three are present in the data&lt;/LI&gt;
&lt;LI&gt;see if you can find an &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=leforinforref&amp;amp;docsetTarget=n0verk17pchh4vn1akrrv0b5w3r0.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;informat&lt;/A&gt;&amp;nbsp;that lets you read a date value as a SAS date value&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Finishing these tasks will advance you a lot towards a better understanding of what's happening here.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:23:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693602#M211522</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-10-22T19:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693608#M211525</link>
      <description>&lt;P&gt;Some additional Hints:&lt;/P&gt;
&lt;P&gt;Do not place variable names in a DATALINES block.&lt;/P&gt;
&lt;P&gt;The first value in your data row is Rec &lt;STRONG&gt;not &lt;/STRONG&gt;PatientID (left to right on Input needs to match the data lines)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 19:47:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693608#M211525</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-22T19:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693611#M211526</link>
      <description>Thats how they did it in the image.</description>
      <pubDate>Thu, 22 Oct 2020 20:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693611#M211526</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T20:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693615#M211529</link>
      <description>Wondering if my if statement looks right.&lt;BR /&gt;&lt;BR /&gt;data medicine;&lt;BR /&gt;input patient date;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;retain date2;&lt;BR /&gt;format date2 date9.;&lt;BR /&gt;&lt;BR /&gt;if first.patient then date2 = date;&lt;BR /&gt;else if not first.patient then date=date2;&lt;BR /&gt;else date2=date;</description>
      <pubDate>Thu, 22 Oct 2020 21:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693615#M211529</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T21:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Programming Help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693620#M211532</link>
      <description>done. i think</description>
      <pubDate>Thu, 22 Oct 2020 21:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Programming-Help/m-p/693620#M211532</guid>
      <dc:creator>Curious4</dc:creator>
      <dc:date>2020-10-22T21:38:15Z</dc:date>
    </item>
  </channel>
</rss>

