Data visualization with SAS programming

GPATH or PATH in ODS Tagset Excel

Reply
Frequent Contributor
Posts: 132

GPATH or PATH in ODS Tagset Excel

options missing=' ' topmargin=0.30in bottommargin=0.01in rightmargin=0.25in leftmargin=0.25in;

ods tagsets.ExcelXP file= '/sasdata/sasusers/sunt_smith/Mortgage_Recpature.xls';

ODS TAGSETS.ExcelXP

options(sheet_interval='none'

default_column_width='9'

sheet_name="SUMMARY"

center_horizontal="no"

frozen_headers = "Yes"

Orientation='Landscape'

embedded_titles='Yes'

fittopage="No"

blackandwhite="No"

Embedded_Footnotes='Yes'

absolute_column_width='9'

autofit_height="Yes");

PROC REPORT DATA= jaj.Mtg_stm_tot_cap_C1 style(summary)=Header;

title 'STM_TOT_CAPTURE %';

COLUMNS mdy numMorts numloans capN gla_l gla_r capD;

define mdy / order order=data style (column)=Header;

define numMorts / "STM Loans";

define numloans / "Competitor Loans";

define capN / f=number7.1'%' "STM Tot Cap#";

define gla_l / f=dollar15. "STM $";

define gla_r / f=dollar15. "Competitor $";

define capD / f=number7.1'%' "Tot Cap$";

rbreak after /summarize;*/;

endcomp;

compute after mdy;

endcomp;

label mdy = 'Month/Yr';

run;

/*above code runs fine.  Error generated starting here see bottom*/

title1 'STM Total Mortgage Capture Rate';

title2 '3 Month Moving Average';

proc sgplot data=jaj.Mtg_stm_tot_cap_C1;

series x=mdy y=CapN_Avg / markers lineattrs=(color=vibg) markerattrs=(color=vibg symbol=circlefilled)

markerattrs=(color=vibg symbol=circlefilled) ;

series x=mdy y=CapD_Avg / markers lineattrs=(color=red) markerattrs=(color=red symbol=circlefilled)

markerattrs=(color=red symbol=circlefilled) ;

label CapN_Avg = "%3MoCap#";

label CapD_Avg = "%3MoCap$";

run;

 

I am attempting to add in the proc sgplot here in the code.  However when I add in the proc sgplot I get the following error

Warning GPATH or PATH is not writable directory
Error: Cannot write image to /sasdata/sas94/config/Lev1/SASAPP/SGplot34.png

I read up on adding gpath and path however the output is in excel not html or xml.  The examples I have seen use HTML.  How can I get sgplot to work in ODS for excel??

Super User
Super User
Posts: 7,433

Re: GPATH or PATH in ODS Tagset Excel

Use the code window (its the {i} above the post area) for code, keeps the formatting and makes it easier to read.  Anyways, you are creating XML output, tagsets create tagged text output, in this case XML.  Nothing to do with Excel, although Excel can read the XML file.  

The warning is telling you that you can't write to:

/sasdata/sas94/config/Lev1/SASAPP/

Therefore set the graph output to somewhere you can write to

SAS Super FREQ
Posts: 8,745

Re: GPATH or PATH in ODS Tagset Excel

Hi:

  There is an even bigger issue. By Microsoft design, the type of XML created by TAGSETS.EXCELXP does NOT support graph images. So even if the paths were correctly pointed to a write-able location, TAGSETS.EXCELXP would NOT use the graph output.

 

  I would recommend that you use either ODS MSOFFICE2k -- to make an HTML file that Excel can open -- and the HTML output can support the inclusion of graphic output. OR use ODS EXCEL, which creates the type of XML that DOES support graph inclusion.

 

  But graphs will NOT work with TAGSETS.EXCELXP. I recommend you change to ODS EXCEL. And then, depending on how this code is being executed (from EG, from the Portal, from a Stored Process), there might need to be some changes to how the code is invoked because typically, except for EG, client applications on the BI Platform cannot "receive" TAGSETS.EXCELXP output unless the code is executed from EG or from the Stored Process Web App.

 

cynthia

Super User
Posts: 10,552

Re: GPATH or PATH in ODS Tagset Excel

I am going to guess that you are working in some sort of server model of SAS. Paths are going to be relative to the server and would require a user to have appropriate permissions.

Ask a Question
Discussion stats
  • 3 replies
  • 97 views
  • 0 likes
  • 4 in conversation