<?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: Working with military time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399337#M278494</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Thank you but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;when I run a proc print; var, there is appropriate data in both variables, but an error in the new variable it created for participants.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2017 20:52:54 GMT</pubDate>
    <dc:creator>Lavdiff</dc:creator>
    <dc:date>2017-09-27T20:52:54Z</dc:date>
    <item>
      <title>Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399250#M278487</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;Here is the code below. Time1 is wake up time and time2 is sleep time, then getuptime is subtraction of the two variables. You can see in the proc print table that is seems to be working except for some errors in the actual table. I added the treatment for missing because that was causing some issues, but something is still wrong with it, and I cannot find the solution, can please someone point me to the right direction, thank you&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS where to find my data set*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;libname mydata '/courses/d6670be5ba27fe300' access=readonly;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;options nofmterr;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS what data set to use*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Data new; set mydata.addhealth_public4;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;proc sort; by AID;/*case id*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*1st KEEP Statement tells sas what variables to look at*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Keep AID Agegroup H4OD1M birthm H4ID5H H4ID6H H4SP1H H4SP1M H4SP1T H4SP2H H4SP2M H4SP2T H4SP3M H4SP3H H4SP3T H4SP4H H4SP4M H4SP4T H4SP5 H4SP6;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS what the older data set is to use*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Data new2; set mydata.addhealth_pds;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*2nd KEEP Statement tells sas what variables to look at*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Keep AID bio_sex NUMETHNIC H1GI4 H1GI6A H1GI6B H1GI6C H1GI6D;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;proc sort; by AID;/*case id*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;data withage; merge new new2;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*gives us the variable along with the label (note if the variable is in your code some place then it needs to be in your label*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Label&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;AID="unique identifier"&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*depression*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4ID5H="Have you been diagnosed with depression?" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&lt;SPAN class="contextualExtensionHighlight ms-border-color-neutralTertiary ms-bg-color-neutralLighter ident_1512_1549"&gt;H4ID6H="What age were you diagnosed?"&lt;/SPAN&gt; /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*sleep patterns*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP1H="On the days you go to work or school, what hour do you wake up?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP1M="On the days you go to work or school, what minute do you wake up?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&lt;SPAN class="contextualExtensionHighlight ms-border-color-neutralTertiary ms-bg-color-neutralLighter ident_1793_1834"&gt;H4SP1T="Do you usually wake up am or pm?"&lt;/SPAN&gt; /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP2H="On those days, what time do you ususally go to sleep the night before (Hours)?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP2M="On those days, what minute?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP2T="On those days, what time do you usually go to sleep {pm/am}" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP3M="On those days you don't have to get up at a certain time, when do you wake up {minute}?" /*Quantitative Ratio*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP3H="On those days you don't have to get up at a certain time, when do you wake up {hour}?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP3T="On those days you don't have to get up at a certain time, when do you wake up {am/pm}?" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP4H="On those days, what time do you go to sleep the night or day before {hour}?" /*Quantitative Interval*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP4M="On those days, What time do you go to sleep the night or day before {minute}?" /*Quantitative Ratio*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP4T="On those days, what time do you go to sleep the night or day before {am/pm}?" /*Catigorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP5="How often did you have trouble falling asleep?" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP6="How often did you have trouble staying asleep?" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*demographics*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4OD1M="birth month"&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;bio_sex="sex of participant" /*Categorical Nominal 1=Male 2=Female*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Agegroup="age of participant"/*Quantitative Ratio*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Ethnicity="Ethnicity of participant" /*Categorical Nominal*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;; /*semicolon only at end of LAST label*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*subsetting to exclude people that participated in wave I but not wave IV*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4OD1M GE 1 then birthm=1;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If birthm=1;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*treatment for missing data*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If bio_sex=6 then bio_sex=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4ID6H GE 97 then H4ID6H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4ID5H GE 6 then H4ID5H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1H GE 96 then H4SP1H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1M GE 96 then H4SP1M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1T GE 6 then H4SP1T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2H GE 96 then H4SP2H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2M GE 96 then H4SP2M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2T GE 6 then H4SP2T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP3H GE 96 then H4SP3H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP3M GE 96 then H4SP3M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP3T GE 6 then H4SP3T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP4H GE 96 then H4SP4H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP4M GE 96 then H4SP4M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP4T GE 6 then H4SP4T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;Agegroup=2008-H4OD1Y;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*creating secondary variable that is participants ethnicity (note this something that each of you&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;are going to want to have so you can describe your sample by ethnicity)*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;NUMETHNIC=SUM (of H1GI4 H1GI6A H1GI6B H1GI6C H1GI6D);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If NUMETHNIC GE 2 THEN ETHNICITY=1;/*MULTIPLE RACE/ETHNICITY ENDORSED*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE IF H1GI4=1 THEN ETHNICITY=2;/*HISPANIC OR LATINO*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE IF H1GI6B=1 THEN ETHNICITY=3;/*BLACK OR AFRICAN AMERICAN*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE IF H1GI6C=1 THEN ETHNICITY=4;/* AMERICAN INDIAN OR NATIVE AMERICAN*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE IF H1GI6D=1 THEN ETHNICITY=5;/*ASIAN OR PACIFIC ISLANDER*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE IF H1GI6A=1 THEN ETHNICITY=6; /*WHITE*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;ELSE ETHNICITY=7; /*OTHER*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*Subsetting*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If agegroup le 28; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*recode dummy codes*/ &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4ID6H NE 97 and H4ID6H=. then H4ID6H=0; /*skip*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;proc format ;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; picture miltime&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; low-high = '%0H%0M'&amp;nbsp; (datatype=time) ;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;run;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;data new;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;set mydata.addhealth_public4;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1H GE 96 then H4SP1H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1M GE 96 then H4SP1M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;IF H4SP1T GE 6 then H4SP1T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2H GE 96 then H4SP2H=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2M GE 96 then H4SP2M=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;If H4SP2T GE 6 then H4SP2T=.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; time1=hms(mod(h4sp1h,12),h4sp1m,0);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; if h4sp1t=2 then time1=time1+'12:00:00't;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; time2=hms(mod(h4sp2h,12),h4sp2m,0);&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; if h4sp2t=2 then time2=time2+'12:00:00't;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; getup_time=time1-time2;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp; format time1 time2 getup_time miltime4.;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;run;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS how to sort the data by id number*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;proc sort; by AID;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*proc print to check secondary variable*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*proc print; var time1 time2 getup_time;*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS that I want frequency tables and for what variables*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;proc freq; tables time1 time2 getup_time; /* H4SP1H H4SP1M H4SP1T H4SP2H H4SP2M H4SP2T&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;H4SP3H H4SP3M H4SP3T H4SP4H H4SP4M H4SP4T H4SP5 H4SP6 bio_sex H4ID5H H4ID6H WoScWake WoScSleep NoWoScWake NoWoScSleep */ &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;/*tells SAS to analyze the data*/&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;run&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;attached are the pics that show the table get up table with the error&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Calibri,sans-serif" size="2"&gt;&lt;SPAN&gt;&lt;FONT face="Georgia,serif" size="3" color="#1F497D"&gt;and the second one the log with no errors&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table with error" style="width: 450px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15461i93DD88AECE02AB66/image-size/large?v=v2&amp;amp;px=999" role="button" title="IMG_0937.JPG" alt="table with error" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;table with error&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log with no errors" style="width: 450px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/15462i291A266D5A954BA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="IMG_1249.JPG" alt="log with no errors" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;log with no errors&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399250#M278487</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-27T17:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399264#M278488</link>
      <description>&lt;P&gt;You forget to put in the proc print results (please paste into a box like the {i}&amp;nbsp; - "insert code" so that we can see monopitch font).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And please, instead of reporting "something is wrong", describe the problem (i.e. point out and unexpected result, and what you expected).&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399264#M278488</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-27T17:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399268#M278489</link>
      <description>&lt;P&gt;"Wrong" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399268#M278489</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-27T17:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399269#M278490</link>
      <description>will do thanks&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Sep 2017 17:24:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399269#M278490</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-27T17:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399270#M278491</link>
      <description>try to follow your link, it says page is not there.</description>
      <pubDate>Wed, 27 Sep 2017 17:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399270#M278491</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-27T17:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399278#M278492</link>
      <description>but that is the problem i that i cannot find why i am getting the error in the table that show the hours, the logs shows no errors, and after that point i am lost.</description>
      <pubDate>Wed, 27 Sep 2017 17:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399278#M278492</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-27T17:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399289#M278493</link>
      <description>&lt;P&gt;You have 3,491 cases with getup_time=ERRO.&amp;nbsp; I presume this is the unexpected result.&amp;nbsp; If so, please print out the input data for a few of those cases.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 18:14:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399289#M278493</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-27T18:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399337#M278494</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thank you but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;when I run a proc print; var, there is appropriate data in both variables, but an error in the new variable it created for participants.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 20:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399337#M278494</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-27T20:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399347#M278495</link>
      <description>&lt;P&gt;The either the algorithm for generating the new variable, or the format used to display it, are wrong.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make a sample of 2 or 3 offending records.&amp;nbsp; Run the program - but DON'T apply the format.&amp;nbsp; Remember, if you are using the user-defined format I proposed, it would not support negative values&amp;nbsp; (i.e. if you subtract the later time from the earlier time).&amp;nbsp; If your result var is negative, then you have to revisit either the format, or recalculte the var so it's never negative.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 21:44:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399347#M278495</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2017-09-27T21:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399356#M278496</link>
      <description>&lt;P&gt;How about providing some data just for a couple records that have "problems" and ONLY include the time related elements and code to read and process them. We do not need to see demographics and pick on the "usual" times to reduce the amount of stuff to look at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without having your data I'm willing to bet that the "minute" component of your times have 00 and 30 about equally split with 15 and 45 around half the number or 00 and 30 and that 00, 15, 30 and 45 comprise somewhere around 70 percent of your data.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 22:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399356#M278496</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-27T22:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399359#M278497</link>
      <description>&lt;P&gt;Check the value of your time variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format ;
  picture miltime low-high = '%0H%0M' (datatype=time) ;
run;
data TEST;
  retain A 1e3  B 1e99  C 1e99 ;
  putlog A= miltime. B= miltime. C= miltime.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This outputs ERROR since the value is invalid but doesnt generate an error.&lt;/P&gt;
&lt;P&gt;A=0016 B=ERROR C=ERROR&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 22:48:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399359#M278497</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-09-27T22:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399779#M278498</link>
      <description>Doing that, thank you!</description>
      <pubDate>Fri, 29 Sep 2017 13:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399779#M278498</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-29T13:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Working with military time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399780#M278499</link>
      <description>thank you, and checking...</description>
      <pubDate>Fri, 29 Sep 2017 13:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-military-time/m-p/399780#M278499</guid>
      <dc:creator>Lavdiff</dc:creator>
      <dc:date>2017-09-29T13:22:15Z</dc:date>
    </item>
  </channel>
</rss>

