BookmarkSubscribeRSS Feed
SanjayM
Calcite | Level 5
I am using this custom format to replace the missing values of a column with 0.00

On doing this the values 0.00 gets left aligned.

1. How to get them right aligned along with the other values.
2. Is there any other way by which we can replace the missing values with 0.00 and should appear as right aligned when used in proce report



data work.Test;
input code $ sales 10.2;
datalines;
A1001 2500.25
A1002 3500
A1003 .
A1004 0.4
run;

proc format;
value abc .= 0.00 other=[comma12.2];
run;

proc report data=Work.Test;
column code sales;
define sales / display format=abc. ;
run;
2 REPLIES 2
SanjayM
Calcite | Level 5
Can somebody reply please
Cynthia_sas
SAS Super FREQ
Hi:
Partly the answer depends on your destination of choice. You can use this syntax for RTF, PDF and HTML:
[pre]
define sales / display format=abc.
style(column)={just=r};
[/pre]

but the downside is that this syntax won't work for LISTING.

One solution that would work for all destinations, including LISTING, would be to add a compute block to your code:
[pre]
* USAGE=DISPLAY;
compute sales;
if sales = . then sales = 0.00;
endcomp;
OR
*USAGE=SUM or default usage is used;
compute sales;
if sales.sum = . then sales.sum = 0.00;
endcomp;
[/pre]

If you need help faster than people on the forum respond, your best bet for a quick response is to contact Tech Support.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 697 views
  • 0 likes
  • 2 in conversation