<?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 How to check for a field that has a 'space' as a valid value? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49337#M13375</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; One work-around is to use explicit SQL pass-thru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Nov 2011 11:49:23 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2011-11-17T11:49:23Z</dc:date>
    <item>
      <title>How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49331#M13369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I apologize in advance if that has been asked here many times, but for the sake of it, I can not find the answer I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a column/field in a table that has values including 'spaces'.&amp;nbsp; I am trying to find a way to find the records where the column is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I simply use the where clause in PROC SQL, 'where column is null', this results in wrong number of records.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The source table is actually a Teradata database, in which I can easily distinguish space with null using a different interface, such as SQL assistant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I need to write some scripts against this table in SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any workarounds?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your help is very much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Yeti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 00:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49331#M13369</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-17T00:18:04Z</dc:date>
    </item>
    <item>
      <title>How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49332#M13370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming you have a character field...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried either the cmiss, compress or missing function in SAS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 00:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49332#M13370</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2011-11-17T00:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49333#M13371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza.&amp;nbsp; I have used compress, missing,&amp;nbsp; = " ", = '', tranwrd(), nothing gave me the expected result.&amp;nbsp; But I have not used cmiss so far.&amp;nbsp; I will give that a shot and let you know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, it is of character data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 00:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49333#M13371</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-17T00:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49334#M13372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I doubted that your space is not really space. They are some blank character or non-printable character.&lt;/P&gt;&lt;P&gt;Such as TAB character '09'x and hex blank character '00'x.&lt;/P&gt;&lt;P&gt;You should use compress() to remove these character firstly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 03:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49334#M13372</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-17T03:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49335#M13373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ksharp.&amp;nbsp; Yes, they are spaces.&amp;nbsp; $hex4. value shows they are all '20'.&amp;nbsp; I have also used compress(column,,'kw'), still treats them as null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am lost really.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Yeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 03:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49335#M13373</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-17T03:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49336#M13374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;IMG src="https://communities.sas.com/" /&gt;&lt;/P&gt;&lt;P&gt;The picture below is a screenshot from Teradata SQL Assistant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see the second column does not have '?' indicating it is not null.&amp;nbsp; Note the 4th column, they are all null.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="null.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/1273_null.PNG" /&gt;&lt;/P&gt;&lt;P&gt;In SAS, the same table with this query &lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select clm_hdr_key, SRC_ITS_PNT_OF_SVC_LVL_CD label "its service point of service level code",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRC_ITS_PNT_OF_SVC_LVL_CD is null label "is null?",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRC_LINE_CLM_CHK_BYP_CD label "claim check bypass code line",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRC_LINE_CLM_CHK_BYP_CD is null label "is null?"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from xxxxx.xxxxxxxxxxxxxx;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;shows:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="null2.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/1274_null2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Yeti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 03:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49336#M13374</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-17T03:50:47Z</dc:date>
    </item>
    <item>
      <title>How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49337#M13375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; One work-around is to use explicit SQL pass-thru.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 11:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49337#M13375</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2011-11-17T11:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49338#M13376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks LinusH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That was exactly what I was looking for.&amp;nbsp; I did not even know such a thing existed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yeti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 22:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49338#M13376</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-17T22:27:33Z</dc:date>
    </item>
    <item>
      <title>How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49339#M13377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;Whenever using an outside data source you need to consider is data types.&amp;nbsp; Teradata handles nulls differently that SAS so you need to account for this.&lt;/P&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001384390.htm"&gt;http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/viewer.htm#a001384390.htm&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;Teradata has a special value that is called NULL. A Teradata NULL value means an absence of information and is analogous to a SAS missing value. When SAS/ACCESS reads a Teradata NULL value, it interprets it as a SAS missing value.&lt;/P&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;A name="a002676737" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;By default, Teradata columns accept NULL values. However, you can define columns so that they do not contain NULL values. For example, when you create a SALES table, define the CUSTOMER column as NOT NULL, telling Teradata not to add a row to the table unless the CUSTOMER column for the row has a value. When creating a Teradata table with SAS/ACCESS, you can use the DBNULL= data set option to indicate whether NULL is a valid value for specified columns.&lt;/P&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;A name="a002676738" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;For more information about how SAS handles null values, see &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/63647/HTML/default/a001924296.htm" style="line-height: 1.25em; color: #0000cc;"&gt;Potential Result Set Differences When Processing Null Data&lt;/A&gt;.&lt;/P&gt;&lt;P style="margin-top: 1.4em; line-height: 1.25em; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; color: #000000; background-color: #ffffff;"&gt;&lt;A name="a002676739" style="line-height: 1.25em; font-family: inherit;"&gt;&lt;/A&gt;To control how SAS missing character values are handled by Teradata, use the NULLCHAR= and NULLCHARVAL= data set options.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Nov 2011 23:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49339#M13377</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-11-17T23:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to check for a field that has a 'space' as a valid value?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49340#M13378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks FriedEgg.&amp;nbsp; Very kind of you to share the documentation about Teradata in SAS.&amp;nbsp; I have boomarked it. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am slowly learning about SAS and finally beginning to get comfortable with it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Yeti.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2011 00:32:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-check-for-a-field-that-has-a-space-as-a-valid-value/m-p/49340#M13378</guid>
      <dc:creator>Yeti</dc:creator>
      <dc:date>2011-11-18T00:32:44Z</dc:date>
    </item>
  </channel>
</rss>

