BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Kirito1
Quartz | Level 8

I am working on proc tabulate and I want to fill all the null entry cell with zeros what should I do.

Following is the code and ss of the result while i used proc tabulate.

proc tabulate data=DST_EMP3 out= F1 (drop=_TYPE_ _PAGE_ _TABLE_);
  class EMP_CODE DATE_OF_APPROVAL;
  table EMP_CODE, DATE_OF_APPROVAL;
run;

I want where data is showing .(dot) it should be replaced by 0(zero).

Kirito1_0-1673853728401.png

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Add the following line of code before your Proc Tabulate

options missing='0';

Alternatively if you don't want to change this globally something like below would also work.

proc format;
  value missingToZero
    .='0'
    ;
run;

proc tabulate data=DST_EMP3 out= F1 (drop=_TYPE_ _PAGE_ _TABLE_);
  class EMP_CODE DATE_OF_APPROVAL;
  table EMP_CODE, DATE_OF_APPROVAL*f=missingToZero.;
run;

 

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

Add the following line of code before your Proc Tabulate

options missing='0';

Alternatively if you don't want to change this globally something like below would also work.

proc format;
  value missingToZero
    .='0'
    ;
run;

proc tabulate data=DST_EMP3 out= F1 (drop=_TYPE_ _PAGE_ _TABLE_);
  class EMP_CODE DATE_OF_APPROVAL;
  table EMP_CODE, DATE_OF_APPROVAL*f=missingToZero.;
run;

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2183 views
  • 2 likes
  • 3 in conversation