<?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: If/Then statement /greyed out portions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433840#M107596</link>
    <description>&lt;P&gt;You can also let a SAS data step show you want strange characters are in your program.&amp;nbsp; Use the CARDS4 (aka DATALINES4) statement with the LIST statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you could find that you have an embedded carriage return ('0D'x) character like in this example.&lt;/P&gt;
&lt;PRE&gt;1860  data _null_;
1861    input; list;
1862  cards4;

RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1863        data agebins;
1864        do agecat=1 to 14 by 1;
1865        output;
1866        end;
1867        run;
1868
1869        data agebins1; set agebins;
1870        if agecat=1 then agerisk=0.00048;

1871CHAR    if agecat=2 then agerisk=0.001161;.
    ZONE    66266666733276662666767633233333330222222222222222222222222222222222222222222222
    NUMR    960175314D20485E0175293BD0E001161BD000000000000000000000000000000000000000000000
1872        if agecat=13 then agerisk=0.043564;
1873        if agecat=14 then agerisk=0.152939;
1874        run;
1875  ;;;;
&lt;/PRE&gt;
&lt;P&gt;Or some other invisible character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 03 Feb 2018 20:03:38 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-02-03T20:03:38Z</dc:date>
    <item>
      <title>If/Then statement /greyed out portions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433828#M107590</link>
      <description>&lt;P&gt;I'm puzzled with greyed out portions in below code for if then logic. You know why? See screen shots of log and the way it's greyed out.&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="if then.png" style="width: 513px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18296iFCD0D3273EC69934/image-size/large?v=v2&amp;amp;px=999" role="button" title="if then.png" alt="if then.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="log if then.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/18295i659186A8030169FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="log if then.png" alt="log if then.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data agebins;&lt;BR /&gt;do agecat=1 to 14 by 1;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data agebins1; set agebins;
if agecat=1 then agerisk=0.00048;   
if agecat=2 then agerisk=0.001161; 
if agecat=3 then agerisk=0.000859;
if agecat=4 then agerisk=0.001314;&amp;nbsp;
if agecat=5 then agerisk=0.00208; 
if agecat=6 then agerisk=0.00311; 
if agecat=7 then agerisk=0.005029;&amp;nbsp;
if agecat=8 then agerisk=0.007975;&amp;nbsp;
if agecat=9 then agerisk=0.012361;&amp;nbsp;
if agecat=10 then agerisk=0.01817; 
if agecat=11 then agerisk=0.025729;
if agecat=12 then agerisk=0.035717;
if agecat=13 then agerisk=0.043564;
if agecat=14 then agerisk=0.152939; 
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Feb 2018 18:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433828#M107590</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-02-03T18:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement /greyed out portions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433831#M107592</link>
      <description>&lt;P&gt;There is nothing wrong with your program as you've pasted here.&amp;nbsp; But in your editor, you might have a rogue character at the end of the line where the error occurs (before the "gray" IF).&amp;nbsp; Move the cursor to the end of that line to see what's there.&amp;nbsp; Might also be a non-visible control character.&amp;nbsp; You could copy/paste your code into a program like Notepad++ and View all Characters.&amp;nbsp; I tried that with what you supplied -- nothing suspicious.&amp;nbsp; And your code block runs fine in SAS OnDemand for Academics (where I tried it).&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 19:06:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433831#M107592</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-02-03T19:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement /greyed out portions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433833#M107593</link>
      <description>I copied the code from notepad++ where it might have taken invisible characters from there? I backspaced and took spaces to fix as you suggested. Worked it out! Thanks a lot Chris!</description>
      <pubDate>Sat, 03 Feb 2018 19:10:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433833#M107593</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-02-03T19:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement /greyed out portions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433840#M107596</link>
      <description>&lt;P&gt;You can also let a SAS data step show you want strange characters are in your program.&amp;nbsp; Use the CARDS4 (aka DATALINES4) statement with the LIST statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example you could find that you have an embedded carriage return ('0D'x) character like in this example.&lt;/P&gt;
&lt;PRE&gt;1860  data _null_;
1861    input; list;
1862  cards4;

RULE:       ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1863        data agebins;
1864        do agecat=1 to 14 by 1;
1865        output;
1866        end;
1867        run;
1868
1869        data agebins1; set agebins;
1870        if agecat=1 then agerisk=0.00048;

1871CHAR    if agecat=2 then agerisk=0.001161;.
    ZONE    66266666733276662666767633233333330222222222222222222222222222222222222222222222
    NUMR    960175314D20485E0175293BD0E001161BD000000000000000000000000000000000000000000000
1872        if agecat=13 then agerisk=0.043564;
1873        if agecat=14 then agerisk=0.152939;
1874        run;
1875  ;;;;
&lt;/PRE&gt;
&lt;P&gt;Or some other invisible character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Feb 2018 20:03:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/433840#M107596</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-02-03T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: If/Then statement /greyed out portions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/434252#M107759</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt; wrote:&lt;BR /&gt;I copied the code from notepad++ where it might have taken invisible characters from there? I backspaced and took spaces to fix as you suggested. Worked it out! Thanks a lot Chris!&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Most likely sources of invisible characters would be from files in another format such as word processors or websites.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 16:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-Then-statement-greyed-out-portions/m-p/434252#M107759</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-05T16:48:09Z</dc:date>
    </item>
  </channel>
</rss>

