<?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: Calculation required in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309618#M66683</link>
    <description>Dear Reeze ,&lt;BR /&gt;I have mention that i need the following as output&lt;BR /&gt;;&lt;BR /&gt;I am trying to create a character variable of length 15 called birthdead.&lt;BR /&gt;&lt;BR /&gt;Should be calculated as birthyear-deadyear if both values are present and&lt;BR /&gt;birthyear - if the person is still present.&lt;BR /&gt;&lt;BR /&gt;My data given is dates of birth and died in the form mm/dd/yyyy and some dates in yyyy.&lt;BR /&gt;I need to handle both cases.&lt;BR /&gt;&lt;BR /&gt;I also want that the not equal relation can be specified using ^= or ne in case it is needed.</description>
    <pubDate>Sun, 06 Nov 2016 20:24:08 GMT</pubDate>
    <dc:creator>azee007</dc:creator>
    <dc:date>2016-11-06T20:24:08Z</dc:date>
    <item>
      <title>FInding values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309561#M66638</link>
      <description>&lt;P&gt;I am trying create a character variable of length 15 called birthdead&lt;U&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be calculated as birthyear-diedyear if both values are present and&lt;/P&gt;&lt;P&gt;birthyear - if the person is still present.&lt;/P&gt;&lt;P&gt;My data given is dates of birth and died in the form mm/dd/yyyy and some dates in&amp;nbsp;yyyy.I need to handle both cases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also want that the not equal relation can be specified using ^= or ne in case it is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was reading different posted questions , but could find anything related to my query- Can anybody help - It would really make my concepts clear .&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 02:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309561#M66638</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T02:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: FInding values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309564#M66641</link>
      <description>&lt;P&gt;Let's create a test data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;length birth_x death_x $10;&lt;/P&gt;
&lt;P&gt;infile datalines dlm=',' ;&lt;/P&gt;
&lt;P&gt;input birth_x $ death_x $;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;1896,1965&lt;/P&gt;
&lt;P&gt;1903,08/25/1999&lt;/P&gt;
&lt;P&gt;12/15/1980,02/28/2015&lt;/P&gt;
&lt;P&gt;03/21/1960,&lt;/P&gt;
&lt;P&gt;08/06/2012,&lt;/P&gt;
&lt;P&gt;; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro&lt;SPAN&gt; dt_convert&lt;/SPAN&gt; (dtx , dt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if length(&amp;amp;dtx) = 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;then &amp;amp;dt = mdy(01,01,input(&amp;amp;dtx,4.));&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else &amp;amp;dt = input(&amp;amp;dtx , mmddyy10.);&lt;/P&gt;
&lt;P&gt;%mend dt_convert;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length&amp;nbsp;&lt;SPAN&gt;birthdead $10;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %&lt;SPAN&gt;dt_convert(birth_x , birth_date);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(death_x , death_date);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if death_date = . then&amp;nbsp;birthdead = put(year(birth_date),4.);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&amp;nbsp;birthdead = catx('-' , year(birth_date), year(death_date));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; format birth_date death_date mmddyy10.;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; drop birth_x death_x;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 03:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309564#M66641</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T03:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: FInding values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309566#M66642</link>
      <description>There are following errors coming in log&lt;BR /&gt;if died = . then birthdead = put(year(birth_date),4.);&lt;BR /&gt;_&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +,&lt;BR /&gt;',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN, LE, LT,&lt;BR /&gt;MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;&lt;BR /&gt;71 else birthdead = catx('-' , year(birth_dead), year(death_date));&lt;BR /&gt;72 drop birth_x death_x;&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 04:33:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309566#M66642</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T04:33:55Z</dc:date>
    </item>
    <item>
      <title>Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309574#M66652</link>
      <description>&lt;P&gt;I am trying&amp;nbsp;to create a character variable of length 15 called birthdead&lt;U&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/U&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be calculated as birthyear-deadyear if both values are present and&lt;/P&gt;&lt;P&gt;birthyear - if the person is still present.&lt;/P&gt;&lt;P&gt;My data given is dates of birth and died in the form mm/dd/yyyy and some dates in&amp;nbsp;yyyy.I need to handle both cases.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also want that the not equal relation can be specified using ^= or ne in case it is needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was reading different posted questions , but could find anything related to my query- Can anybody help - It would really make my concepts clear .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;Obs born&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; died&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1 1/7/1850 &amp;nbsp; &amp;nbsp; 7/04/1940&lt;/P&gt;&lt;P&gt;&amp;nbsp; 2 11/08/1928 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; 3 5/27/1877 &amp;nbsp;4/21/1936&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;4 1911 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1970&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;5 1918 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1950&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;6 4/1/1921 &amp;nbsp; &amp;nbsp; 3/14/99&lt;/P&gt;&lt;P&gt;&amp;nbsp;7 1944 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;8 1954 &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 05:53:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309574#M66652</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T05:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: FInding values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309579#M66651</link>
      <description>&lt;P&gt;I havn't used a variable named DIED.&lt;/P&gt;
&lt;P&gt;You have probably changed the code to addapt it to your needs.&lt;/P&gt;
&lt;P&gt;You may missed an ';' at the end of a previous statemant or have a typo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can't find the reason to the ERROR message, please post your full log.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 06:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309579#M66651</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T06:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309581#M66654</link>
      <description>&lt;P&gt;Include what you expect as output please.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, are your variables character or numeric in your dataset?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 06:41:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309581#M66654</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-06T06:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309582#M66655</link>
      <description>&lt;P&gt;You posted your input but not your full log or at least your full code.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 06:44:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309582#M66655</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T06:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309583#M66656</link>
      <description>and no need to repeat your first post.</description>
      <pubDate>Sun, 06 Nov 2016 06:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309583#M66656</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T06:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309589#M66660</link>
      <description>These are characters with length 10 each...I have used the following code.But getting lot of errors in log&lt;BR /&gt;&lt;BR /&gt;length birthdead $10;&lt;BR /&gt;%macro dt_convert (dtx , dt);&lt;BR /&gt;if length(&amp;amp;dtx) = 4&lt;BR /&gt;then &amp;amp;dt = mdy(01,01,input(&amp;amp;dtx,4.));&lt;BR /&gt;else &amp;amp;dt = input(&amp;amp;dtx , mmddyy10.);&lt;BR /&gt;%mend dt_convert;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;%dt_convert(birth_x , birth);&lt;BR /&gt;%dt_convert(dead_x , dead);&lt;BR /&gt;if died = . then birthdead = put(year(born,4.);&lt;BR /&gt;else birthdead = catx('-' , year(birth), year(dead));&lt;BR /&gt;drop birth_x dead_x;&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 14:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309589#M66660</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309591#M66662</link>
      <description>##- Please type your reply above this line. Simple formatting, no&lt;BR /&gt;attachments. -##Sentfrom my smartphone.&lt;BR /&gt;The length statement should be inside the datastep.  Probably all error&lt;BR /&gt;messages are the result of above error</description>
      <pubDate>Sun, 06 Nov 2016 15:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309591#M66662</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T15:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309614#M66680</link>
      <description>Dear Shmuel,&lt;BR /&gt;&lt;BR /&gt;I am using data want;&lt;BR /&gt;set have ;&lt;BR /&gt;then comes my code&lt;BR /&gt;and at the end run;&lt;BR /&gt;These are the basics of SAS ... I wanted to know if there is error in my code -If you find any ?&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309614#M66680</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T20:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309617#M66682</link>
      <description>&lt;P&gt;The macro definition should be out of the datastep.&lt;/P&gt;
&lt;P&gt;try next code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro dt_convert (dtx , dt);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if length(&amp;amp;dtx) = 4&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; then &amp;amp;dt = mdy(01,01,input(&amp;amp;dtx,4.));&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else &amp;amp;dt = input(&amp;amp;dtx , mmddyy10.);&lt;BR /&gt;%mend dt_convert;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length birthdead $10;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(birth_x , birth);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(dead_x , dead);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if died = . then birthdead = put(year(born,4.);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else birthdead = catx('-' , year(birth), year(dead));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;drop birth_x dead_x;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309617#M66682</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T20:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309618#M66683</link>
      <description>Dear Reeze ,&lt;BR /&gt;I have mention that i need the following as output&lt;BR /&gt;;&lt;BR /&gt;I am trying to create a character variable of length 15 called birthdead.&lt;BR /&gt;&lt;BR /&gt;Should be calculated as birthyear-deadyear if both values are present and&lt;BR /&gt;birthyear - if the person is still present.&lt;BR /&gt;&lt;BR /&gt;My data given is dates of birth and died in the form mm/dd/yyyy and some dates in yyyy.&lt;BR /&gt;I need to handle both cases.&lt;BR /&gt;&lt;BR /&gt;I also want that the not equal relation can be specified using ^= or ne in case it is needed.</description>
      <pubDate>Sun, 06 Nov 2016 20:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309618#M66683</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T20:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309619#M66684</link>
      <description>&lt;P&gt;I am getting the same log errors as before- Error 22 and 76.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if dead = . then birthdead = put(year(birth,4.);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +,&lt;BR /&gt;',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN, LE, LT,&lt;BR /&gt;MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;66 else birthdead = catx('-' , year(birth), year(dead));&lt;BR /&gt;67 drop birth_x dead_x;&lt;BR /&gt;68 run;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309619#M66684</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T20:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309620#M66685</link>
      <description>If you compare my last post to some previous you will find exact code written before.</description>
      <pubDate>Sun, 06 Nov 2016 20:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309620#M66685</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T20:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309621#M66686</link>
      <description>&lt;P&gt;&amp;nbsp;This line should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;if dead = . then birthdead = put(year(birth,4.),4.);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:35:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309621#M66686</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T20:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309622#M66687</link>
      <description>Dear Shmuel,&lt;BR /&gt;&lt;BR /&gt;Can you please explain me in much simpler form , as i couldnt understand what you are trying to tell me . I have been working on this code now for a long time ...but the requirement that :&lt;BR /&gt;&lt;BR /&gt;Should be calculated as birthyear-deadyear if both values are present and&lt;BR /&gt;birthyear - if the person is still present.&lt;BR /&gt;&lt;BR /&gt;My data given is dates of birth and dead in the form mm/dd/yyyy and some dates in yyyy.&lt;BR /&gt;I need to handle both cases.&lt;BR /&gt;&lt;BR /&gt;I also want that the not equal relation can be specified using ^= or ne in case it is needed.&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:38:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309622#M66687</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T20:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309623#M66688</link>
      <description>&lt;P&gt;Here is just the last datastep with some remarks added:&lt;/P&gt;
&lt;P&gt;I have just noticed a typo: you created variable DEAD but used variable DIED.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have changed it into - in bold letters - &lt;STRONG&gt;died&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length birthdead $10; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* assigning length to the new variable to create which shoulb be&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in a format of: &amp;nbsp;&lt;STRONG&gt;YYYY-YYYY&lt;/STRONG&gt; or just &lt;STRONG&gt;YYYY&lt;/STRONG&gt; */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(birth_x , birth); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* converting birth date from character to SAS numeric date */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(dead_x , &lt;STRONG&gt;died&lt;/STRONG&gt;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;/* converting death date from character to SAS numeric date */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &lt;STRONG&gt;died&lt;/STRONG&gt; = . then birthdead = put(year(born,4.); &amp;nbsp; /* assigning result value when no death date &amp;nbsp;= &amp;nbsp;just birth &lt;STRONG&gt;YYYY&lt;/STRONG&gt; */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else birthdead = catx('-' , year(birth), year(&lt;STRONG&gt;died&lt;/STRONG&gt;)); &amp;nbsp;/* assignung result as BIRTH-DEATH years: &lt;STRONG&gt;YYYY-YYYY&lt;/STRONG&gt; */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/* instead CATX function yo can write: &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* &amp;nbsp;left(year(birth)) || '-' || left(year(died)) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;drop birth_x dead_x; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* dropping that variables as not needed to keep on output */&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 20:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309623#M66688</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T20:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309624#M66689</link>
      <description>Do i have to use&lt;BR /&gt;%macro dt_convert (dtx , dt);&lt;BR /&gt;if length(&amp;amp;dtx) = 4&lt;BR /&gt;then &amp;amp;dt = mdy(01,01,input(&amp;amp;dtx,4.));&lt;BR /&gt;else &amp;amp;dt = input(&amp;amp;dtx , mmddyy10.);&lt;BR /&gt;%mend dt_convert;&lt;BR /&gt;&lt;BR /&gt;as i am using above code before the new code and still getting the same log erros&lt;BR /&gt;&lt;BR /&gt;if died = . then birthdead = put(year(birth,4.); /* assigning&lt;BR /&gt;_&lt;BR /&gt;22&lt;BR /&gt;&amp;#12;3 The SAS System 16:08 Sunday, November 6, 2016&lt;BR /&gt;&lt;BR /&gt;76&lt;BR /&gt;68 ! result value when no died date = just birth YYYY */&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, *, **, +,&lt;BR /&gt;',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;&amp;lt;, &amp;gt;=, AND, EQ, GE, GT, IN, LE, LT,&lt;BR /&gt;MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.&lt;BR /&gt;&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;</description>
      <pubDate>Sun, 06 Nov 2016 21:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309624#M66689</guid>
      <dc:creator>azee007</dc:creator>
      <dc:date>2016-11-06T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation required</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309625#M66690</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; set have;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; length birthdead $10; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(birth_x , birth); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %dt_convert(dead_x , &lt;STRONG&gt;died&lt;/STRONG&gt;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &lt;STRONG&gt;died&lt;/STRONG&gt; = . then birthdead = put(year(born,4&lt;STRONG&gt;.),4.); &amp;nbsp;&amp;nbsp;&amp;nbsp;/* sorry, my typo: correct this line: all brackest should be even)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else birthdead = catx('-' , year(birth), year(&lt;STRONG&gt;died&lt;/STRONG&gt;)); &amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;drop birth_x dead_x; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 21:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FInding-values/m-p/309625#M66690</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-11-06T21:19:55Z</dc:date>
    </item>
  </channel>
</rss>

