Hi I am working in a bank. We have a data set with scores information for every customer. Score for each customer can be any integer between 0 to 11.(11 is a failure status). I created a vector of last 12 scores for each customer(with comma between values). I have 3 questions: Question1-Calculate How many non-missing arguments exits in the vector. For example: 7,7,9,10,9,11,11,11,11,10,11,9 Here there are 12 3,.,.,.,.,.,0,0,0,0,6,7 Here there are 7 Question2-Calculate How many missing+non-missing arguments exits in the vector. For example: 7,7,9,10,9,11,11,11,11,10,11,9 Here there are 12 3,.,.,.,.,.,0,0,0,0,6,7 Here there are 12 Question3-Calculate How many times 11 appear For example: 7,7,9,10,9,11,11,11,11,10,11,9 Here there are 5 3,.,.,.,.,.,0,0,0,0,6,7 Here there are 0 Question4-Calculate location of first failure(11) For example: 7,7,9,10,9,11,11,11,11,10,11,9 Here we need to get:6 3,.,.,.,.,.,0,0,0,0,6,7 Here we need to get:0 Data tbl1; input ID Score1 Score2 Score3 Score4 Score5 Score6 Score7 Score8 Score9 Score10 Score11 Score12; cards; 1 7 8 9 10 9 11 11 11 11 10 11 9 2 8 8 7 7 7 7 6 7 7 8 7 8 3 3 3 3 3 2 2 2 3 3 3 2 2 3 . . . . . 0 0 0 0 6 7 ; run; Data want; length ScoreVector1 ScoreVector2 ScoreVector3 ScoreVector4 $32.; set tbl1; ScoreVector1=compress(Score1)||','|| compress(Score1)||','|| compress(Score3) ||','|| compress(Score4)||','|| compress(Score5)||','|| compress(Score6) ||','|| compress(Score7)||','|| compress(Score8)||','|| compress(Score9) ||','|| compress(Score10)||','|| compress(Score11)||','|| compress(Score12); Run;
... View more