<?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: Creating a time variable using age as a time scale in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-time-variable-using-age-as-a-time-scale/m-p/781008#M248906</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;How am i supposed to create this age-variable? I have the birth -date variable which is the following;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;bfoddat_SAS = input( put(X_bfoddat,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;YYMMDD8.&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Wow, this is confusing. You want the years (age) between this bfoddat_SAS variable and December 31, 2013? You have not stated that explicitly. Is that the question? Or have I misunderstood completely?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Side comment: there's really no point is adding _SAS to a variable name, every variable you use is a SAS variable. Save yourself some typing and save yourself the possibility of typographical errors by not adding _SAS to variable names.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 12:55:49 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-11-18T12:55:49Z</dc:date>
    <item>
      <title>Creating a time variable using age as a time scale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-time-variable-using-age-as-a-time-scale/m-p/781000#M248902</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The time variable must include the time for the end of the follow-up (31 dec 2013), regardless of the outcome. I am going to use age as a time-scale. So, the lowest age of age at;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;* ADHD diagnosis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;* emigration&lt;/P&gt;&lt;P&gt;* death&lt;/P&gt;&lt;P&gt;*&amp;nbsp; end of follow-up (31 dec 2013)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How am i supposed to create this age-variable? I have the birth -date variable which is the following;&amp;nbsp;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;bfoddat_SAS = input( put(X_bfoddat,&lt;SPAN class=""&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;), &lt;SPAN class=""&gt;YYMMDD8.&lt;/SPAN&gt;); the date is presented as: YYYYMMDD, and is numeric.&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;However i don't know how to create the age variable?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#0000FF"&gt;&lt;U&gt;&lt;SPAN class=""&gt;*Variable for emigration*;&lt;/SPAN&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; MTYP=:&lt;SPAN class=""&gt;'E'&lt;/SPAN&gt; &lt;SPAN class=""&gt;then&lt;/SPAN&gt; EM=&lt;SPAN class=""&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;else&lt;/SPAN&gt; EM=&lt;SPAN class=""&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;mig_year= (SUBSTR(MDATUM,&lt;SPAN class=""&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN class=""&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/SPAN&gt;));&lt;/P&gt;&lt;P class=""&gt;mig_year_num =input(mig_year,&lt;SPAN class=""&gt;&lt;STRONG&gt;4.&lt;/STRONG&gt;&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;age_mig=(mig_year_num-bfodar);&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;U&gt;*variabel for death*;&lt;/U&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;bfoddat_SAS = input( put(X_bfoddat,&lt;SPAN class=""&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;), &lt;SPAN class=""&gt;YYMMDD8.&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;dodsdatum_SAS= input (put(X_dodsdatum, &lt;SPAN class=""&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;),&lt;SPAN class=""&gt;YYMMDD8.&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt; dodsdatum_SAS ne &lt;SPAN class=""&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;then&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;age_dod=INT(YRDIF(bfoddat_SAS,dodsdatum_SAS,&lt;SPAN class=""&gt;'actual'&lt;/SPAN&gt;));&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 12:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-time-variable-using-age-as-a-time-scale/m-p/781000#M248902</guid>
      <dc:creator>hejhejehej</dc:creator>
      <dc:date>2021-11-18T12:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a time variable using age as a time scale</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-time-variable-using-age-as-a-time-scale/m-p/781008#M248906</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;How am i supposed to create this age-variable? I have the birth -date variable which is the following;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;bfoddat_SAS = input( put(X_bfoddat,&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;YYMMDD8.&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Wow, this is confusing. You want the years (age) between this bfoddat_SAS variable and December 31, 2013? You have not stated that explicitly. Is that the question? Or have I misunderstood completely?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Side comment: there's really no point is adding _SAS to a variable name, every variable you use is a SAS variable. Save yourself some typing and save yourself the possibility of typographical errors by not adding _SAS to variable names.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 12:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-time-variable-using-age-as-a-time-scale/m-p/781008#M248906</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-18T12:55:49Z</dc:date>
    </item>
  </channel>
</rss>

