Reputation: 63
I have written the following code that runs with warnings like
NOTE: Invalid numeric data, secdiags='V4975' , at line 68 column 6.
NOTE: Invalid numeric data, secdiags='V4589' , at line 68 column 6.
NOTE: Invalid numeric data, secdiags='V146' , at line 68 column 6"
Due to these warnings, records with these values are getting dropped off from the final output. What should I do to keep these values in?
Diag1, diag2, diag3...diagN columns are char columns with values like V4965 V4966 V4967 V520 3536 9059 99760 99761 99762
Data work.temp1 ;
set work.nocabg;
array secdiaggg {*} diag: ;
array diag{*} diag:;
LENGTH j 3.;
j = 1;
/* put diag1= diag2 = diag3= diag[n]= into 1 code per line.*/
do until ( j > dim(secdiaggg));
secdiags = diag[j]; /* Creates new CHAR column name secdiags */
j = j + 1;
IF secdiags NE . THEN OUTPUT;; /* This put each Diag code on a separate line for the patient. */
end;
drop j; run;
Upvotes: 0
Views: 572
Reputation: 63424
I don't know why you have two arrays of the same variables (secdiaggg
and diag
), but you presumably are running into an issue with this line:
IF secdiags NE . THEN OUTPUT;;
.
is numeric missing. secdiags
is character. So you want
IF secdiags NE ' ' THEN OUTPUT;
Or, better:
if not missing(secdiags) then output;
as the missing
function tests both equally.
Upvotes: 1