<?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 Creating Both Blank and Missing Values in a Data Set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520522#M141150</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a dummy data set that contains both missing/null values and blank values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this? I need for someone to identify both as separate entities and act accordingly.&lt;/P&gt;&lt;P&gt;The main database has values that SAS reads as BLANKS and MISSING/NULL separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need XYZ_Group 16 to be missing/null and XYZ_Group 7 to be read as blanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I created the dataset both as a sas7bdat set and txt both values are reading as blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 20:10:21 GMT</pubDate>
    <dc:creator>AggieGal</dc:creator>
    <dc:date>2018-12-11T20:10:21Z</dc:date>
    <item>
      <title>Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520522#M141150</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to create a dummy data set that contains both missing/null values and blank values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this? I need for someone to identify both as separate entities and act accordingly.&lt;/P&gt;&lt;P&gt;The main database has values that SAS reads as BLANKS and MISSING/NULL separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need XYZ_Group 16 to be missing/null and XYZ_Group 7 to be read as blanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I created the dataset both as a sas7bdat set and txt both values are reading as blank.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:10:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520522#M141150</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-11T20:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520532#M141154</link>
      <description>&lt;P&gt;Create a custom informat to read the data propery. Can you post the code you're using to read this file as well? And SAS doesn't really have a difference between blank and Null. So it depends on what you want to do with those values. It does have SAS special missing values, so you can assign .N to records that are not applicable and just . to variables that are null? &lt;BR /&gt;&lt;BR /&gt;I think we need to understand more what you want to see as output to help you out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25236"&gt;@AggieGal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to create a dummy data set that contains both missing/null values and blank values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know how to do this? I need for someone to identify both as separate entities and act accordingly.&lt;/P&gt;
&lt;P&gt;The main database has values that SAS reads as BLANKS and MISSING/NULL separately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need XYZ_Group 16 to be missing/null and XYZ_Group 7 to be read as blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I created the dataset both as a sas7bdat set and txt both values are reading as blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520532#M141154</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T21:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520540#M141158</link>
      <description>&lt;P&gt;I need XYZ_Group = 7 to be read as BLANK&lt;/P&gt;&lt;P&gt;while XYZ_Group = 16 to be Missing/Null&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Import datafile="&amp;lt;input&amp;gt;\SAS_Dummy_AggieGal_3.xlsx"&lt;BR /&gt;out=SAS_Dummy_XLSX&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Proc Sql;&lt;BR /&gt;create table SAS_Dummy_Data as&lt;BR /&gt;select distinct&lt;BR /&gt;t1.ID,&lt;BR /&gt;t1.XYZ_Group,&lt;BR /&gt;t1.XYZ_Ind,&lt;BR /&gt;t1.XYZ_Ind_Desc,&lt;BR /&gt;(Case&lt;BR /&gt;when t1.XYZ_Ind is missing then "Missing/Null"&lt;BR /&gt;when t1.XYZ_Ind = " " then "Blank"&lt;BR /&gt;else t1.XYZ_Ind&lt;BR /&gt;end) as XYZ_Ind_Validation&lt;BR /&gt;from SAS_Dummy_xlsx as t1&lt;BR /&gt;order by t1.XYZ_Group,&lt;BR /&gt;t1.ID;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520540#M141158</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-11T20:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520545#M141161</link>
      <description>If your source file is originally txt why did you switch to XLSX? It's actually harder to work with an XLSX file. Which type are you working with, because the approach I was suggesting will not work with an XLSX file.</description>
      <pubDate>Tue, 11 Dec 2018 20:50:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520545#M141161</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T20:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520552#M141167</link>
      <description>&lt;P&gt;i've attached a txt file&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520552#M141167</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-11T20:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520560#M141172</link>
      <description>&lt;P&gt;You never actually answered the questions, specifically:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. What do you want to see as the output?&lt;/P&gt;
&lt;P&gt;2. What is the type/format of your input file, text or XLSX?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming that you want SAS special missing values as the format this is relatively straightforward.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc format;
invalue $ missing_fmt
'Missing/Null' = .M
'Blank' = .B
'' = .N
other = [$30.];
run;

data have;
informat ID xyz_group xyz_ind_desc xyz_ind $missing_fmt.;
input id $  xyz_group $ xyz_ind_desc $ xyz_ind $ ;
infile cards dlm=',' truncover dsd;
cards;
16_61,16,Missing/Null
16_62,16,Missing/Null
7_44,7,Blank,
7_45,7,Blank,
9_8,9,H,H
9_9,9,H,H
;;;;
run;

proc print data=have;
run;
&lt;/PRE&gt;
&lt;P&gt;This should get you started and you should be able to modify it to what you want to see.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:07:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520560#M141172</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T21:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520569#M141178</link>
      <description>&lt;P&gt;My output dataset in SAS needs to show which variables are being read as blank and which are missing/null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The live data contains both however after I move from the source data it becomes blanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the dataset to help with another problem I'm having but anyone who can help me obviously can't access my source data. So, I need dummy data to replicate my problem.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520569#M141178</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-11T21:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520589#M141189</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25236"&gt;@AggieGal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My output dataset in SAS needs to show which variables are being read as blank and which are missing/null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The live data contains both however after I move from the source data it becomes blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need the dataset to help with another problem I'm having but anyone who can help me obviously can't access my source data. So, I need dummy data to replicate my problem.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm not sure what that means. Does the code work, if not, how does it not work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:38:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520589#M141189</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T21:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Both Blank and Missing Values in a Data Set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520592#M141190</link>
      <description>&lt;P&gt;I have access to live data sets that others don't. I need to create a separate data set that has the same quirks for teaching purposes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some values are being read from the source data as being MISSING/NULL&lt;/P&gt;&lt;P&gt;and others are being read as BLANK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, every step and import data set the MISSING/NULL values are then being read as BLANK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 21:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-Both-Blank-and-Missing-Values-in-a-Data-Set/m-p/520592#M141190</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-11T21:41:42Z</dc:date>
    </item>
  </channel>
</rss>

