BookmarkSubscribeRSS Feed
laneylaners
Obsidian | Level 7

In excel, i can get a graph to show a 'gap' for missing data:

 

 gaps.JPG

 

how can i do this in sas?  this is the output i'm getting:

 

gaps 2.JPG

here is a snippet of the  data below, including the missing data as "."

 

 

 date count

11/01/2008 34
12/01/2008 26
01/01/2009 27
02/01/2009 19
03/01/2009 25
04/01/2009 36
05/01/2009 .
06/01/2009 .
07/01/2009 13
08/01/2009 15
09/01/2009 11
10/01/2009 11
11/01/2009 12
12/01/2009 27 

 

 

 

Here is my code for the graph:

ods graphics on / width=10in height=5in ;

goptions htext=15pt ;

title h=15pt "Counts";

proc sgplot data=work.monthly_no_HU_merged;

series x=date y=count/ lineattrs=(color=firebrick thickness=2.5);

xaxis valueattrs=(size=7pt) label="Month/Year" labelattrs=(size=10pt) interval=quarter minor valuesformat=monyy5.;

yaxis valueattrs=(size=10pt) label="#" grid labelattrs=(size=12pt) values=(0 to 100 by 5);

run;

title;

2 REPLIES 2
ballardw
Super User

Add the BREAK option to the SERIES statement.

laneylaners
Obsidian | Level 7

simple solution that worked perfectly.  thank you!

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
  • 2710 views
  • 4 likes
  • 2 in conversation