data have;
length col1-col10 $2.;
input col1-col10;
datalines;
PM MM JM MM PM MM MM PB . .
MM JM PM MB . . . . . .
MM MM PM JM PB MM . . . .
PM PM PM MM MB MM JM . . .
;
run;
Goal: Hi all,
My goal here is that I want to flag all records which have values other than 'PB' or 'MB' after them in sequence across the columns.
Any help is appreciated. Thanks!
Expected output:
Flag
PM MM JM MM PM MM MM PB . . 0
MM JM PM MB . . . . . . 0
MM MM PM JM PB MM . . . . 1
PM PM PM MM MB MM JM . . . 1