Desktop productivity for business analysts and programmers

Replace missing values "." by 0 in SAS E.G.

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

Replace missing values "." by 0 in SAS E.G.

Hello, it's again me.

 

I make a "table de sythese" and missing values are with "." and i want "0" . How can I do?

Thanks

TITLE;
TITLE1 "Tables de synthèse";
FOOTNOTE;
FOOTNOTE1 "Généré par le Système SAS (&_SASSERVERNAME, &SYSSCPL) le %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) à %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
/* -------------------------------------------------------------------
   Code généré par une tâche SAS

   Généré le : lundi 1 août 2016 à 17:10:52
   Par tâche : Tables de synthèse2

   Données d'entrée : Local:WORK.FILTER_FOR_QUERY_FOR_ACP_LO_0000
   Serveur :  Local
   ------------------------------------------------------------------- */

%_eg_conditional_dropds(WORK.TRAITES_S);

/* -------------------------------------------------------------------
   Exécuter la procédure TABULATE
   ------------------------------------------------------------------- */
PROC TABULATE
DATA=WORK.FILTER_FOR_QUERY_FOR_ACP_LO_0000

	OUT=WORK.TRAITES_S(LABEL="Tables de synthèse pour WORK.FILTER_FOR_QUERY_FOR_ACP_LO_0000")
	
	;
	
	VAR "Identifiant opération"n;
	CLASS "Thème"n /	ORDER=UNFORMATTED MISSING;
	CLASS "Centre financier"n /	ORDER=UNFORMATTED MISSING;
	TABLE /* Dimension de page */
'Centre financier'n,
/* Dimension de ligne */
'Thème'n,
/* Dimension de colonne */
N 
ColPctN
/* Options de la table */
/ PRINTMISS MISSTEXT="0" INDENT=0 		;
	;

RUN;
/* -------------------------------------------------------------------
   Fin du code de la tâche.
   ------------------------------------------------------------------- */
RUN; QUIT;
TITLE; FOOTNOTE;

 

 


Accepted Solutions
Solution
‎08-03-2016 04:23 AM
Grand Advisor
Posts: 10,215

Re: Replace missing values "." by 0 in SAS E.G.

I believe that you may be referring to the output dataset WORK.TRAITES_S. Am I correct?

If you want a 0 to appear in table view of the data set you may either set

Options missing='0';

which would make all variables with missing appear as 0 until you reset the option to the default "." which you would do with another option statement.

 

Or if you only want those variables you could use a custom format such as:

Proc format;

value mymissing

.='0'

other=[best12.]

;

run;

And associate that format with the specific variables in the data set.

 

View solution in original post


All Replies
Solution
‎08-03-2016 04:23 AM
Grand Advisor
Posts: 10,215

Re: Replace missing values "." by 0 in SAS E.G.

I believe that you may be referring to the output dataset WORK.TRAITES_S. Am I correct?

If you want a 0 to appear in table view of the data set you may either set

Options missing='0';

which would make all variables with missing appear as 0 until you reset the option to the default "." which you would do with another option statement.

 

Or if you only want those variables you could use a custom format such as:

Proc format;

value mymissing

.='0'

other=[best12.]

;

run;

And associate that format with the specific variables in the data set.

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 868 views
  • 1 like
  • 2 in conversation