<?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: Variable ASSESS has been defined as both character and numeric in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614071#M18539</link>
    <description>In those datasets where variable ASSESS is character , is there anyway i present it as numeric as those variable contains no observations and therefore SAS is reading it as character and those variables too are needed to create dataset ecg.</description>
    <pubDate>Fri, 27 Dec 2019 13:32:45 GMT</pubDate>
    <dc:creator>TANMOY05</dc:creator>
    <dc:date>2019-12-27T13:32:45Z</dc:date>
    <item>
      <title>Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614057#M18537</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ecg ;
	set renibus20(in=a) 
		renibus211(in=b1 where=(assess^='')) 
		renibus212(in=b2 where=(assess^=''))  
		renibus221(in=c1 where=(assess^='')) 
		renibus222(in=c2 where=(assess^='')) 
		renibus231(in=d1 where=(assess^='')) 
		renibus232(in=d2 where=(assess^='')) ;
	subject=put(input(subject_id,best.),z3.) ;
	length VISIT $20 ;
	if a then VISIT='Screening' ;
	if b1 or c1 or d1 then visit='Day 1 Predose' ;
	if b2 or c2 or d2 then visit='Day 1 Predose' ;
	VISITN=1.1*(b1 or c1 or d1)+1.2*(b2 or c2 or d2) ;
	drop _name_ _label_ subject_id ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I am getting error as&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Variable ASSESS has been defined as both character and numeric.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;what to do?&lt;/DIV&gt;&lt;DIV class="sasError"&gt;even where=(not missing(assess)) is showing error&amp;nbsp;Variable ASSESS has been defined as both character and numeric.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 27 Dec 2019 12:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614057#M18537</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2019-12-27T12:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614058#M18538</link>
      <description>&lt;P&gt;In one of your data sets in the SET statement, variable ASSESS is numeric; in another of your data sets variable ASSESS is character. You need to fix this in order to get this to work. ASSESS must always be numeric in each of your data sets; or it must always be character in each of your data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 12:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614058#M18538</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-27T12:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614071#M18539</link>
      <description>In those datasets where variable ASSESS is character , is there anyway i present it as numeric as those variable contains no observations and therefore SAS is reading it as character and those variables too are needed to create dataset ecg.</description>
      <pubDate>Fri, 27 Dec 2019 13:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614071#M18539</guid>
      <dc:creator>TANMOY05</dc:creator>
      <dc:date>2019-12-27T13:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614082#M18541</link>
      <description>&lt;P&gt;You need to go back to the start of your process, where the data is read into your SAS environment in the first place. Do not use proc import for this, instead use the same data step to read all files, then the datasets will have the same structure.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 14:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614082#M18541</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-27T14:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614084#M18542</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304794"&gt;@TANMOY05&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In those datasets where variable ASSESS is character , is there anyway i present it as numeric as those variable contains no observations and therefore SAS is reading it as character and those variables too are needed to create dataset ecg.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In a data step, you rename ASSESS to something else (let's say ASSESS_C) and then create a new variable named ASSESS which is numeric and contains the numeric portion of whatever values are in ASSESS_C.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And also ... what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; said is good advice.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 14:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614084#M18542</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-27T14:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variable ASSESS has been defined as both character and numeric</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614110#M18545</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304794"&gt;@TANMOY05&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ecg ;
	set renibus20(in=a) 
		renibus211(in=b1 where=(assess^='')) 
		renibus212(in=b2 where=(assess^=''))  
		renibus221(in=c1 where=(assess^='')) 
		renibus222(in=c2 where=(assess^='')) 
		renibus231(in=d1 where=(assess^='')) 
		renibus232(in=d2 where=(assess^='')) ;
	subject=put(input(subject_id,best.),z3.) ;
	length VISIT $20 ;
	if a then VISIT='Screening' ;
	if b1 or c1 or d1 then visit='Day 1 Predose' ;
	if b2 or c2 or d2 then visit='Day 1 Predose' ;
	VISITN=1.1*(b1 or c1 or d1)+1.2*(b2 or c2 or d2) ;
	drop _name_ _label_ subject_id ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am getting error as&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasError"&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;ERROR: Variable ASSESS has been defined as both character and numeric.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;what to do?&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;even where=(not missing(assess)) is showing error&amp;nbsp;Variable ASSESS has been defined as both character and numeric.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One suspects there is a LOGIC error on this line:&lt;/P&gt;
&lt;PRE&gt;if b2 or c2 or d2 then visit='Day 1 Predose' ;
&lt;/PRE&gt;
&lt;P&gt;That perhaps the visit value should either have a different Day or something besides "Predose". Otherwise why have a different "If' to differentiate between b1 c1 and d1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may want to consider whether visit should be formed that way. You are actually containing two pieces of informat, Day and Dose status. Which may make it much harder to look at "Predose" vs other Dose status&amp;nbsp;values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another consideration if you have many of these, such that you get up to values like 'Day 10 Dose' then your sort order for visit for many purposes will be "Day 1&amp;nbsp;&amp;nbsp; ", "Day 10", "Day 11"&amp;nbsp;, "Day 2" or similar. So you might be better off with a numeric Day value that sorts appropriately.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 16:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Variable-ASSESS-has-been-defined-as-both-character-and-numeric/m-p/614110#M18545</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-27T16:24:39Z</dc:date>
    </item>
  </channel>
</rss>

