BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
HabAM
Quartz | Level 8

I need help pointing out what I am doing wrong. I am trying to put a ref line in my graph.

 

Here is my code:

proc sgplot data=graph;
vbar date/ group=group dataskin=pressed;
xaxis label='Onset date' values = ('01Jan2017'd to '30Jun2017'd by day) display=( novalues) ;
yaxis label='Number of Cases' values = (0 to 8 by 1) ;
format date date9.;
refline '01MAR2017'd / axis=x ;
run;

 

Here is my data format:

SAS Output

Alphabetic List of Variables and Attributes # Variable Type Len Format Informat Label 2 1
groupChar27   
dateNum8DATE9.DATE9.date
HabAM
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

When putting a reference line on a discrete axis, you must use the formatted value. In your case, the REFLINE should look like this:

 

refline '01Mar2017' / axis=x ;

 

Hope this helps!

Dan

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

When putting a reference line on a discrete axis, you must use the formatted value. In your case, the REFLINE should look like this:

 

refline '01Mar2017' / axis=x ;

 

Hope this helps!

Dan

HabAM
Quartz | Level 8

Thank you it worked. I didn't realize it would be cases senstitve also. 

HabAM

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of 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
  • 2168 views
  • 0 likes
  • 2 in conversation