<?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: Count successsive missing values in a row or register in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730772#M227595</link>
    <description>&lt;P&gt;As a hypothetical situation :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  input id var1 var2 var3 var4 var5 var6 var7 var8 var9 var10;
cards;
1 100 . 200 . . 300 . . . .
2 . . 300 . . . . 200 . . 
3 . . . . . . . . 100 . 
4 100 . . . . . . . 100 100
5 100 . . . 200 . . 200 . 
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And, as a output I want something like that:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 1stSeq LastSeq

1 100 . 200 . . 300 . . . .  0 4
2 . . 300 . . . . 200 . .    2 2
3 . . . . . . . . 100 .      8 1
4 100 . . . . . . . 100 100  0 0
5 100 . . . 200 . . 200 .    0 1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 09:04:18 GMT</pubDate>
    <dc:creator>dmarques1998</dc:creator>
    <dc:date>2021-04-05T09:04:18Z</dc:date>
    <item>
      <title>Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730719#M227566</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to count sucessive number os missing values, i.e in the 3rd line count the missing values between "E" from "x" to "E" from "x+1". Ideally, the ideia is to count every successive missing values, and if they are interupt by a name, i.e E, Ambas or D, start a new count. I have already the total of missing values as you can see in the attached photo, However I cannot find a specific code or Macro to use in that situation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Apr 2021 14:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730719#M227566</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-12T14:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730722#M227567</link>
      <description>&lt;P&gt;That is a beautiful picture of your &lt;STRIKE&gt;baby&lt;/STRIKE&gt;&amp;nbsp;desktop.&amp;nbsp; But can you share a description of your data and some actual data.&amp;nbsp; To share data just post a simple SAS data step that reads the data from in-line text (aka CARDS or DATALINES).&amp;nbsp; That way we can just copy and paste the text from your posting into our local SAS session and have example data to use to propose solutions.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 14:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730722#M227567</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-01T14:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730723#M227568</link>
      <description>&lt;P&gt;You have data (dates) in structure (variable names), which is always a bad idea.&lt;/P&gt;
&lt;P&gt;Transpose your dataset to a long layout, and then you can use BY processing and a RETAINed variable:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wide;
infile datalines dsd;
input id $ (fonte201912 fonte202001 fonte202002 fonte202003) ($);
datalines;
1,x,,x,x
2,x,x,,x
3,,,x,x
;

proc transpose data=wide out=long (rename=(col1=fonte));
by id;
var fonte:;
run;

data long2;
set long;
period = input(substr(_name_,6),yymmn6.);
format period yymmn6.;
drop _name_;
run;

data want;
set long2;
by id;
if first.id then counter = 0;
if fonte &amp;gt; ""
then counter = 0;
else counter + 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Dataset LONG2 is how your datasets should be organized: long layout, date values stored as proper SAS data values with a display format to your liking.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 14:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730723#M227568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-01T14:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730729#M227572</link>
      <description>&lt;P&gt;Missing detail: When the missing are interrupted you now have two or more groups of missing values. So you have two or more counts of missing values possible to report. What is the actual rule for which number to keep? The largest missing sequence? The first? The last sequence? Something else?&lt;/P&gt;
&lt;P&gt;Consider your row 10. There are three series of missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you need to process variables in a single observation in a specific order then an ARRAY is almost always involved in the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dummy code because I am not going to attempt to create data from a picture.&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   array v (*) &amp;lt;your list of variables to process&amp;gt;;
  do i= 1 to dim (v);
     if missing(v[i]) then misscount= sum(misscount,1);
     /* logic would go here about how to handle the 
        interruptions, and possibly before the IF*/
  end;
run;
   
&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 14:49:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730729#M227572</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-01T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730735#M227575</link>
      <description>For now, I want only the first and the last sequence, however to future's work I would like to understand how to do for all the possible sequences in a row.</description>
      <pubDate>Thu, 01 Apr 2021 15:07:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730735#M227575</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-01T15:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730737#M227577</link>
      <description>The problem is that I have a long data, almost 1.3M of rows. It is more convinient to keep the data like that. Is it possible?</description>
      <pubDate>Thu, 01 Apr 2021 15:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730737#M227577</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-01T15:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730738#M227578</link>
      <description>Sorry, I'm new here. How can I copy the Data and put here?</description>
      <pubDate>Thu, 01 Apr 2021 15:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730738#M227578</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-01T15:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730756#M227591</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/376436"&gt;@dmarques1998&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry, I'm new here. How can I copy the Data and put here?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are some posts for how to do this.&amp;nbsp; I created this &lt;A href="https://github.com/sasutils/macros/blob/master/ds2post.sas" target="_self"&gt;macro tool&lt;/A&gt; you could try and use.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a large dataset a simple data step can generate some text to use.&amp;nbsp; Take advantage of the OBS= dataset option to limit the number of observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  file log dsd ;
  set have (obs=10);
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then just copy the text from the SAS log and you have the data for the first 10 observations in your existing HAVE dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can just make up some simple data that demonstrates the issue. In that case why not jsut type it into the program editor.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  input id var1 var2 var3;
cards;
1 100 . 200
2 . . 300
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A real advantage doing it this way is you can create some example data that clearly show the types of issues that are making the problem hard for you to solve.&amp;nbsp; Much easier than trying to identify observations of the real data that have those situations represented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes just taking the time to come up with good test data will help you clarify in your mind what the issue is and how to solve it.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 15:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730756#M227591</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-04-01T15:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730766#M227593</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/376436"&gt;@dmarques1998&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;For now, I want only the first and the last sequence, however to future's work I would like to understand how to do for all the possible sequences in a row.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you have N variables to test then you have to consider up to N/2 intervals (separate variables to record the count), or if the data has an odd N number of variable N/2+1.&lt;/P&gt;
&lt;P&gt;When you say "first" and "last" that means we need to add at least one temporary variable indicate where the current sequence is first or not.&lt;/P&gt;
&lt;P&gt;Which may mean that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;'s base approach is the most robust as you can set a "missing sequence" counter variable as well as the actual count.&lt;/P&gt;
&lt;P&gt;There are lots of processes that transpose data to one shape for a process to be robust or easier code and then shape back into a needed format (if actually needed).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best would be to manually process a smaller number of variables, 6 or 7 maybe, with different patterns of missing values, maybe 10 or 15 rows and show the expected output for those.&lt;/P&gt;
&lt;P&gt;Hint: putting multiple values into a single variable is 1) much more work to do and 2) extremely hard to work with after it is done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 16:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730766#M227593</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-01T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730772#M227595</link>
      <description>&lt;P&gt;As a hypothetical situation :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  input id var1 var2 var3 var4 var5 var6 var7 var8 var9 var10;
cards;
1 100 . 200 . . 300 . . . .
2 . . 300 . . . . 200 . . 
3 . . . . . . . . 100 . 
4 100 . . . . . . . 100 100
5 100 . . . 200 . . 200 . 
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And, as a output I want something like that:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;var1 var2 var3 var4 var5 var6 var7 var8 var9 var10 1stSeq LastSeq

1 100 . 200 . . 300 . . . .  0 4
2 . . 300 . . . . 200 . .    2 2
3 . . . . . . . . 100 .      8 1
4 100 . . . . . . . 100 100  0 0
5 100 . . . 200 . . 200 .    0 1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 09:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730772#M227595</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-05T09:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730962#M227676</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data example;
  input id var1 var2 var3 var4 var5 var6 var7 var8 var9 var10;
cards;
1 100 . 200 . . 300 . . . .
2 . . 300 . . . . 200 . . 
3 . . . . . . . . 100 . 
4 100 . . . . . . . 100 100
5 100 . . . 200 . . 200 . 
;

data want;
 set example;
 all=cats(of var:);
pid=prxparse('/\.+/');
s=1;e=length(all);
call prxnext(pid,s,e,all,p,l);
do i=1 by 1 while(p&amp;gt;0);
  if i=1 then FirstSeq=l;
  call prxnext(pid,s,e,all,p,l);
  if l ne 0 then LastSeq=l;
end;
drop all i s e p l pid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Apr 2021 12:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/730962#M227676</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-04-02T12:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734701#M228866</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dmarques1998_1-1618572562640.jpeg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/58116iBCBBC86E9F0228F3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dmarques1998_1-1618572562640.jpeg" alt="dmarques1998_1-1618572562640.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, have upload this data in excel as an example. In that specific case how can I count sucessive missing values in SAS, in the following names: Peter, Ann, Sarah and Bianca,&amp;nbsp;which are the first and de last sets of missing values&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734701#M228866</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-16T11:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Count successsive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734703#M228867</link>
      <description>&lt;P&gt;Since you seem to have an issue with Excel, you should ask your questions on a forum for that.&lt;/P&gt;
&lt;P&gt;If you have an issue with SAS data, post it as such (data step with datalines). I will positively NOT start typing values off a picture, I've got better things to do.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 11:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734703#M228867</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-04-16T11:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Count successive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734726#M228873</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data example;
input Name	N01/2020	N02/2020	N03/2020	N04/2020	N05/2020	N06/2020	N07/2020	N08/2020	N09/2020	N10/2020	N11/2020	        N12/2020;
          
John	E	D	A	.	.	.	.	.	A	A	A	E
Peter	E	E	D	A	E	D	A	.	.	.	.	.
Ann		.	.	.	.	A	D	E	A	D	E	D   .
Steve	E	.	A	.	E	.	A	.	E	.	A	.
Frank	A	E	.	.	A	E	.	.	A	E	.	.
Joanne	E	D	A	.	.	.	.	.	A	A	A	E
Sarah	E	E	D	A	E	D	A	.	.	.	.	.
Bianca	.	.	.	.	.	A	D	E	A	D	E	D
Theresa	E	.	A	.	E	.	A	.	E	.	A	.
Beatric	A	E	.	.	A	E	.	.	A	E	.	.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Sorry for my mistake&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, here is the dataset. As I said, I want to count the successsive missing values, for the following names: Peter, Ann, Sarah and Bianca&amp;nbsp;which are the first and de last sets of missing values. can you help me?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 14:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734726#M228873</guid>
      <dc:creator>dmarques1998</dc:creator>
      <dc:date>2021-04-16T14:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count successive missing values in a row or register</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734738#M228876</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/376436"&gt;@dmarques1998&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; Data example;
input Name	N01/2020	N02/2020	N03/2020	N04/2020	N05/2020	N06/2020	N07/2020	N08/2020	N09/2020	N10/2020	N11/2020	        N12/2020;
          
John	E	D	A	.	.	.	.	.	A	A	A	E
Peter	E	E	D	A	E	D	A	.	.	.	.	.
Ann		.	.	.	.	A	D	E	A	D	E	D   .
Steve	E	.	A	.	E	.	A	.	E	.	A	.
Frank	A	E	.	.	A	E	.	.	A	E	.	.
Joanne	E	D	A	.	.	.	.	.	A	A	A	E
Sarah	E	E	D	A	E	D	A	.	.	.	.	.
Bianca	.	.	.	.	.	A	D	E	A	D	E	D
Theresa	E	.	A	.	E	.	A	.	E	.	A	.
Beatric	A	E	.	.	A	E	.	.	A	E	.	.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Sorry for my mistake&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;, here is the dataset. As I said, I want to count the successsive missing values, for the following names: Peter, Ann, Sarah and Bianca&amp;nbsp;which are the first and de last sets of missing values. can you help me?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That data step doesn't run. / is not an acceptable character in variable names by default.&lt;/P&gt;
&lt;P&gt;No Datalines; or Cards; or any of the acceptable variants to&amp;nbsp; tell SAS where the data begins.&lt;/P&gt;
&lt;P&gt;And in general having data like dates in variable names is adding at least one additional headache to the problem.&lt;/P&gt;
&lt;P&gt;Plus how to show the multiple interruptions is still not actually addressed. What would the output look like.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 14:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Count-successsive-missing-values-in-a-row-or-register/m-p/734738#M228876</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-16T14:44:29Z</dc:date>
    </item>
  </channel>
</rss>

