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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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