<?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: Timestamp question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533989#M146455</link>
    <description>If didn't work in the THEN clauses because you did call it in the those parts.&lt;BR /&gt;If you want to use the MONTH interval then convert the datetime values to dates. So if CLOSED is datetime then you need to do this.&lt;BR /&gt;WHEN t1.'ANS RCVD'n IS MISSING AND Year(DATEPART(t1.'ANS DUE'n)) &amp;lt; 2013 THEN INTNX('month',datepart(t1.CLOSED),0,'E')&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Feb 2019 16:12:38 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-02-08T16:12:38Z</dc:date>
    <item>
      <title>Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500818#M133419</link>
      <description>&lt;P&gt;Below is the code im working on and getting a syntax error (the part im getting the error for is in red below). I have attached a picture of the error for reference. Any help would be appreciated!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="syntax error.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23717i1B53097FF3A93B99/image-size/large?v=v2&amp;amp;px=999" role="button" title="syntax error.PNG" alt="syntax error.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.ADDL_FIELDS_JOINS AS&lt;BR /&gt;SELECT t1.'Evnt Id'n LABEL='',&lt;BR /&gt;t1.'Exposure Number'n,&lt;BR /&gt;t1.'System Code'n,&lt;BR /&gt;t1.'Typ Cde'n,&lt;BR /&gt;t1.'Typ Nme Lvl 2'n,&lt;BR /&gt;t1.Operation,&lt;BR /&gt;t1.'Typ Nme'n,&lt;BR /&gt;t1.Market,&lt;BR /&gt;t1.'Central Region Overwrite'n AS Region,&lt;BR /&gt;t1.'Legacy Group'n,&lt;BR /&gt;t1.'Stt Cde'n,&lt;BR /&gt;t1.'HR Region'n,&lt;BR /&gt;(case&lt;BR /&gt;when t1.'Loss Incr Amt'n IS MISSING then 0&lt;BR /&gt;else t1.'Loss Incr Amt'n&lt;BR /&gt;end) LABEL="Loss Incr Amt" AS 'Loss Incr Amt'n,&lt;BR /&gt;t1.'Loss Incurred?'n,&lt;BR /&gt;t1.'Valtn Dte'n,&lt;BR /&gt;t1.'Valtn Yr'n,&lt;BR /&gt;t1.'Valtn Month'n,&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)&lt;BR /&gt;) AS 'Insured % of Fault'n,&lt;BR /&gt;(coalesce((case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) is not missing&lt;BR /&gt;then 100 - (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT))&lt;BR /&gt;end),t4.OFFSET_PCT)) AS 'Claimant % of Fault'n,&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) AS 'Insured Fault Rating Name'n,&lt;BR /&gt;(case when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) = 'At Fault' then 'No Offset'&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) in ('Not at fault') then 'Full Offset'&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) in ('Partially at Fault') then 'Partial Offset'&lt;BR /&gt;&lt;BR /&gt;else 'Blank'&lt;BR /&gt;end) AS 'Offset Eligibility'n,&lt;BR /&gt;(Case when (case when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) = 'At Fault' then 'No Offset'&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) in ('Not at fault') then 'Full Offset'&lt;BR /&gt;&lt;BR /&gt;when&lt;BR /&gt;(case when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 0 then 'Not at fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;gt; 0 and&lt;BR /&gt;(coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) &amp;lt; 100 then 'Partially at Fault'&lt;BR /&gt;when (coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)) = 100 then 'At Fault'&lt;BR /&gt;end) in ('Partially at Fault') then 'Partial Offset'&lt;BR /&gt;&lt;BR /&gt;else 'Blank'&lt;BR /&gt;end) = 'Blank'&lt;BR /&gt;then 'Blank'&lt;BR /&gt;else 'Field Complete'&lt;BR /&gt;end) AS 'Offset Eligibility Group'n,&lt;BR /&gt;(case when t1.Customer in&lt;BR /&gt;('United Parcel','United Parcel Service','United Parcel Service Inc','United Parcel Service, Inc.',&lt;BR /&gt;'United Parcel Servive', 'UNITED PARCEL SERVICE','UNITED PARCEL SERVICE INC')&lt;BR /&gt;then 'Y'&lt;BR /&gt;else 'N' end) AS 'UPS?'n,&lt;BR /&gt;(case&lt;BR /&gt;when t1.'System Code'n = 'CC' then t2.'Loss Cause'n&lt;BR /&gt;when t1.'System Code'n = 'Safeco' then Strip(t4.'CVO_CAPTION2'n) || Strip(t4.'CVO_CAPTION3'n)&lt;BR /&gt;else t1.'Case Desc'n&lt;BR /&gt;end) AS 'Loss Cause'n,&lt;BR /&gt;&lt;BR /&gt;(PROPCASE(t1.Manager)) AS Manager,&lt;BR /&gt;(PROPCASE(t1.Owner)) AS Owner,&lt;BR /&gt;t1.'Hndlg Off Cde'n,&lt;BR /&gt;t4.'CVO_CASE_DESC'n,&lt;BR /&gt;t4.'CVO_AUT_LS_TYP'n,&lt;BR /&gt;t4.'CVO_AUT_COLL_CD'n,&lt;BR /&gt;t4.'CVO_CAPTION1'n,&lt;BR /&gt;t4.'CVO_CAPTION2'n,&lt;BR /&gt;t4.'CVO_CAPTION3'n,&lt;BR /&gt;t4.'CVO_CAPTION4'n,&lt;BR /&gt;t1.Closed_Date&lt;BR /&gt;FROM WORK.QUERY_FOR_ALL_CLOSED_SAS7BDAT1 t1&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;LEFT JOIN WORK.CC t2 ON put(t1.'Exposure Number'n, $50.) = put(t2.'Exposure Number'n, $50.).&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;LEFT JOIN WORK.CVO t4 ON put(t1.'Exposure Number'n, $50.) = put(t4.'Exposure Number'n, $50.).&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;LEFT JOIN newlib.VIA_OFFSETS t3 ON put(t1.'Exposure Number'n, $50.) = put(t3.'Exposure Number'n, $50.);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500818#M133419</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-02T15:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500824#M133420</link>
      <description>&lt;P&gt;Please post the whole log of a failed step in a window opened with the {i} button.&lt;/P&gt;
&lt;P&gt;Code is best posted in a window opened with the "little running man" button. Both methods preserve the formatiing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I positively hope that your code does not look as ugly as what you posted here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I &lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;STRONGLY&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/U&gt; recommend you get rid of those ugly name literals three days before yesterday, and refrain for all future from creating new variables with them.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500824#M133420</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-02T16:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500825#M133421</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe it's quite simple: Remove the periods at the end of the first two lines printed in red.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500825#M133421</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-02T16:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500826#M133422</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe it's quite simple: Remove the periods at the end of the first two lines printed in red.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good catch.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 16:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500826#M133422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-02T16:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500889#M133455</link>
      <description>&lt;P&gt;Hello - thank you for replying, appreciate it! I tried removing the commas but then i get the coalesce function error which states that it requires its arguments to be of the same data type for all the joins that were listed in red. Not sure if you have any insight on that...&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 18:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500889#M133455</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-02T18:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500897#M133461</link>
      <description>&lt;P&gt;Maxim 3: know your data.&lt;/P&gt;
&lt;P&gt;Columns used as arguments in a coalesce() function have to be of the same type.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 19:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500897#M133461</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-02T19:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500908#M133468</link>
      <description>&lt;P&gt;This shouldn't be too difficult either&amp;nbsp;because 31 of the 32 occurrences of &lt;FONT face="courier new,courier"&gt;coalesce&lt;/FONT&gt; are identical expressions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;coalesce(t2.FAULT,t3.'Insured Fault %'n,t4.LIAB_PCT)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, one or two of the three arguments are character variables while the rest are numeric. Apparently you want the result to be numeric. Hence, you should convert the character argument(s) to numeric values. This can be done with the INPUT function if the character values can be interpreted as numeric values (e.g. "1.5" or "1.5%").&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which are the character variables and what kind of values do they contain?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 19:19:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/500908#M133468</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-02T19:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501150#M133590</link>
      <description>&lt;P&gt;Hello - I looked at the four tables mentioned in the join (exposure number) and this is what I found...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;work.CC - numeric (10-11 char long)&lt;/P&gt;&lt;P&gt;work.CVO - numeric and one alphabet (A) (12 to 13 char long)&lt;/P&gt;&lt;P&gt;work.query for all closed - numeric (10-11 char long)&lt;/P&gt;&lt;P&gt;new lib.via offset -&amp;nbsp;&lt;SPAN&gt;numeric and varies in size&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;as for the fields...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FAULT - '.' and numbers and decimals&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;INSURED FAULT % - '.' and decimals&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LIAB PCT - blank and numbers&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Im not entirely sure how to proceed with the input function since all of these vary. Please let me know if you have any insight. thank you.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 14:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501150#M133590</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501177#M133599</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;for the details. So, indications are that t4.LIAB_PCT is the character variable among the three arguments in question: The blank is the typical character missing value (whereas a single period denotes a numeric missing value) and t4 is the alias of work.CVO, which you say contains one character variable unlike the other datasets. PROC CONTENTS output would have shown definitive information about the variable types and lengths, for example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=work.cvo;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What does the output of the above step tell about LIAB_PCT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the preliminary assumptions I would change the 31 identical COALESCE expressions (using Search and Replace in the editor) as follows:&lt;/P&gt;
&lt;PRE&gt;coalesce(t2.FAULT,t3.'Insured Fault %'n,&lt;FONT color="#FF0000"&gt;input(&lt;/FONT&gt;t4.liab_pct&lt;FONT color="#FF0000"&gt;, 16.)&lt;/FONT&gt;)&lt;/PRE&gt;
&lt;P&gt;This converts the "numeric" values contained in character variable LIAB_PCT (assuming a maximum length &amp;lt;=16) to &lt;EM&gt;real&lt;/EM&gt; numeric values.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 15:05:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501177#M133599</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-03T15:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501181#M133600</link>
      <description>&lt;P&gt;Hi again - the output of the LIAB_PCT states the following...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Type: Char&lt;/P&gt;&lt;P&gt;Len: 3&lt;/P&gt;&lt;P&gt;Format:$3.&lt;/P&gt;&lt;P&gt;Informat:$3.&lt;/P&gt;&lt;P&gt;Label:LIAB_PCT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 15:16:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501181#M133600</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T15:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501188#M133602</link>
      <description>&lt;P&gt;I tried using the input function you mentioned just now and received syntax errors. Could this be due to parentheses not matching up?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attached a snip of what I'm seeing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23748i481AA880ACF4BA12/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 15:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501188#M133602</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T15:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501194#M133603</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I tried using the input function you mentioned just now and received syntax errors. Could this be due to parentheses not matching up?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, the error messages rather indicate that the&amp;nbsp;slanted&amp;nbsp;single quotes around "&lt;FONT face="courier new,courier"&gt;Insured Fault %&lt;/FONT&gt;" are the culprit. Note that they differ from the (correct) single quotes around "Not at fault" etc. So, I'd try another Search/Replace to correct them.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 16:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501194#M133603</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-03T16:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501222#M133614</link>
      <description>&lt;P&gt;Hello - Wanted to say thank you first for your help thus far. It has made me understand my errors and also the approach to fix them. Hopefully this is the last question but the input statement and fixing the quotations worked. I still have one coalesce error and could that be due to the types not matching? i can take a look at all the tables/fields again to see if theres something i missed. Attached a screenshot for reference.&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23750i262296ECEBB95A5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 17:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501222#M133614</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T17:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501240#M133620</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I still have one coalesce error and could that be due to the types not matching?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome. Yes, most likely variable OFFSET_PCT in dataset work.CVO is a character variable (please check PROC CONTENTS output). If so, the same conversion that we applied to LIAB_PCT should resolve the issue:&amp;nbsp;&lt;FONT face="courier new,courier"&gt;input(t4.offset_pct, 16.)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 18:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501240#M133620</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-10-03T18:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501250#M133627</link>
      <description>&lt;P&gt;I was looking at the tables/fields again and realized that&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;t1 work.query for all closed has numeric and alphabet then numbers at the very end (starting with Y). Should I follow the same logic as before as you mentioned above?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 18:55:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501250#M133627</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T18:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501254#M133631</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237694"&gt;@deenap29&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was looking at the tables/fields again and realized that&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;t1 work.query for all closed has numeric and alphabet then numbers at the very end (starting with Y). Should I follow the same logic as before as you mentioned above?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What are you trying to do?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to use COALESCE() to report whichever non-missing value is first among your list of fields then convert everything to character strings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;left(put(numvar,best32.))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But if you need to actually preform arithmetic (or find min, max, mean, sum, etc) with those values then you will need to convert the characters to numbers. How to do that really depends on what is meaning of the a letter followed by digits.&amp;nbsp; If they really are in the form A9999 then perhaps you can just use SUBSTR() to skip the first letter.&lt;/P&gt;
&lt;PRE&gt;input(substr(charvar,2),32.)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also investigate what about your earlier processes is resulting in you having mixed data types for variables that you consider as capturing equivalent information.&amp;nbsp; Are you using PROC IMPORT or some other guessing procedure to create your datasets?&amp;nbsp; Perhaps you could convert those steps to data steps so you can explicitly define the data types for the variables.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 19:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501254#M133631</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-10-03T19:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error in code</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501263#M133635</link>
      <description>&lt;P&gt;It worked!!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again very much for your patience and help with this! I appreciate it!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 19:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/501263#M133635</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2018-10-03T19:27:37Z</dc:date>
    </item>
    <item>
      <title>Error 79-322: Expecting a THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533041#M146106</link>
      <description>&lt;DIV class="lia-message-heading lia-component-message-header"&gt;&lt;DIV class="lia-quilt-row lia-quilt-row-standard"&gt;&lt;DIV class="lia-quilt-column lia-quilt-column-20 lia-quilt-column-left"&gt;&lt;DIV class="lia-quilt-column-alley lia-quilt-column-alley-left"&gt;&lt;DIV class="lia-message-subject"&gt;Error 79-322: Expecting a THEN&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-body"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;For the case statement below, I keep getting the error in red&lt;FONT color="#000000"&gt;. Not sure where a then is missing? Please help!!!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;70 /* Include Owner? */&lt;BR /&gt;71 (CASE&lt;BR /&gt;72 WHEN THEN 'N'&lt;BR /&gt;___&lt;BR /&gt;79&lt;BR /&gt;73 WHEN THEN 'N'&lt;BR /&gt;___&lt;BR /&gt;79&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;ERROR 79-322: Expecting a THEN.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;74 WHEN '949 IRVING' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;75 WHEN 'CLAIMS INTAKE - LIBERTY MUTUAL (CL)' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;76 WHEN 'CLAIMS INTAKE - LIBERTY MUTUAL (CL) SUPPORT' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;77 WHEN 'GENERAL AM INBOX - LIBERTY MUTUAL (CL)' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;78 WHEN 'LIBERTY MUTUAL COMMERCIAL SUBRO' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;79 WHEN 'LIBERTY MUTUAL INS - COMMERCIAL CLAIMS' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;80 ELSE 'Y'&lt;BR /&gt;81 END) FORMAT=$CHAR43. LABEL="Include Owner?" AS 'Include Owner?'n,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case statement:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN THEN 'N'&lt;BR /&gt;WHEN THEN 'N'&lt;BR /&gt;WHEN '949 IRVING' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;WHEN 'CLAIMS INTAKE - LIBERTY MUTUAL (CL)' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;WHEN 'CLAIMS INTAKE - LIBERTY MUTUAL (CL) SUPPORT' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;WHEN 'GENERAL AM INBOX - LIBERTY MUTUAL (CL)' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;WHEN 'LIBERTY MUTUAL COMMERCIAL SUBRO' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;WHEN 'LIBERTY MUTUAL INS - COMMERCIAL CLAIMS' = t1.current_owner_fn THEN 'N'&lt;BR /&gt;ELSE 'Y'&lt;BR /&gt;END&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 05 Feb 2019 19:38:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533041#M146106</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2019-02-05T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error 79-322: Expecting a THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533043#M146107</link>
      <description>&lt;P&gt;Your first two rows do not have any condition specified.&amp;nbsp; I assume that the parser is considering the text THEN as the name of a variable to evaluate as the condition and that is why it is complaining that there is no THEN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Feb 2019 19:49:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533043#M146107</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-05T19:49:01Z</dc:date>
    </item>
    <item>
      <title>Timestamp question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533981#M146453</link>
      <description>&lt;P&gt;Thank you! I have a DATEPART question for you. It worked in the first part of the formula but not in the second after THEN. Im basically trying to get rid of the timestamp so the valuation month and year populate instead of being blanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CASE&lt;BR /&gt;WHEN t1.'ANS RCVD'n IS MISSING AND Year(DATEPART(t1.'ANS DUE'n)) &amp;lt; 2013 THEN INTNX('month',t1.CLOSED,0,'E')&lt;BR /&gt;WHEN t1.'ANS RCVD'n IS MISSING AND Year(DATEPART(t1.'ANS DUE'n)) &amp;gt;= 2013 THEN INTNX('month',t1.'ANS DUE'n ,0,'E')&lt;BR /&gt;WHEN Year(DATEPART(t1.'ANS RCVD'n)) &amp;lt; 2013 AND Year(DATEPART(t1.'ANS DUE'n)) &amp;lt; 2013 THEN INTNX('month',t1.CLOSED,0,'E')&lt;BR /&gt;WHEN Year(DATEPART(t1.'ANS RCVD'n)) &amp;lt; 2013 AND Year(DATEPART(t1.'ANS DUE'n)) &amp;gt;= 2013 THEN INTNX('month',t1.'ANS DUE'n,0,'E')&lt;BR /&gt;ELSE INTNX('month',t1.'ANS RCVD'n,0,'E')&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 15:56:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-in-code/m-p/533981#M146453</guid>
      <dc:creator>deenap29</dc:creator>
      <dc:date>2019-02-08T15:56:49Z</dc:date>
    </item>
  </channel>
</rss>

