<?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: Error 22-322, 76-322 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632414#M187499</link>
    <description>&lt;PRE&gt; + proc sql noprint;
1    +                   create table test1 as select distinct LBTESTCD as testcd length=8, "LB"
as dataset length=8,"LBCAT" as catvar length=8,"LBSCAT" as scatvar length=8,"LBTESTCD" as
testvar length=8,"LBORRES" as resultvar length=8,LBCAT as cat
2    + length=200,LBSCAT as scat length=200,LBTEST as test length=40,
max(length(strip(LBORRES))) as length, case when max(compress(LBORRES)) eq ' ' then 'All
missing' when compress(LBORRES,'1234567890') eq '.' then 'float' when
compress(LBORRES,'1234567890')
3    + eq ' ' then 'integer' when input(LBORRES,anydtdte12.) ne . then 'datetime' else 'text'
end as type, case when calculated type='float' then length(scan(strip(LBORRES),2,'.')) else .
end as sigdig, case when calculated type='float' then strip(put(length
4    +(LBORRES),best.)) ||"."||(strip(put(calculated sigdig,best.))) else . end as format from
Sdtmdev.LB group by LBCAT,LBSCAT,LBTESTCD,LBTEST;
ERROR: Result of WHEN clause 2 is not the same data type as the preceding results.
4    +
 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;When I change code as per suggestion, I am diving into another code error. Can you please guide me on this?&lt;/P&gt;</description>
    <pubDate>Mon, 16 Mar 2020 12:18:17 GMT</pubDate>
    <dc:creator>Harsh11387</dc:creator>
    <dc:date>2020-03-16T12:18:17Z</dc:date>
    <item>
      <title>Error 22-322, 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632398#M187488</link>
      <description>&lt;PRE&gt;1    + proc sql noprint;
1    +                   create table test1 as select distinct LBTESTCD as testcd length=8, "LB"
as dataset length=8,"LBCAT" as catvar length=8,"LBSCAT" as scatvar length=8,"LBTESTCD" as
testvar length=8,"LBORRES" as resultvar length=8,LBCAT as cat
2    + length=200,LBSCAT as scat length=200,LBTEST as test length=40,
max(length(strip(LBORRES))) as length, case when max(compress(LBORRES)) eq ' ' then 'All
missing' when compress(LBORRES,'1234567890') eq '.' then 'float' when
compress(LBORRES,'1234567890')
3    + eq ' ' then 'integer' when input(LBORRES,anydtdte12.) ne . then 'datetime' else 'text'
end as type, case when calculated type='float' then length(scan(strip(LBORRES),2,'.')) else .
end as sigdig, case when calculated type='float' then (strip(put(length
NOTE: Line generated by the CALL EXECUTE routine.
4    +(LBORRES),best.)) ||"."||strip(put(calculated sigdig,best.)),best.) else . end as format
                                                                  -
                                                                  22
                                                                  76
4   !+from Sdtmdev.LB group by LBCAT,LBSCAT,LBTESTCD,LBTEST; quit;
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, BETWEEN, CONTAINS, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE,
              LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.

ERROR 76-322: Syntax error, statement will be ignored.

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds&lt;/PRE&gt;&lt;P&gt;Can you please look into log and suggest something to resolve flagged errors? Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 11:23:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632398#M187488</guid>
      <dc:creator>Harsh11387</dc:creator>
      <dc:date>2020-03-16T11:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322, 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632402#M187492</link>
      <description>&lt;P&gt;The string&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;,best.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where the error is indicated is invalid, it appears to be part he STRIP() function from the line above, and it doesn't belong there because STRIP() does not use a 2nd argument.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 11:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632402#M187492</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-16T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322, 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632414#M187499</link>
      <description>&lt;PRE&gt; + proc sql noprint;
1    +                   create table test1 as select distinct LBTESTCD as testcd length=8, "LB"
as dataset length=8,"LBCAT" as catvar length=8,"LBSCAT" as scatvar length=8,"LBTESTCD" as
testvar length=8,"LBORRES" as resultvar length=8,LBCAT as cat
2    + length=200,LBSCAT as scat length=200,LBTEST as test length=40,
max(length(strip(LBORRES))) as length, case when max(compress(LBORRES)) eq ' ' then 'All
missing' when compress(LBORRES,'1234567890') eq '.' then 'float' when
compress(LBORRES,'1234567890')
3    + eq ' ' then 'integer' when input(LBORRES,anydtdte12.) ne . then 'datetime' else 'text'
end as type, case when calculated type='float' then length(scan(strip(LBORRES),2,'.')) else .
end as sigdig, case when calculated type='float' then strip(put(length
4    +(LBORRES),best.)) ||"."||(strip(put(calculated sigdig,best.))) else . end as format from
Sdtmdev.LB group by LBCAT,LBSCAT,LBTESTCD,LBTEST;
ERROR: Result of WHEN clause 2 is not the same data type as the preceding results.
4    +
 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;When I change code as per suggestion, I am diving into another code error. Can you please guide me on this?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 12:18:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632414#M187499</guid>
      <dc:creator>Harsh11387</dc:creator>
      <dc:date>2020-03-16T12:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322, 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632417#M187501</link>
      <description>&lt;P&gt;You cannot assign a character value in one WHEN and a numeric value (the missing value of .) in the next WHEN. Both WHEN must assign a character value or both WHEN must assign a numeric value.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Mar 2020 12:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-76-322/m-p/632417#M187501</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-16T12:32:57Z</dc:date>
    </item>
  </channel>
</rss>

