Date: Thu, 15 Aug 2002 09:30:46 -0400
Reply-To: "Gerstle, John" <yzg9@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Gerstle, John" <yzg9@CDC.GOV>
Subject: Re: Proc Report, ODS HTML, and Call Define, Repeated
Content-Type: multipart/alternative;
Mike & Ray,
Thanks for the ideas. I may be able to hard code the HTML using the macro
variables for the paths of the formats. It'll take some time though, but
if/when I get it done and I'm happy with it, I'll let SAS-List know.
Thanks!
John Gerstle
Biostatistician
CDC Information Systems Support Services (CISSS)
Contractor Support to NCHSTP / Division of HIV/AIDS Prevention
Phone: 404-639-3980
Fax: 404-639-2980
Cell: 770-639-5060
-----Original Message-----
From: Mike Rhoads [mailto:RHOADSM1@WESTAT.com]
Sent: Thursday, August 15, 2002 8:25 AM
To: 'Gerstle, John'; SAS-L@LISTSERV.UGA.EDU; 'raypass@att.net'
Subject: RE: Proc Report, ODS HTML, and Call Define, Repeated
John,
Here are my quick thoughts on this.
The URL argument in CALL DEFINE is a convenient shortcut to make the
contents of a cell a hotlink, but it's not the only way. Since it isn't
doing what you want and it's difficult (if not impossible) to customize its
behavior in the way you'd like, I'd take a more manual approach:
1. Make the contents of the cell the exact HTML you want. You could do
this by preprocessing the data, or even within your COMPUTE block.
2. You will probably need to work in the PROTECTSPECIALCHARS=OFF style
attribute so PROC REPORT allows your <> etc. characters to be interpreted as
HTML tags rather than being treated as text.
HTH!
Mike Rhoads
Westat
RhoadsM1@Westat.com
-----Original Message-----
From: Gerstle, John [mailto:yzg9@CDC.GOV]
Sent: Wednesday, August 14, 2002 4:43 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Proc Report, ODS HTML, and Call Define, Repeated
That's the thing. As is, it works.
For each format listed, it is an URL link to its own format label HTML page.
For example:
REPORT
Char
2
$SURST.
<file:///O:\aidsdata\SASDATA\SASWORK\YZG9\DHAP%20Complete%20Data%20Dictionar
y\formats\HARS_LIB.FORMATS.SURSTA.htm>
A_LIB.FORMATS
REPORT SIZE
(of course this will not/should not open a page for you, but imagine the if
you did click on it, you would get a page of the format label for format
$SURST)
What I would like to do is modify this somehow - mainly, how could you
change it so that when you click on the URL link for each format, the
webpage will open a new (and smaller) webpage, instead of replacing the page
you're looking at. I've added Back buttons to the format pages, so that's a
workaround.
I just want to know if it's possible, with v8.2, to be able to control from
SAS the number of webpages and their size instead of changing the HTML code
(by hand). The call define in the compute statement seems to be the place,
but it gave me a syntax error when I tried to put two sets of things in the
parameters of the call define. I tried two call defines, but that didn't do
what I would like (if my memory serves, the 'TARGET=_blank' phrase was added
outside of the href anchor tag and so the phrase was shown in the cell along
with the URL-ized format name)..
Something to the effect:
Old, working version:
if fmtlink ne '' then call define('format',"URL",fmtlink); endcomp;
New test version that didn't quite work (from memory):
if fmtlink ne '' then do;
call define('format',"URL",fmtlink);
call define('format',"STYLE",'TAGATTR'='TARGET=_blank');
endcomp;
I know that having 'TARGET=_blank' in the anchor href tag will cause the
page to open in a new window. But how to put it there via SAS?
John Gerstle
-----Original Message-----
From: Ray Pass [mailto:raypass@att.net]
Sent: Wednesday, August 14, 2002 9:31 AM
To: Gerstle, John
Subject: Re: Proc Report, ODS HTML, and Call Define, Repeated
John,
How is it not working? What do the cells under FORMAT contain? Are you
getting an error in the log? Can we see some data, output, logs, etc?
Ray
At 08:32 AM 08/14/2002 -0400, you wrote:
I'm re-sending this since I received no responses two weeks ago.
Folks,
I'm confused about something. Below is code from a larger program (macro
actually), and my question centers around the computing fmtlink in the PROC
REPORT. How does SAS create/compute an URL link? I've been reading through
the online SAS help, but it doesn't explain it well enough for me. Does it
have something to do with the ODS HTML path, frame, body, contents, etc?
I'm thinking it might.
What I would like to do is for each fmtlink that exists, if you click on it
in the webpage, a new smaller window pops up. I know that TARGET='_BLANK' ,
if added to an anchor (<a href=....></a>) will cause a new blank window to
open and I have been successful in doing this in the HTML code outside of
SAS. Haven't had any luck with the smaller window size - something to do
with using a Javascript within the same anchor, but it does not want to
work.
If anyone knows how I can add this to the call define line when computing
fmtlink (see below marked line of code), I would appreciate it. Or if there
is another way...
<New thoughts>
Recently while perusing the default style from proc template, I ran across
'style StartUpFunction' which has the comment: "Controls the StartUp
Function. TAGATTR is only element used." So would another way include
creating a new style with
Style StartUpFunction /
'TAGATTR = "_blank" ';
????
Any thoughts/suggestions??? Thanks!
Original code:
ods html path="&HTMLpath" (url=none)
frame="&FrameName..htm"
body="datasets\%scan(&NewDSx,1,%str( )).htm"
contents="&FrameName._Contents.htm";
proc report nowd headline headskip split='*' contents='Variable
List';
column numb name fmtlink type length format FormatLib label;
define numb / computed '#' center ;
define name / order order=data 'Variable*Name' left
width=&maxlen;
define type / display 'Type' center ;
define length / display 'Length' center ;
define format / display 'Format' left ;
define FormatLib / display 'Format*Catalog' center flow ;
define label / display 'Label' left
width=%eval(25+(30-&maxlen)) flow;
define fmtlink / display noprint;
compute numb; count+1; numb=count;
endcomp;
compute FormatLib; call define(_col_,"STYLE","STYLE=[font_size=2]");
endcomp;
/****/
compute fmtlink; if fmtlink ne '' then call
define('format',"URL",fmtlink); endcomp;
/****/
run;
ods html close;
[text/html]