Data visualization with SAS programming

Proc greplay

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 110
Accepted Solution

Proc greplay

Hi SAS community,

 

I am tryng to draw 5 gmaps on page using greplay.But am not getting the maps one the page istead am getting an empty page.

my log window showing the NOTE:  Graph 2 not on igout catalog.
NOTE: Graph 3 not on igout catalog.
NOTE: Graph 4 not on igout catalog.
NOTE: Graph 5 not on igout catalog.

 

Below is my code..please guide

 


proc gslide gout=grafct;
%INCLUDE "&folder_path.\map1.sas";
%map1(dept,loc);
run;

%INCLUDE "&folder_path.\map2.sas";
%map2(dept,loc);
run;

%INCLUDE "&folder_path.\map3.sas";
%map3(dept,loc);
run;


%INCLUDE "&folder_path.\map4.sas";
%map4(dept,loc);
run;

%INCLUDE "&folder_path.\map5.sas";
%map5(dept,loc);
run;


proc greplay tc=work.tempcat nofs;
tdef nwtemp des="Five panel template"
1 / llx = 0 lly = 51
ulx = 0 uly = 100
urx = 33 ury = 100
lrx = 33 lry = 51

2 / llx = 34 lly = 51
ulx = 34 uly = 100
urx = 66 ury = 100
lrx = 66 lry = 51

3 / llx = 67 lly = 51
ulx = 67 uly = 100
urx = 100 ury = 100
lrx = 100 lry = 51

4 / llx = 0 lly = 0
ulx = 0 uly = 50
urx = 33 ury = 50
lrx = 33 lry = 0

5 / llx = 34 lly = 0
ulx = 34 uly = 50
urx = 66 ury = 50
lrx = 66 lry = 0;

template nwtemp;
list template;
quit;

ods pdf file="path.pdf" ;
proc greplay igout=grafct gout=excat tc=tempcat nofs;
template=nwtemp;
treplay 1:1 2:2 3:3 4:4 5:5;
quit;
ods pdf close;

 

Thanks,

Sanjay

 


Accepted Solutions
Solution
‎11-01-2016 05:33 AM
SAS Employee
Posts: 170

Re: Proc greplay

Something like this?

This prints 5 maps on a page.  You can change it around anyway you like.  This puts the 5th map on the top.  You can put it on the bottom or where ever you want.  You can make it bigger.

 

goptions reset=all border;
proc greplay tc=work.tempcat nofs;
tdef newtemp des="Five panel template"
     1/llx=0   lly=0
       ulx=0   uly=33
       urx=50  ury=33
       lrx=50  lry=0
       color=navy

     2/llx=0   lly=33
       ulx=0   uly=66
       urx=50  ury=66
       lrx=50  lry=33
       color=lime

     3/llx=50 lly=33
       ulx=50 uly=66
       urx=100 ury=66
       lrx=100 lry=33
       color=yellow

     4/llx=50 lly=0
       ulx=50 uly=33
       urx=100 ury=33
       lrx=100 lry=0
       color=cyan

     5/llx=0 lly=66
        ulx=0 uly=100
        urx=50 ury=100
        lrx=50 lry=66
        color=lipk;
template newtemp;
 list template;
 quit;

/*Change the program before to:*/
goptions reset=all hsize=5.5in vsize=5.5in;     /*Change*/
goptions device=pdf; 
proc greplay gout=sasuser.excat igout=sasuser.excat nofs
   /*tc=sashelp.templt template=l2r2;*/
   tc=work.tempcat template=newtemp;    /*Change*/
   device win;
   treplay 1:gmap 2:gmap1 3:gmap2 4:gmap3 5:gmap4;   /*Change*/
quit; 
ods listing close;
ods html;

View solution in original post


All Replies
Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: Proc greplay

Unfortunately most of the code is missing from what you posted there.  I would however suggest you look into more modern methods of producing the output, for example a data lattice with your individual plots given within that.  It wil simplfy things:

http://support.sas.com/documentation/cdl/en/grstatug/67914/HTML/default/viewer.htm#n14oy970srz6rgn1p...

There are also plenty more examples here:

http://blogs.sas.com/content/graphicallyspeaking/

 

Frequent Contributor
Posts: 110

Re: Proc greplay

Hi RW9,

 

Basically I want to draw 5 gmaps in one ods pdf. Is there is any reference programs are any help is appreciated

SAS Employee
Posts: 170

Re: Proc greplay

I think you want to create a template and then GREPLAY into it.

Here are examples of creating a template and greplay using the template.

http://support.sas.com/documentation/cdl/en/graphref/65389/HTML/default/viewer.htm#n03pr4atkbt2yzn1p...

http://support.sas.com/documentation/cdl/en/graphref/65389/HTML/default/viewer.htm#n0zqluxg8kkrign1t...

 

SAS Employee
Posts: 170

Re: Proc greplay

By the way, here are 4 maps on a pdf page.  Is it possible that you are making your images bigger than the pdf page or something like that?

 

goptions reset=all hsize=2.75in vsize=2.06in; 
ods listing close;
ods html;
proc gmap data=mapsgfk.us_states map=mapsgfk.us_states gout=sasuser.excat;  id id; choro id / nolegend; run;
proc gmap data=mapsgfk.us_counties map=mapsgfk.us_counties gout=sasuser.excat;  id id; choro id / nolegend ; run;
proc gmap data=mapsgfk.france map=mapsgfk.france gout=sasuser.excat;  id id; choro id / nolegend; run;
proc gmap data=mapsgfk.namerica map=mapsgfk.namerica gout=sasuser.excat;  id id; choro id /nolegend; run; quit;

goptions reset=all hsize=5.5in vsize=4.12in; 
goptions device=pdf; 
proc greplay gout=sasuser.excat igout=sasuser.excat nofs
   tc=sashelp.templt template=l2r2;
   device win;
   treplay 1:gmap 2:gmap1 3:gmap2 4:gmap3;
quit; 
ods listing close;
ods html;

 

Frequent Contributor
Posts: 110

Re: Proc greplay

Hi Darrell,

 

Thats really helps me, but I want to add 5 gmaps on one page is there is anyway to do this.

 

Thanks & Regards,

Sanjay

Grand Advisor
Posts: 10,210

Re: Proc greplay

Any warnings or error messages?

 

I would double check the names of the output catalogs and that you have the gout settings to be replace as you may have items in the catalog you don't want.

Without 1)data 2) complete code and or 3) log with option mprint symbolgen turned on it is a bit difficult to diagnose specific issues.

Solution
‎11-01-2016 05:33 AM
SAS Employee
Posts: 170

Re: Proc greplay

Something like this?

This prints 5 maps on a page.  You can change it around anyway you like.  This puts the 5th map on the top.  You can put it on the bottom or where ever you want.  You can make it bigger.

 

goptions reset=all border;
proc greplay tc=work.tempcat nofs;
tdef newtemp des="Five panel template"
     1/llx=0   lly=0
       ulx=0   uly=33
       urx=50  ury=33
       lrx=50  lry=0
       color=navy

     2/llx=0   lly=33
       ulx=0   uly=66
       urx=50  ury=66
       lrx=50  lry=33
       color=lime

     3/llx=50 lly=33
       ulx=50 uly=66
       urx=100 ury=66
       lrx=100 lry=33
       color=yellow

     4/llx=50 lly=0
       ulx=50 uly=33
       urx=100 ury=33
       lrx=100 lry=0
       color=cyan

     5/llx=0 lly=66
        ulx=0 uly=100
        urx=50 ury=100
        lrx=50 lry=66
        color=lipk;
template newtemp;
 list template;
 quit;

/*Change the program before to:*/
goptions reset=all hsize=5.5in vsize=5.5in;     /*Change*/
goptions device=pdf; 
proc greplay gout=sasuser.excat igout=sasuser.excat nofs
   /*tc=sashelp.templt template=l2r2;*/
   tc=work.tempcat template=newtemp;    /*Change*/
   device win;
   treplay 1:gmap 2:gmap1 3:gmap2 4:gmap3 5:gmap4;   /*Change*/
quit; 
ods listing close;
ods html;
Frequent Contributor
Posts: 110

Re: Proc greplay

Hi Darrel,

 

Thank you very much, that works for me..But how could I get a Title statement at the top of the page. I have tried with ods pdf text and title statement but I didnt get title statment on the page.

 

ods pdf file="path.pdf";

title h=2 justify=c "xcxcx";

proc greplay gout=sasuser.excat igout=sasuser.excat nofs

 tc=work.tempcat template=newtemp; device win; treplay 1:gmap 2:gmap1 3:gmap2 4:gmap3 5:gmap4; /*Change*/

run;

quit; ods pdf close;

 

when am Using the ods pdf text, then text is coming in one page and the 5 maps in the another page. I need both title and 5 maps in one page.Is there is anyway please giude.

 

Thanks & Regards,

Sanjay

 

New Contributor
Posts: 2

Re: Proc greplay

Sanjay,

You can use annotate your titles with "Proc gslide" by adding the code below in front of your code.

 

Ethan

 

%let title1=DASHBOARD REPORT;

%let title2=in X Market;

 

/* Define fonts for indicator and dashboard titles and text. */

%let ftitle='albany amt/bold';

 

 

data anno_titl;

length function color $8 style $20 text $100;

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

function='label';

position='5';

 

 

/* Annotated Title Text at top of page */

x=50;

size=2.3; color='purple';

style="&ftitle";

y=99.5; text="&title1";

output;

size=1.7; color='black';

style="&ftitle";

y=y-2.8; text="&title2";

output;

 

run;

 

/* Draw the titles on a blank slide and save the output in a

GRSEG named titles. */

goptions hsize=10in vsize=7.5in; /* Modified by SAS */

title;

footnote;

proc gslide name="titles" anno=anno_titl;

run;

SAS Employee
Posts: 170

Re: Proc greplay

[ Edited ]

I think this is correct, but I think you will need to add a title spot to your template to get it on the same page.

See the following:

http://support.sas.com/documentation/cdl/en/graphref/67881/HTML/default/viewer.htm#n02rar8udulzhjn17...

☑ This topic is SOLVED.

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

Discussion stats
  • 10 replies
  • 523 views
  • 0 likes
  • 5 in conversation