例 Reading Missing Values at the End of a Record Suppose the third person represented in the raw data file below did not answer the questions about how many department store credit cards she has and how often she uses them 1-+2-一-10-+- 20 2LE271800 FEMALE 3 14 5 10 FEM2LE34210■ MALE3521248 FEMALE 36 4 16 3 7 MALE211500 MALE252921 FEMALE 21 1 4 2 6 LE3831143 FEMALE 30 3 5 1 0
例 Reading Missing Values at the End of a Record • Suppose the third person represented in the raw data file below did not answer the questions about how many department store credit cards she has and how often she uses them
Because the missing values occur at the end of the record,you can use the MISSOVER option in the INFILE statement to read the missing values at the end of the record. The MISSOVER option prevents SAS from going to another record if,when using list input, it does not find values in the current line for all the INPUT statement variables. At the end of the current record,values that are expected but not found are set to missing
• Because the missing values occur at the end of the record, you can use the MISSOVER option in the INFILE statement to read the missing values at the end of the record. • The MISSOVER option prevents SAS from going to another record if, when using list input, it does not find values in the current line for all the INPUT statement variables. • At the end of the current record, values that are expected but not found are set to missing
·data perm.survey; infile credit missover; input Gender Age Bankcard FreqBank Deptcard FreqDept; run; Obs gender age bankcard fregbank deptcard freqdept male 27 8 0 0 female 29 3 14 5 10 female 只 2 10 male 35 2 female 36 4 16 6 male 21 1 5 0 0
• data perm.survey; infile credit missover; input Gender $ Age Bankcard FreqBank Deptcard FreqDept; run;
Obs gender age bankcard freqbank deptcard freqdept 1 male 27 1 8 0 0 2 female 29 3 14 5 10 3 female 34 2 10 35 4 female 36 4 16 3 7 5 male 21 1 5 0 0
例 Reading Missing Values at the Beginning or Middle of a Record Suppose the value for Age is missing in the first record. Raw Data File Credit2 1-+-10-+-20 ALE,1,8,0,0 FAE,29,3,14,5,10 FEMALE,34,2,10,3,3 ALE,35,2,12,4,8 FEMALE,36,4,16,3,7
例 Reading Missing Values at the Beginning or Middle of a Record • Suppose the value for Age is missing in the first record