<?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: Syntax error for format name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606389#M176081</link>
    <description>&lt;P&gt;You need to end formats and informats with a dot for SAS to recognize it as such. Add a . (a dot) after 11 -&amp;gt; 11&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Nov 2019 06:26:44 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-11-22T06:26:44Z</dc:date>
    <item>
      <title>Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606384#M176078</link>
      <description>&lt;P&gt;Hi Iam running below code and iam getting error.please have a look and kindly help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table work.W5WITF2 as
      select
         
         (case 
            when Sign='C' 
            then input(Amt,11)/100
            when Sign='D' 
            then (input(Amt,11)/100)*-1
            else 
            end) as Amt length = 8
            format = 11.2
            informat = 11.2
            label = 'Amt',
         (case 
            when sign1='C' 
            then input(Amt1 ,11)/100
            when sign1='D' 
            then (input(Amt1 ,11)/100)*-1
            else
            end) as Amt1 length = 8&lt;BR /&gt;
            format = 11.2
            informat = 11.2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;
            label = 'Amt1',
         Sign,
         sign1
   from test
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(case&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;595 when Sign='C'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;596 then input(Amt,11)/100&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;__&lt;/FONT&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: a format name, ?.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 06:06:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606384#M176078</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-11-22T06:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606389#M176081</link>
      <description>&lt;P&gt;You need to end formats and informats with a dot for SAS to recognize it as such. Add a . (a dot) after 11 -&amp;gt; 11&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 06:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606389#M176081</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-11-22T06:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606393#M176085</link>
      <description>&lt;P&gt;The second parameter of the input-function is a format-name and format-names end with . (dot), if they no decimals are specified.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 07:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606393#M176085</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-11-22T07:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606401#M176090</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;would you please confirm else is mandatory in CASe fumction?sorry to ask here&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 07:34:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606401#M176090</guid>
      <dc:creator>JJP1</dc:creator>
      <dc:date>2019-11-22T07:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606405#M176092</link>
      <description>&lt;P&gt;If you have further problems, please post the whole log of your step; use the {i} button for posting logs.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2019 07:59:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606405#M176092</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-22T07:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax error for format name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606607#M176172</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/256123"&gt;@JJP1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;would you please confirm else is mandatory in CASe fumction?sorry to ask here&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not at all mandatory:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table junk as
  select *,  case when age=13 then 'A' end as Something
  from Sashelp.class
  ;
quit;&lt;/PRE&gt;
&lt;P&gt;If I only wanted to set the variable Something for the specific age of 13 and blank otherwise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good idea to include an Else? Likely so just so you document what was intended if nothing else.&lt;/P&gt;
&lt;P&gt;If you were recoding an existing variable with the intent to leave other values as they already exist then you would need an ELSE. Otherwise then other values end up missing.&lt;/P&gt;
&lt;PRE&gt;/* likely wrong approach*/
proc sql;
  create table junk as
  select name,sex,height,  case when age=13 then 26 end as Age
  from Sashelp.class
  ;
quit;

/* probably should be*/
proc sql;
  create table junk as
  select name,sex,height,  case when age=13 then 26 else age end as Age
  from Sashelp.class
  ;
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 22 Nov 2019 23:38:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Syntax-error-for-format-name/m-p/606607#M176172</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-22T23:38:25Z</dc:date>
    </item>
  </channel>
</rss>

