<?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: Missing Observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927783#M41654</link>
    <description>&lt;P&gt;If you are surprised that this block is resulting in the value "Missing":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE fast = "Missing";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could change it to e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE IF missing(v51) then fast="Missing";
    ELSE put "ERROR: Surprising value for v51 " v51= ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will write an error message to your log whenever the value of v51 is not one of the values you are expecting. Typically I tried to avoid using an ELSE statement that does anything other than write an ERROR message, because you never know what odd values may lurk in your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;showed in SAS you do not need to create new character variables to create these sorts of labeled categories.&amp;nbsp; A SAS format will do it for you, and is much more flexible.&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2024 21:55:04 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2024-05-09T21:55:04Z</dc:date>
    <item>
      <title>Missing Observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927780#M41652</link>
      <description>&lt;P&gt;Hi SAS Coders:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to change numeric observations into character so I can do my analysis, but it is showing blank observations for these variables:&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 528pt; border-spacing: 0px; border-image: initial; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" border="0" width="704" cellspacing="0" cellpadding="0" aria-label="Data Set WORK.CLEANDATA"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 26.25pt;"&gt;
&lt;TD width="64" height="35" class="xl65" style="height: 26.25pt; width: 48pt;"&gt;Obs&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;fast&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;purge&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;language&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;age_group&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;sex_category&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;ethnicity&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;USBorn&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;slimfast&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;DescribeWt&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="width: 48pt;"&gt;HomeEnv&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;VeryOver&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;2&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SlghtOve&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;3&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Miss&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Mis&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;Missing&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;4&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;5&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SltUnder&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;6&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;7&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;8&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SlghtOve&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;9&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SltUnder&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl71" style="height: 15.0pt; width: 48pt;"&gt;10&lt;/TD&gt;
&lt;TD width="64" class="xl72" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl72" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl74" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I know the observations are in fact numeric as it says "1" and "2" in the dataset&lt;/P&gt;
&lt;P&gt;My code is this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.CLEANDATA;
    SET YRRSIMPT.import;

    /* Categorize age */
    IF age &amp;lt; 11 THEN age_group = "&amp;lt;11";
    ELSE IF age = 12 THEN age_group = "12";
    ELSE IF age = 13 THEN age_group = "13";
    ELSE IF age = 14 THEN age_group = "14";
    ELSE IF age &amp;gt;= 15 THEN age_group = "14+";
    ELSE age_group = "Missing";
    
     /* Categorize sex */
    IF sex = 1 THEN sex_category = "Female";
    ELSE IF sex = 2 THEN sex_category = "Male";
    ELSE sex_category = "Missing";
    
    IF v4 = 1 THEN ethnicity = "Hisp";
    ELSE IF v4 = 2 THEN ethnicity = "NonHisp";
    ELSE ethnicity = "Missing";
    
     /* Categorize v66 (USBorn) */
    IF v66 = 1 THEN USBorn = "&amp;lt;1Yr";
    ELSE IF v66 = 2 THEN USBorn = "1-3Yrs";
    ELSE IF v66 = 3 THEN USBorn = "4-6Yrs";
    ELSE IF v66 = 4 THEN USBorn = "6+Yr";
    ELSE IF v66 = 5 THEN USBorn = "Life";
    ELSE USBorn = "Missing";
    
     /* Categorize v51 */
    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE fast = "Missing";
    
    /* Categorize v52 */
    IF v52 = 1 THEN purge = "Yes";
    ELSE IF v52 = 2 THEN purge = "No";
    ELSE purge = "Missing";
    
      /* Categorize v53 */
    IF v53 = 1 THEN slimfast = "Yes";
    ELSE IF v53 = 2 THEN slimfast = "No";
    ELSE slimfast = "Missing";
    
    IF v49 = 1 THEN DescribeWt = "VUnderWt";
    ELSE IF v49 = 2 THEN DescribeWt = "SltUnder";
    ELSE IF v49 = 3 THEN DescribeWt = "Right";
    ELSE IF v49 = 4 THEN DescribeWt = "SlghtOver";
    ELSE IF v49 = 5 THEN DescribeWt = "VeryOver";
    ELSE DescribeWt = "Missing";
    
     /* Categorize v71 (HomeEnv) */
    IF v71 = 1 THEN HomeEnv = "NotTrue";
    ELSE IF v71 = 2 THEN HomeEnv = "LilTrue";
    ELSE IF v71 = 3 THEN HomeEnv = "PrettyTrue";
    ELSE IF v71 = 4 THEN HomeEnv = "VeryTrue";
    ELSE HomeEnv = "Missing";


    KEEP age_group ethnicity sex_category HomeEnv purge fast USBorn DescribeWt language slimfast;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 May 2024 21:21:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927780#M41652</guid>
      <dc:creator>kcvaldez98</dc:creator>
      <dc:date>2024-05-09T21:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927781#M41653</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/456544"&gt;@kcvaldez98&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi SAS Coders:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to change numeric observations into character so I can do my analysis, but it is showing blank observations for these variables:&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 528pt; border-spacing: 0px; border-image: initial; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" border="0" width="704" cellspacing="0" cellpadding="0" aria-label="Data Set WORK.CLEANDATA"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 26.25pt;"&gt;
&lt;TD width="64" height="35" class="xl65" style="height: 26.25pt; width: 48pt;"&gt;Obs&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;fast&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;purge&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;language&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;age_group&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;sex_category&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;ethnicity&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;USBorn&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;slimfast&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;DescribeWt&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="width: 48pt;"&gt;HomeEnv&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;VeryOver&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;2&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SlghtOve&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;3&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Miss&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Mis&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;Missing&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;4&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;5&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SltUnder&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;6&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Hisp&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;7&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;8&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SlghtOve&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;9&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;SltUnder&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" class="xl71" style="height: 15.0pt; width: 48pt;"&gt;10&lt;/TD&gt;
&lt;TD width="64" class="xl72" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl72" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Female&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl73" style="width: 48pt;"&gt;Right&lt;/TD&gt;
&lt;TD width="64" class="xl74" style="width: 48pt;"&gt;VeryTru&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;I know the observations are in fact numeric as it says "1" and "2" in the dataset&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If the number has values 1 and 2, what is the benefit of changing them to character "1" and "2"? I see no benefit, it seems like unnecessary work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, what part of your code fails if you the values are numeric? I don't see any part of your code that must have character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, once a variable is numeric, it cannot be changed to character. You can create a new character variable with values "1" and "2" if you'd like, but again, why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A recommendation, don't create character variable categories like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    IF age &amp;lt; 11 THEN age_group = "&amp;lt;11";
    ELSE IF age = 12 THEN age_group = "12";
    ELSE IF age = 13 THEN age_group = "13";
    ELSE IF age = 14 THEN age_group = "14";
    ELSE IF age &amp;gt;= 15 THEN age_group = "14+";
    ELSE age_group = "Missing";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead use custom formats and leave the variable AGE as numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
     value agef 0-11='&amp;lt;11' 15-high='14+';
run;

/* Then in a DATA step or PROC use */
format age agef.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 May 2024 21:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927781#M41653</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-09T21:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927783#M41654</link>
      <description>&lt;P&gt;If you are surprised that this block is resulting in the value "Missing":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE fast = "Missing";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could change it to e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE IF missing(v51) then fast="Missing";
    ELSE put "ERROR: Surprising value for v51 " v51= ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That will write an error message to your log whenever the value of v51 is not one of the values you are expecting. Typically I tried to avoid using an ELSE statement that does anything other than write an ERROR message, because you never know what odd values may lurk in your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;showed in SAS you do not need to create new character variables to create these sorts of labeled categories.&amp;nbsp; A SAS format will do it for you, and is much more flexible.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 21:55:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927783#M41654</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-05-09T21:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927824#M41660</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/456544"&gt;@kcvaldez98&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to change numeric observations into character so I can do my analysis, but it is showing blank observations for these variables:&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 528pt; border-spacing: 0px; border-image: initial; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;" border="0" width="704" cellspacing="0" cellpadding="0" aria-label="Data Set WORK.CLEANDATA"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 26.25pt;"&gt;
&lt;TD width="64" height="35" class="xl65" style="height: 26.25pt; width: 48pt;"&gt;Obs&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;fast&lt;/TD&gt;
&lt;TD width="64" class="xl66" style="width: 48pt;"&gt;purge&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;language&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;age_group&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;sex_category&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;ethnicity&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;USBorn&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;slimfast&lt;/TD&gt;
&lt;TD width="64" class="xl67" style="width: 48pt;"&gt;DescribeWt&lt;/TD&gt;
&lt;TD width="64" class="xl68" style="width: 48pt;"&gt;HomeEnv&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;1&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl63" style="width: 48pt;"&gt;.&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;&amp;lt;11&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Male&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;NonH&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;Life&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;No&lt;/TD&gt;
&lt;TD width="64" class="xl64" style="width: 48pt;"&gt;VeryOver&lt;/TD&gt;
&lt;TD width="64" class="xl70" style="width: 48pt;"&gt;PrettyT&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl69" style="height: 15.75pt; width: 48pt;"&gt;...&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
My code is this:&amp;nbsp;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA WORK.CLEANDATA;
    SET YRRSIMPT.import;
...    
    IF v4 = 1 THEN ethnicity = "Hisp";
    ELSE IF v4 = 2 THEN ethnicity = "NonHisp";
    ELSE ethnicity = "Missing";
...    
     /* Categorize v51 */
    IF v51 = 1 THEN fast = "Yes";
    ELSE IF v51 = 2 THEN fast = "No";
    ELSE fast = "Missing";
    
    /* Categorize v52 */
    IF v52 = 1 THEN purge = "Yes";
    ELSE IF v52 = 2 THEN purge = "No";
    ELSE purge = "Missing";
...
    KEEP age_group ethnicity sex_category HomeEnv purge fast USBorn DescribeWt language slimfast;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/456544"&gt;@kcvaldez98&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you have probably noticed yourself, the "blank" values (displayed as periods "&lt;FONT face="courier new,courier"&gt;.&lt;/FONT&gt;") of variables &lt;FONT face="courier new,courier"&gt;fast&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;purge&lt;/FONT&gt; were due to &lt;EM&gt;existing numeric&lt;/EM&gt; variables with these names in the input dataset&amp;nbsp;YRRSIMPT.import.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I know this?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;If these variables had been &lt;EM&gt;newly created&lt;/EM&gt; in the DATA step shown, they would have been created as &lt;EM&gt;character&lt;/EM&gt; variables of &lt;EM&gt;length 3&amp;nbsp;bytes&lt;/EM&gt;&amp;nbsp;because of their first occurrence in an assignment statement with value &lt;FONT face="courier new,courier"&gt;"Yes"&lt;/FONT&gt;. Since &lt;EM&gt;either&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;v51 = 1&lt;/FONT&gt; &lt;EM&gt;or&amp;nbsp;&lt;/EM&gt; &lt;FONT face="courier new,courier"&gt;v51 = 2&lt;/FONT&gt; &lt;EM&gt;or&amp;nbsp;&lt;/EM&gt; &lt;FONT face="courier new,courier"&gt;not (v51 = 1 or v51 = 2)&amp;nbsp;&lt;/FONT&gt;&lt;EM&gt;must&lt;/EM&gt; be true, in every observation variable &lt;FONT face="courier new,courier"&gt;fast&lt;/FONT&gt; would have been assigned one of the values &lt;FONT face="courier new,courier"&gt;"Yes"&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;"No"&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;"Mis"&lt;/FONT&gt; (truncated because of the insufficient length), depending on the value of &lt;FONT face="courier new,courier"&gt;v51&lt;/FONT&gt;. And similarly &lt;FONT face="courier new,courier"&gt;purge&lt;/FONT&gt;, depending on &lt;FONT face="courier new,courier"&gt;v52&lt;/FONT&gt;. Note that this argument holds even if &lt;FONT face="courier new,courier"&gt;v51&lt;/FONT&gt; was a &lt;EM&gt;character&lt;/EM&gt; variable in YRRSIMPT.import (in which case an automatic conversion of character to numeric values would have occurred) or if it was &lt;EM&gt;not existing&lt;/EM&gt; in&amp;nbsp;YRRSIMPT.import (in which case &lt;FONT face="courier new,courier"&gt;v51&lt;/FONT&gt; would have been created in the DATA step as an uninitialized numeric variable).&lt;/LI&gt;
&lt;LI&gt;If&amp;nbsp;&lt;FONT face="courier new,courier"&gt;fast&lt;/FONT&gt;&amp;nbsp;had been existing as a&amp;nbsp;&lt;EM&gt;character&lt;/EM&gt; variable&amp;nbsp;&lt;EM&gt;of length k&lt;/EM&gt;&amp;nbsp; in&amp;nbsp;YRRSIMPT.import, it had been assigned either of the values &lt;FONT face="courier new,courier"&gt;"Yes"&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;"No"&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;"Missing"&lt;/FONT&gt;,&amp;nbsp;&lt;EM&gt;truncated to length k&lt;/EM&gt;, e.g., &lt;FONT face="courier new,courier"&gt;"N"&lt;/FONT&gt; for &lt;EM&gt;k&lt;/EM&gt;=1 (if &lt;FONT face="courier new,courier"&gt;v51=2&lt;/FONT&gt;) or &lt;FONT face="courier new,courier"&gt;"Missi"&lt;/FONT&gt;&amp;nbsp;for &lt;EM&gt;k&lt;/EM&gt;=5 (if &lt;FONT face="courier new,courier"&gt;v51 not in (1,2)&lt;/FONT&gt;). And similarly for &lt;FONT face="courier new,courier"&gt;purge&lt;/FONT&gt;.&lt;/LI&gt;
&lt;LI&gt;So, &lt;EM&gt;existing numeric&lt;/EM&gt; variables &lt;FONT face="courier new,courier"&gt;fast&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;purge&lt;/FONT&gt;&amp;nbsp;from YRRSIMPT.import is the only remaining possibility. In this case, indeed, the assignment of a character value, be it&amp;nbsp;&lt;FONT face="courier new,courier"&gt;"Yes"&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;"No"&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;"Missing"&lt;/FONT&gt;, leads to &lt;EM&gt;numeric missing values&lt;/EM&gt; -- &lt;FONT face="courier new,courier"&gt;fast=.&lt;/FONT&gt;&amp;nbsp;or &lt;FONT face="courier new,courier"&gt;purge=.&lt;/FONT&gt;, respectively -- together with "&lt;FONT face="courier new,courier"&gt;Invalid numeric data&amp;nbsp;&lt;/FONT&gt;..." and character-to-numeric conversion notes in the log.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;To avoid these problems (also the truncation of values of variable &lt;FONT face="courier new,courier"&gt;ethnicity&lt;/FONT&gt; and others), just adhere to &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_blank" rel="noopener"&gt;maxims&lt;/A&gt;&amp;nbsp;2 (read the log), 3 (know your data), 25 (have a clean log) and 47 (set a length). And to maxim 8 (there is a format for it; here: "...&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;rolling your own will usually beat complicated data step logic&lt;/EM&gt;"&lt;/SPAN&gt;).&lt;/P&gt;
&lt;H4 id="toc-hId-1084423113" class="maxim-western"&gt;&amp;nbsp;&lt;/H4&gt;</description>
      <pubDate>Fri, 10 May 2024 10:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-Observations/m-p/927824#M41660</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-05-10T10:50:28Z</dc:date>
    </item>
  </channel>
</rss>

