<?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: requires a character expression  as argument 1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378570#M24627</link>
    <description>&lt;P&gt;Yup. You can use put(a.PtFirst, best15.) etc. to convert your numeric variables to character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2017 01:36:29 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2017-07-24T01:36:29Z</dc:date>
    <item>
      <title>requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378569#M24626</link>
      <description>&lt;P&gt;Hi I'm not sure what is causing my program to recieve this error, is it because of the data sets contains numeric variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format $15. ,b.indv_id ,b.MP_MANAGEDPERSONID ,b.MP_BIRTHDATE as _DOB ,b.MP_zip as _zip from outlib.MCP_QUAL as a left join&lt;BR /&gt;refdata.xwalk_careone_crm as b on UPCASE(COMPRESS(strip(a.PtFirst))) = UPCASE(COMPRESS(strip(b.MP_FIRSTNAME))) and&lt;BR /&gt;UPCASE(COMPRESS(strip(a.PtLast))) = UPCASE(COMPRESS(strip(b.MP_LASTNAME))) ;&lt;BR /&gt;ERROR: Function STRIP requires a character expression as argument 1.&lt;BR /&gt;ERROR: Function STRIP requires a character expression as argument 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;create table ALL_NPART as&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select distinct&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.*&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.MP_FIRSTNAME as _Fname format $15.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.MP_LASTNAME as _Lname&amp;nbsp; format $15.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.indv_id&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.MP_MANAGEDPERSONID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.MP_BIRTHDATE as _DOB&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,b.MP_zip as _zip&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from outlib.MCP_QUAL as a&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; left join refdata.xwalk_careone_crm as b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on UPCASE(COMPRESS(strip(a.PtFirst))) = UPCASE(COMPRESS(strip(b.MP_FIRSTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and UPCASE(COMPRESS(strip(a.PtLast))) = UPCASE(COMPRESS(strip(b.MP_LASTNAME)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 01:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378569#M24626</guid>
      <dc:creator>Rsadiq1</dc:creator>
      <dc:date>2017-07-24T01:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378570#M24627</link>
      <description>&lt;P&gt;Yup. You can use put(a.PtFirst, best15.) etc. to convert your numeric variables to character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 01:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378570#M24627</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-07-24T01:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378571#M24628</link>
      <description>&lt;P&gt;You keep asking the same question. The answer is no different today than it was yesterday.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the little bit of code you posted the most obvious thing is that your variables are NOT character string.&lt;/P&gt;
&lt;P&gt;Run proc contents on your input datasets and see which of the four variables that you are passing to the STRIP() function are numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Usually this happens when you use PROC IMPORT to guess at how your dataset should be created. If you have character variable in a CSV file and all of the values are missing then PROC IMPORT will assume that the variable is numeric, since there is nothing that tells it otherwise. &amp;nbsp;The solution is to NOT use PROC IMPORT to guess at what is in your CSV file. Instead write a data step to read the CSV file so that you have full control over how the variables as defined.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 01:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378571#M24628</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-24T01:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378572#M24629</link>
      <description>&lt;P&gt;That is, unless any of the numbers have fractions. If they do, you're in trouble. Matching fractional numbers in SQL is very problematic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 01:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378572#M24629</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-07-24T01:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378602#M24631</link>
      <description>&lt;P&gt;KNOW.YOUR.DATA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Inspect the type and contents of your variables to see if they match your expectations.&lt;/P&gt;
&lt;P&gt;As the ERROR message &lt;U&gt;&lt;EM&gt;very clearly&lt;/EM&gt;&lt;/U&gt; states, some of your variables are of type numeric, and can't be used in a function that is for character values only.&lt;/P&gt;
&lt;P&gt;So look which column you used in the join condition has the wrong type.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 08:24:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378602#M24631</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-07-24T08:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378603#M24632</link>
      <description>&lt;P&gt;You have several threads which are all pretty much the same question open. &amp;nbsp;Plenty of advice in those, so read through them thoroughly, and select a response and mark it as correct. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For future posts follow the guidance you will see below to the Post button when creating a new post:&lt;/P&gt;
&lt;P&gt;- Show test data in the form of a datastep - this is a key piece of information as we cannot see what you are working on. &amp;nbsp;Follow this post if you need help to do so:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Show what the expected outcome should be&lt;/P&gt;
&lt;P&gt;- Show&amp;nbsp;&lt;STRONG&gt;full&lt;/STRONG&gt; code associated with the transformation, this could be one or multiple steps&lt;/P&gt;
&lt;P&gt;- Show the log (all relevant parts) if there are notes/warnings/errors.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 08:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378603#M24632</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-07-24T08:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378690#M24641</link>
      <description>&lt;P&gt;I did look at all 4 variables and my data all is character variables, ptfirst and ptlast and as well as the other first and last name variables. I did a proc contents and that was what is shown&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 14:00:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378690#M24641</guid>
      <dc:creator>Rsadiq</dc:creator>
      <dc:date>2017-07-24T14:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: requires a character expression  as argument 1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378699#M24645</link>
      <description>&lt;P&gt;Show us how you checked the variable's type. &amp;nbsp;Most likely you are either looking at the wrong variables or perhaps even the wrong datasets. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another really easy way to get a numeric variable instead of character is if you accidently defined it that way. Perhaps by mistyping the variable name. &amp;nbsp;Say your input dataset had a variable named FIRST_NAME. &amp;nbsp;Then you wrote a little datastep say to subset the data or the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
  set mydata;
 keep id firstname last_name ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You would get a note in the log that the new variable FIRSTNAME (without the _ in the middle) is uninitialized and SAS will make it a numeric variable. So now if later on you try to apply STRIP(FIRSTNAME) you will either get an error (proc sql) or a note that numbers have been converted to characters (data step).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 14:15:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/requires-a-character-expression-as-argument-1/m-p/378699#M24645</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-24T14:15:26Z</dc:date>
    </item>
  </channel>
</rss>

