I tried different ways and searched on google to come up with a way to deal with this. But was unable to accomplish this.
Currently, my data looks like the below:
data Have;
input col1 $ col2 $ col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $;
cards;
A B B C . D A . A .
B A . C A D A B . .
A B B D D D . . . .
A . B C B D A . . .
A B B C . D A . . .
;
Goal: I want to flag all rows that have a missing column in between. For example, if there is a column 2 missing, where col1 - col8 is the series here. Important to remember that there might be instances where the sequence finishes at col5 or col4 or col6. The rest of the columns would be missing values. We need to ignore these and only flag if there is a missing column or columns in between non-missing columns.
data Have;
input col1 $ col2 $ col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $ flag$;
cards;
flag
A B B C . D A . A . 1
B A . C A D A B . . 1
A B B D D D . . . . 0
A . B C B D A . . . 1
A B B C . D A . . . 1
;
Thank you for your time.