BookmarkSubscribeRSS Feed
Trocar valores "missing" por zeros
brassi
SAS Employee

/****************************************************************************/ 

/* Este é um procedimento para trocar valores númericos   */ 

/* faltantes (missings) de uma tabela por zeros */ 

/* Qual? Proc Stdize! */ 

/****************************************************************************/ 

 

 

/*-------------------*/ 

/* inicio do código */ 

/*-------------------*/ 

 

data test; 

infile DATALINES dsd missover; 

input varnum1 varnum2 varnum3 varnum4; 

cards; 

1, ., 2, 3 

., 4, 5, 6 

7, 8, ., . 

1, ., ., . 

; 

 

proc stdize data=test out=test1  

reponly missing=0; /* a opção REPONLY em conjunto com a opção MISSING= 

Anula o processo de padronização e troca os missings por zero*/ 

run; 

 

/*----------------*/ 

/* fim do código */ 

/*----------------*/ 

 

/* AVISO IMPORTANTE: todas as variáveis devem ser numéricas */ 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Article Labels
Article Tags
Contributors