Data visualization with SAS programming

SAS Graph and Proc GREPLAY Output

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

SAS Graph and Proc GREPLAY Output

I am working on a dashbaord.  I have been following and using the code as noted in Mr Allisons's book: SAS/GRAPH Beyond The Basics.  (A FANTASTIC BOOK by the way!!!!).  The dashboard then will be output via ODS PowerPoint as that is the desired medium.  My issue is that I cannot seem to get the individual graph titles to appear in each GREPLAY section.  I have adjusted the individual pixel size of each graph output by applying the % of the total pixels size to the designated graph as outlined in the book.  But regardless of what I do I cannot seem to get the titles to appear.  I even have tried making the graph indivual pixel size smaller but no changes.  I believe I am missing a key concept/item, however I am at a loss.  Any assistance would be appreciated.  If looking to run the below code, first delete or comment out the PROC TEMPLATE code for the powerpoint set up (due to the background image) and then change the file name in the ODS output statement.  I left them in here in case it is something I am doing within these statements that is impacting my output.  Thank you.

 

/* reset all and set options/macros for later use */

goptions reset=all;

goptions device=png;

goptions display;

%let titlesize=10;

%let textsize=6.5;

%let legendtitlesize=7;

%let fnt='albany amt';

%let fntb='albany amt/bold';

/* delete gsreg catalog to start fresh*/

proc catalog c=work.gseg kill;

RUN;

/* PowerPoint Template */

/* Note other running this code will want to change or comment this piece out due to background image reference*/

PROC TEMPLATE;

DEFINE STYLE MyPPStyle1;

PARENT=styles.pearl;

CLASS Body / /*fontfamily=calibri fontsize=12pt*/ BACKGROUNDIMAGE='/sasuserhome/nbkqsn7/DailyDashboard/PowerPoint.jpg';

/* CLASS Systemtitle / fontfamily=calibri fontsize=12pt fontweight=bold;*/

/* CLASS title / fontfamily=calibri fontsize=12pt fontweight=bold color=blue textdecoration=underline;*/

/* class usertext from systemtitle / just=c;*/

/* CLASS FOOTNOTE / fontfamily=calibri fontsize=12pt fontweight=bold color=blue textdecoration=underline;*/

END;

RUN;

/* Sample data to test the output */

DATA WORK.TESTING;

INPUT letter $1 value;

DATALINES;

A 1

B 2

C 3

;

RUN;

/* Create the graphs for the various metrics */

/*annotation dataset */

Data TITLEANNO;

LENGTH function $8 color style $20 text $50;

RETAIN xsys ysys '3' hsys '3' when 'a';

function='label';

position='5';

x=50;

y=50;

color='black';

size=22;

style='Albany AMT';

text='Sample Header';

OUTPUT;

RUN;

/*create Header output */

/* the pixel size is determined by taking a % of the overall pixel size and applying. This graph is 42.5% by 5% of 1500 (wide) 1000 (height) */

goptions xpixels=637.5 ypixels=50;

PROC GSLIDE anno=TITLEANNO name="mytitles";

RUN;

/*create bar chart output for testing */

/* the pixel size is determined by taking a % of the overall pixel size and applying. This graph is 20% by 20% of 1500 (wide) 1000 (height) */

goptions xpixels=300 ypixels=200 gunit=pct htitle=5 ftitle="Albany AMT" htext=5 ftext="Albany AMT";

axis1 label=none value=none major=none minor=none;

axis2 label=none;

pattern1 v=s c=blue;

PROC GCHART data=WORK.TESTING;

TITLE /*height=8pt*/ "Simple";

vbar letter / type=sum sumvar=value nostats width=15 space=8

raxis=axis1 maxis=axis2 noframe name="check";

RUN;

/* create series plot outpuit for testing */

/* the pixel size is determined by taking a % of the overall pixel size and applying. This graph is 42.5% by 30% of 1500 (wide) 1000 (height) */

goptions xpixels=637.5 ypixels=300;

axis1 label=none value=none major=none minor=none;

axis2 label=none;

symbol1 value=dot h=3 interpol=join w=2 color=blue;

PROC GPLOT data=WORK.TESTING;

PLOT value*letter /haxis=axis1 vaxis=axis2 name="pipegph" noframe;

RUN;

/* Create template to hold outputs and PowerPoint ODS output */

ods listing image_dpi=300;

goptions xpixels=1500 ypixels=1000;

goptions cback=white;

goptions border;

OPTIONS ORIENTATION=LANDSCAPE;

options nodate nonumber topmargin=.1in;

ODS NOPROCTITLE;

ods escapechar='^';

/*note others running will want to change this line of code*/

ODS POWERPOINT file='/sasuserhome/nbkqsn7/ContTowerTrend5.pptx' STYLE=MyPPStyle1 nogfootnote gtitle;

ODS POWERPOINT LAYOUT=_NULL_;

goptions gunit=pct htitle=&titlesize ftitle=&fntb htext=&textsize ftext=&fnt;

TITLE;

FOOTNOTE;

PROC GREPLAY tc=tempcat nofs igout=work.gseg;

TDEF dashbrd des='Dashboard'

/* left side */

/* overall title whole page*/

1/llx=5 lly=90

ulx=5 uly=100

urx=47.5 ury=100

lrx=47.5 lry=90

color=black

/* volumes header */

2/llx=5 lly=83

ulx=5 uly=88

urx=47.5 ury=88

lrx=47.5 lry=83

color=black

/* pipe app disp graph */

3/llx=5 lly=50

ulx=5 uly=80

urx=47.5 ury=80

lrx=47.5 lry=50

color=black

/* total fund unit graph */

4/llx=5 lly=25

ulx=5 uly=45

urx=25 ury=45

lrx=25 lry=25

color=black

/* fund $ volume graph */

5/llx=27.5 lly=25

ulx=27.5 uly=45

urx=47.5 ury=45

lrx=47.5 lry=25

color=black

/* Total Dispos graph */

6/llx=5 lly=3

ulx=5 uly=23

urx=25 ury=23

lrx=25 lry=3

color=black

/* Dispos per Biz Day graph */

7/llx=27.5 lly=3

ulx=27.5 uly=23

urx=47.5 ury=23

lrx=47.5 lry=3

color=black

/* Right side */

/* Sppeds Header */

8/llx=52.5 lly=95

ulx=52.5 uly=100

urx=97.5 ury=100

lrx=97.5 lry=95

color=black

/* App To ICA Cycle Time graph */

9/llx=52.5 lly=73

ulx=52.5 uly=93

urx=72.5 ury=93

lrx=72.5 lry=73

color=black

/* ICA To Close Cycle Time Graph */

10/llx=77.5 lly=73

ulx=77.5 uly=93

urx=97.5 ury=93

lrx=97.5 lry=73

color=black

/* Aged 60 /90 graph */

11/llx=52.5 lly=51

ulx=52.5 uly=71

urx=72.5 ury=71

lrx=72.5 lry=51

color=black

/* Fund Cycle Time */

12/llx=77.5 lly=51

ulx=77.5 uly=71

urx=97.5 ury=71

lrx=97.5 lry=51

color=black

/* PERFORMANCE Header */

13/llx=52.5 lly=45

ulx=52.5 uly=50

urx=97.5 ury=50

lrx=97.5 lry=45

color=black

/* ICD On time */

14/llx=52.5 lly=23

ulx=52.5 uly=43

urx=72.5 ury=43

lrx=72.5 lry=23

color=black

/* COT Graphs */

15/llx=77.5 lly=23

ulx=77.5 uly=43

urx=97.5 ury=43

lrx=97.5 lry=23

color=black

/* Late Loan Ct */

16/llx=52.5 lly=2

ulx=52.5 uly=22

urx=72.5 ury=22

lrx=72.5 lry=2

color=black

/* Late Loan % */

17/llx=77.5 lly=2

ulx=77.5 uly=22

urx=97.5 ury=22

lrx=97.5 lry=2

color=black;

template = dashbrd;

/*

nn:abc

nn = matches numbers in the greplay template

abc = matches the names of the graph grsegs (ie, the name='abc' on the proc gchart, etc)

*/

treplay

1:mytitles 2:mytitles 3Smiley Tongueipegph

4:check 5:check 6:check 7:check 8:mytitles

9:check 10:check 11:check 12:check 13:mytitles

14:check 15:check 16:check 17:check

des='' name="MyDB";

run;

quit;

ODS POWERPOINT CLOSE;


Accepted Solutions
Solution
2 weeks ago
SAS Employee
Posts: 967

Re: SAS Graph and Proc GREPLAY Output

Usually, when the title does not show up in the graph, it is because 'nogtitle' is in effect. Most often this is not an intentional setting the user made, but rather a default based on the way the SAS job is being run - for example, if you run the job through EG, or through a Stored Process, I think the default is usually 'nogtitle'.

 

So, I guess the big/first question is "How are you running your SAS job?" Smiley Happy

View solution in original post


All Replies
Grand Advisor
Posts: 10,051

Re: SAS Graph and Proc GREPLAY Output

The key concept you are missing perhaps is that GREPLAY was never designed for use with ODS. So when using the device based graphics procedures things may get a tad difficult.

 

But since you are using POWERPOINT then this may be of interest from the documentation.

 

You must use either the PowerPointLight or PowerPointDark style, or a style that inherits from one of these two styles. The use of any other style will not produce satisfactory results.  

 

I am fairly sure that Pearl inherits from Printer, not the PowerPoint styles.

Trusted Advisor
Posts: 1,418

Re: SAS Graph and Proc GREPLAY Output

You are asking us to look at an awful lot of code.

For our sake in isolating/reproducing an issue (and for yours too), reduce the issue into a few lines of code (ideally one simple graphic using sample data) that we can reproduce.

Contributor
Posts: 30

Re: SAS Graph and Proc GREPLAY Output

Thank you that is good feedback.  I thought the amount of plots in the Greeplay output may be impacting as when I started with a few plots, they seemed to work fine.  It was after I added plots and changed the pixel size that my issues began.  But none the less, for future posts I will certainly follow your advice, it is good feedback.  Thank you.

Solution
2 weeks ago
SAS Employee
Posts: 967

Re: SAS Graph and Proc GREPLAY Output

Usually, when the title does not show up in the graph, it is because 'nogtitle' is in effect. Most often this is not an intentional setting the user made, but rather a default based on the way the SAS job is being run - for example, if you run the job through EG, or through a Stored Process, I think the default is usually 'nogtitle'.

 

So, I guess the big/first question is "How are you running your SAS job?" Smiley Happy

Contributor
Posts: 30

Re: SAS Graph and Proc GREPLAY Output

Good Morning, thank you for your reply (As well as the great book).  I am running in EG.  I did attempt to cover every aspect of potential issues in EG as noted in the preface in your book.  But I believe you are correct.  I was building a graph in a separate EG program prior to placing in the plot statement.  I had not changed the name so the next day when I first ran my program, the titles appeared.  But then every sequential run of the greplay template and program then removed the titles.  So I believe I have missed a setting somewhere.  Ironically, this may not be all bad.  I changed my approach and labeled the x axis with what would normally be the title.  This gives me just a bit more room for the visualization which is looking nice.  I will go back and check and adjust my settings.  Specifically the nogtitle.  That is good feedback thank you.  And thank you for your code/book.  It was invaluable to being able to create a dashboard.  A truely great resource.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 142 views
  • 1 like
  • 4 in conversation