<?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: How do I clear these errors? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673645#M19462</link>
    <description>No sorry, the Rename is confusing "Discharge Date1= Discharge Date" &lt;BR /&gt;Column name must come in pairs like x=y z=q.&lt;BR /&gt;Do you want to rename Discharge to Date1?</description>
    <pubDate>Fri, 31 Jul 2020 09:10:46 GMT</pubDate>
    <dc:creator>RogerHed</dc:creator>
    <dc:date>2020-07-31T09:10:46Z</dc:date>
    <item>
      <title>How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673626#M19459</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;Hello all&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3"&gt;I have inherited SAS code that has approx. 20 steps and the code had errors throughout. I have been successful in cleaning it up until the last two steps. This is the code for the first one&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE WORK.AllClaims1 (DROP= Discharge Date Rename= (Discharge Date1= Discharge Date)) AS 
SELECT *
 ,INPUT(Discharge Date,5.) - 21916 AS Discharge Date1 FORMAT= mmddyy10.
FROM WORK.AllClaims
;QUIT;&lt;BR /&gt;&lt;BR /&gt;This is the error message I get:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;22&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;76&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: !, !!, &amp;amp;, (, *, **, +, -, '.', /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;The is the code for the other step&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA AllClaims_Updated;
SET hphc_EOL_FY20 WORK.AllClaims;
RUN;&lt;BR /&gt;&lt;BR /&gt;This&amp;nbsp;the&amp;nbsp;error&amp;nbsp;message&amp;nbsp;that&amp;nbsp;I&amp;nbsp;get:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;ERROR: Variable Age has been defined as both character and numeric.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff0000"&gt;ERROR: Variable BMT has been defined as both character and numeric.&lt;BR /&gt;&lt;/FONT&gt;&lt;BR /&gt;These are the two columns that are effected and their types.&lt;BR /&gt;&lt;BR /&gt;work.EOL_COHORT Age = Type Numeric, Length 8&lt;BR /&gt;BHM = Type Character, Length Character 1&lt;BR /&gt;&lt;BR /&gt;AllCohorts1 Age = Type Character, Length Character 1&lt;BR /&gt;BHM = Type Numeric, Length 8&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Any assistance with these would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 06:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673626#M19459</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-07-31T06:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673628#M19460</link>
      <description>&lt;P&gt;My apologies, this did not present the way I typed it so I am going to attach the code and errors in a word document&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 06:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673628#M19460</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-07-31T06:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673642#M19461</link>
      <description>&lt;P&gt;The Sql:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In the Rename there is a Date=, remove the "=".&lt;/LI&gt;
&lt;LI&gt;The Format "Date,5." I suppose is meant to be "date5.".&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The Data step:&lt;/P&gt;
&lt;P&gt;You have to decide if what type AGE and&amp;nbsp;BMT must be if the two datasets are to be appended. A couple of choices:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I they mean the same thing, change into numeric or character in both datasets before appending. You can use a SQL View to do that before the datastep on the input ataset you want to alter into the append Data step.&lt;/LI&gt;
&lt;LI&gt;If they mean different and are to be kept separate in the appended output, add a rename on one of the input datasets.&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 31 Jul 2020 09:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673642#M19461</guid>
      <dc:creator>RogerHed</dc:creator>
      <dc:date>2020-07-31T09:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673645#M19462</link>
      <description>No sorry, the Rename is confusing "Discharge Date1= Discharge Date" &lt;BR /&gt;Column name must come in pairs like x=y z=q.&lt;BR /&gt;Do you want to rename Discharge to Date1?</description>
      <pubDate>Fri, 31 Jul 2020 09:10:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673645#M19462</guid>
      <dc:creator>RogerHed</dc:creator>
      <dc:date>2020-07-31T09:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673654#M19463</link>
      <description>&lt;P&gt;Do not type code and logs manually; just copy/paste the text&amp;nbsp;&lt;EM&gt;as is&lt;/EM&gt; into the appropriate codeboxes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What immediately catches my attention is the fact that there seem to be blanks in variable names. This is not correct syntax.&lt;/P&gt;
&lt;P&gt;If you actually have blanks in variable names, you need to use so-called "name literals":&lt;/P&gt;
&lt;PRE&gt;"Discharge Date"n&lt;/PRE&gt;
&lt;P&gt;The spelling must be correct with regards to upper/lowercase. It is STRONGLY recommended to avoid this, so rename those variables immediately to valid SAS names (use underlines in place of blanks).&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 10:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673654#M19463</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-31T10:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673727#M19464</link>
      <description>&lt;P&gt;It looks to me like your first step (the PROC SQL) would work, except for one thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a number of uses of "Discharge Date", with a space between the two words. If this was a proper SAS variable, I think the code would work fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say this is inherited code. As it is, there is no way this code will work. It looks to me like something happened to change a correct variable, possible "DischargeDate" or "Discharge_Date", to "Discharge Date". Has anything like that happened, and have any other changes been made?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're probably best leaving the later steps until the earlier problems get solved. Problems tend to cascade.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 14:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673727#M19464</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2020-07-31T14:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673764#M19465</link>
      <description>&lt;P&gt;Thanks all for your responses. The imported source document (excel), had a space between the heading "Discharge Date", that's why I wanted to do the rename. Instead I used a "_" between the two words and commented out the rename step, and it worked perfectly.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 15:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673764#M19465</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-07-31T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I clear these errors?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673768#M19466</link>
      <description>&lt;P&gt;Thanks RogerHed. The AGE should be Type = Numeric, length = 8 and the BMT should be Type = Character, Length = 1 in both datasets.Unfortunately, as a novice I searched the internet to learn how to do that but I was unsuccessful in finding the proper way to include that logic.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jul 2020 15:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-do-I-clear-these-errors/m-p/673768#M19466</guid>
      <dc:creator>wheddingsjr</dc:creator>
      <dc:date>2020-07-31T15:50:54Z</dc:date>
    </item>
  </channel>
</rss>

