BookmarkSubscribeRSS Feed
yyangca
Calcite | Level 5

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;

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

yyangca
Calcite | Level 5

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

Quentin
Super User

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.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
yyangca
Calcite | Level 5

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1069 views
  • 3 likes
  • 3 in conversation