BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a dataset named grocmiss and for few of the columns in this dataset there are missing values.When I use this missing values in the report compute block for missing values the report display it as dot.

1 2 3 4 5
Sector Sales Sales Sales Sales Sales
ne . . . . $596.00 .
nw . . $690.00 $598.00 .
se $130.00 $630.00 . . .
sw . . . . $353.00
$130.00 $630.00 $690.00 $598.00 $949.00

Whereever there is DOT I want the report to be displayed as SPACE or ZERO. Secnod requirement is I dont want the header Sales to be displayed in the output but the values to be summarised.

Please help me.

Here is the code:-

data grocmiss;
input Sector $ Manager $ Department $ Sales @@;
datalines;
se 1 np1 50 . 1 p1 100 se . np2 120 se 1 p2 80
se 2 np1 40 se 2 p1 300 se 2 np2 220 se 2 p2 70
nw 3 np1 60 nw 3 p1 600 . 3 np2 420 nw 3 p2 30
nw 4 np1 45 nw 4 p1 250 nw 4 np2 230 nw 4 p2 73
nw 9 np1 45 nw 9 p1 205 nw 9 np2 420 nw 9 p2 76
sw 5 np1 53 sw 5 p1 130 sw 5 np2 120 sw 5 p2 50
. . np1 40 sw 6 p1 350 sw 6 np2 225 sw 6 p2 80
ne 7 np1 90 ne . p1 190 ne 7 np2 420 ne 7 p2 86
ne 8 np1 200 ne 8 p1 300 ne 8 np2 420 ne 8 p2 125
;

proc report data=grocmiss nowd headline ;
column sector manager,sales;
define sector / group format=$sctrfmt.;
define manager / across format=$mgrfmt.;
define sales /sum format=dollar9.2 ;
rbreak after / dol summarize;

title 'Summary Report for All Sectors and Managers';
run;
1 REPLY 1
FredrikE
Rhodochrosite | Level 12
Try this:

data t;
length name $20 age 8;
name = 'Kalle1'; age = 10; output;
name = 'Kalle2'; age = .; output;
name = 'Kalle3'; age = 12; output;
name = 'Kalle4'; age = 13; output;
name = 'Kalle5'; age = .; output;
run;

proc format;
picture nice
. = ' '
low-high = '000 000 000 000';
run;


proc report data = t;
column name age;
define name / 'Namn';
define age / '' format=nice.;
run;


//Fredrik

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
  • 1 reply
  • 619 views
  • 0 likes
  • 2 in conversation