BookmarkSubscribeRSS Feed
shru
Calcite | Level 5

Hi,

I need to put zero to the empty cells of an column in excel.

My code updates the the column of an excel with the some values but some rows will be empty which dont have values.

So how can i put zero's to the rows once i update my excel coulmn with figures.

I am using %openexcel;

and

put statement to put the values..

So how can i do it?

Thanks

2 REPLIES 2
OS2Rules
Obsidian | Level 7

I use "option missing=0; " in my SAS code.

to default the missing data to 0 (zero). 

Should work when writing to Excel.

shru
Calcite | Level 5

Hi,

My excel file is like this

  obs Mar-12

   1   56

   2    34

  4    .

  5   .

  6  .

  7   78

8    12

like this.

My code is

data _null_;

file sas2xl;

put unquote(bquote("select(R&rowC&col)");PUT unquote(bquote("&value");

run;

like wise my code updates the excel,but for some there wont be a value so in that place i need to put zero

How can i do this?

Help me

Thanks

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1453 views
  • 0 likes
  • 2 in conversation