Your SAS programs, embedded in web apps and elsewhere

Column width changed after add %stpbegin and %stpend

Reply
Occasional Contributor
Posts: 7

Column width changed after add %stpbegin and %stpend

I am working on a stored process which will be used as a web application for people query the data via website. Everything works perfect on SAS EG until we test on the website http://sas/.

I have defined the column width by using style=[outputwidth=3.25in] etc. in Proc tabulate (see teh code below). The columns look perfect when I run the Stored Process in SAS EG with default style “Ocean”.

Before moved to web application, I have added %stpbegin and %stpend. It seems that this overwrites the column width I defined in Proc Tabulate. The column width changed. My codes are below. Could anyone tell me how to keep my column width after use %stpbegin and %stpend? Thanks in advance for your help!

 

%global wantreg  _odsdest _odsoptions _odsstyle _odsstylesheet;

%let _odsdest=html;

%let _odsoptions= rs=none;

%let _ODSSTYLE=Ocean;

%let _ODSSTYLESHEET=(URL="file:///C:/Program%20Files/SASHome/SASEnterpriseGuide/5.1/Styles/Ocean.css");

%stpbegin;

PROC TABULATE

DATA=VU_Statewide  FORMAT =FREE12.;

   VAR Vol_Uti;

   CLASS Year /    ORDER=UNFORMATTED MISSING ;

   CLASS hospname /  ORDER=UNFORMATTED MISSING;

  CLASS Procedures /   ORDER=UNFORMATTED MISSING ;

classlev hospname /style=[outputwidth=3.25in font_size=2 ];

classlev procedures /style=[outputwidth=1.25in font_size=2 ];

classlev Year /style=[font_size=2] ;

  TABLE

hospname =' ' , Year=' ' *Procedures=' ' *(Vol_Uti=' ' * Sum=' ' )/box={label=' ' /*Style=[background=BURLYWOOD]*/};

  RUN;

Quit;

%stpend;

SAS Super FREQ
Posts: 8,742

Re: Column width changed after add %stpbegin and %stpend

Hi:

%STPBEGIN and %STPEND are not "overriding" your style settings. However, you are partly correct that "something" happens when you turn your program into a stored process. For example, if you run this stored process using Web Report Studio or the SAS Add-in for Microsoft Office, specifically, PowerPoint, it is entirely possible that the stored process results are NOT HTML, as you might expect (from your override to _ODSDEST reserved macro variable.

  Different client applications can only "receive" certain results from stored processes. So, for example, if you told me that you ran this SP in Web Report studio, then I would not expect your _ODSDEST, your _ODSSTYLE, or your _ODSSTYLESHEET or your style overrides to be used because Web Report Studio will not "receive" HTML results from ODS. So the client application that you're using will make a difference. Not all styles and/or style overrides are supported by all the client applications.

  I would recommend that you work with Tech Support on this. They can look at all your code, at how your are submitting the SP and which client application is involved and help you figure out how to get the sizes you want for cellwidth, if it is possible for your destination/client.

cynthia

Occasional Contributor
Posts: 7

Re: Column width changed after add %stpbegin and %stpend

Hi Cynthia,

I have read several of your papers regarding ODS and stored process. I highly respect your knowledge and thought about to contact you. I am so happy to see your reply.

I run this stored process using "SAS Stored Process Web Application". I have submitted a ticket to SAS support for this issue. Thanks a lot!

Ying

PROC Star
Posts: 1,230

Re: Column width changed after add %stpbegin and %stpend

Hi,

This is just a wild guess.  Looks like your _ODSSTYLESHEET is stored on your C: drive ? (Or maybe that is the C: drive of the server?)

Is that file accessible when the code runs as a stored process? 

It sounds like you are getting results back.  Another possible route is to view the source html you get when you run it through SPWA, compare that to the source html you get when you run it in EG, and look for differences. 

--Q.

Occasional Contributor
Posts: 7

Re: Column width changed after add %stpbegin and %stpend

Hi Q,

You have raised a very interesting question. _ODSSTYLESHEET is stored in my computer. Is it possible the reason I have gotten the right result could be my computer has SAS EG installed? I am interested in seeing what will happen if I test it on a computer without SAS EG installed.

It's a good suggestion to view the source html. I compare it with the codes in SAS EG. The column width matches. This is an example of the column width in source html:

th class="l t rowheader" style=" font-size: x-small; width: 3.25in;" scope="row">STATEWIDE </th>

But no matter how I change the number of inches for column width, I got the same results. Thanks very much for your inputs!

Ying

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