<?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 fail then convert to missing all scores after failure time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646655#M193479</link>
    <description>&lt;P&gt;Great,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl1;
input ID gk1 gk2 gk3 gk4 gk5 gk6;
cards;
1 7 7 8 9 7 8 
2 4 5 5 6 7 7
3 9 10 10 10 10 10
4 7 9 10 10 10 9
5 3 4 4 4 4 3 
;
run;

Data tbl2;
set tbl1;
array _b(*) gk1-gk6;
do i=1 to 6;
do j=i+1 to 6;
if _b(i)=10 then _b(j)=.;
drop i j;
    end;
end;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 May 2020 11:57:42 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-05-11T11:57:42Z</dc:date>
    <item>
      <title>If fail then convert to missing all scores after failure time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646646#M193475</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have for each customer&amp;nbsp; score information for each month since joining the population.&lt;/P&gt;
&lt;P&gt;Score is between 1 to 10 (score 10 is when customer fail).&lt;/P&gt;
&lt;P&gt;I want to convert&amp;nbsp; all scores to missing after customer received failure score.&lt;/P&gt;
&lt;P&gt;In the real data there are many score fields and I want to ask if there is a more clever way to write:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF g1=10 then do; g2=.;g3=;g4=.;g5=;.g6=.;end;&lt;BR /&gt;IF g2=10 then do;g3=;g4=.;g5=.;g6=.;end;&lt;BR /&gt;IF g3=10 then do;g4=.;g5=.;g6=.;end;&lt;BR /&gt;IF g4=10 then do;g5=.;g6=.;end;&lt;BR /&gt;IF g5=10 then do;g6=.;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data  tbl1;
INPUT ID  g1 g2 g3 g4 g5 g6;
cards;
1 7 7 8 9 7 8 
2 4 5 5 6 7 7
3 9 10 10 10 10 10
4 7 9 10 10 10 9
5 3 4 4 4 4 3 
;
run;

Data tbl2;
SET tbl1;
IF g1=10 then do; g2=.;g3=;g4=.;g5=;.g6=.;end;
IF g2=10 then do;g3=;g4=.;g5=.;g6=.;end;
IF g3=10 then do;g4=.;g5=.;g6=.;end;
IF g4=10 then do;g5=.;g6=.;end;
IF g5=10 then do;g6=.;end;
Run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 11:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646646#M193475</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-05-11T11:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: I fail then convert to missing all scores after</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646647#M193476</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data  tbl1;
INPUT ID  g1 g2 g3 g4 g5 g6;
array g g1-g6;
do i=1 to 6;
    if g(i)=10 and i&amp;lt;6 then do j=(i+1) to 6;
        g(j)=.;
    end;
end;
cards;
1 7 7 8 9 7 8 
2 4 5 5 6 7 7
3 9 10 10 10 10 10
4 7 9 10 10 10 9
5 3 4 4 4 4 3 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 11:46:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646647#M193476</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-11T11:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: If fail then convert to missing all scores after failure time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646651#M193477</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how about:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl2;
SET tbl1;
  array G g:;
  _N_ = .;
  do over G;
    if _N_ = 10 then  G  = .;
                else _N_ = max(G,_N_);
  end;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All the best&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646651#M193477</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-11T12:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: If fail then convert to missing all scores after failure time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646655#M193479</link>
      <description>&lt;P&gt;Great,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl1;
input ID gk1 gk2 gk3 gk4 gk5 gk6;
cards;
1 7 7 8 9 7 8 
2 4 5 5 6 7 7
3 9 10 10 10 10 10
4 7 9 10 10 10 9
5 3 4 4 4 4 3 
;
run;

Data tbl2;
set tbl1;
array _b(*) gk1-gk6;
do i=1 to 6;
do j=i+1 to 6;
if _b(i)=10 then _b(j)=.;
drop i j;
    end;
end;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 May 2020 11:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646655#M193479</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-05-11T11:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: If fail then convert to missing all scores after failure time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646658#M193482</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did small update &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 12:07:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/If-fail-then-convert-to-missing-all-scores-after-failure-time/m-p/646658#M193482</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2020-05-11T12:07:39Z</dc:date>
    </item>
  </channel>
</rss>

