proc shewhart on SAS QC

Reply
New Contributor
Posts: 3

proc shewhart on SAS QC

I have a program that was previously running on SAS 9.2, I just upgraded to SAS QC (version 9.4), Since the update I cannot get the proc shewhart portion of the code to run properly.

 

The code below used to produce the attached graph titled "9.2". Running the same code on SAS 9.4 QC produces the attached graph titled "SAS QC".  The difference is that the titles no longer work and the legend no longer prints out volumes as it did previously on 9.2. I have looked all over the internet, and many times the "title" command is listed above the proc shewhart, but when I do this, it still doesnt work.


proc shewhart history=vvvw;
xchart hrs *subqtr (hrsn) / stddeviations
sigmas=3 wlimits=6.5 wgrid=6.5 waxis=6.0
haxis = 31 to &endqtr by 2 /*vaxis= 2.5 to 7.5 by 0.5*/
nolegend blocklabelpos=left blockpos=4 blocklabtype=scaled
hoffset=4 voffset=4 vminor=1 hminor=0 llimits=2 ndecimal=1 cinfill=white;
label hrsx ='Hours' hrsn='Cases'
subqtr ='Year/Quarter' ;
format subqtr qqr. hospital $hospfmt.;
by hospital;
title1 h=3.8 "RESTRAINTS, September 2007-&enddate";
title2 h=2.5 "#byval(hospital): Average Length of a Restraint Episode - Units Combined";
run;

 

I am relatively new to SAS and am new to SAS QC, so any direction will be helpful!

 


9.2.png
SAS Super FREQ
Posts: 3,476

Re: proc shewhart on SAS QC

I'm not a QC expert, but I can tell you that your code uses what SAS now calls "traditional graphics." Between SAS 9.2 and SAS 9.4, most SAS procedures converted their graphical output to use the newer ODS graphics system, and ODS GRAPHICS ON is now the default setting in many SAS programming interfaces.

 

The SAS/QC doc has spilt out common options that work for many plots into a special section of the documentation. If you follow the link and click on "Options for ODS graphics" you will see the documentation for the ODSTITLE= and ODSTITLE2= statements. Mostly, I think you can delete most of the old options that begin with H and V and just set the titles. Then if something isn't appearing, read the "Option for ODS graphics" section to figure out how to add it to the graph.  This should get you started:

 

proc shewhart history=vvvw;
xchart hrs *subqtr (hrsn) / stddeviations

odstitle=title 

odstitle2=title2

etc;
run;

New Contributor
Posts: 3

Re: proc shewhart on SAS QC

This helped tremendously!!!

Thank you so much @Rick_SAS!! This had been driving me INSANE.

 

Does anyone know to to get my volumes to display along the bottom? They had also disappeared!

SAS Super FREQ
Posts: 3,476

Re: proc shewhart on SAS QC

I believe you are asking about the doc examples in the section about displaying stratification in blocks.

 

I guess I should have mentioned that your old code should still work: just put

ODS GRAPHICS OFF;

before your call to PROC SHEWHART.  But the ODS graphics look so nice I'm sure you'll be tempted to switch.

Ask a Question
Discussion stats
  • 3 replies
  • 428 views
  • 0 likes
  • 2 in conversation