LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 15 Aug 2002 11:03:54 -0400
Reply-To:   Ray Pass <raypass@ATT.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ray Pass <raypass@ATT.NET>
Subject:   Re: Proc Report, ODS HTML, and Call Define, Repeated
In-Reply-To:   <B2895F594E95D511A52100508BA36E6E178D7C@EXCHANGESERVER>
Content-Type:   multipart/alternative;

SWEET! Now all ya gotta do is add some code to the COMPUTE block to define the URL based on the value of FMTLINK. I tested it and it works, but ya gotta remember to add the http:\\ to the address.

compute fmtlink; if fmtlink ne '' then do; %let address = 'something based on the current value of FMTLINK'; call define('format',"STYLE","STYLE=[hreftarget='_blank' URL=&address]"); end; endcomp;

Ray

At 10:39 AM 08/15/2002 -0400, qjiang wrote: >"urn:schemas-microsoft-com:office:office" xmlns:w = >"urn:schemas-microsoft-com:office:word" xmlns:st1 = >"urn:schemas-microsoft-com:office:smarttags"> >Hi, John , > >Check this out: > > >ODS html file='C:\temp\test.html' ; > >proc report data= sashelp.class nowd; > > column name sex ; > > compute sex; if sex ne 'M' then > > call define('name',"STYLE","STYLE=[hreftarget='_blank' > URL='http://www.sas.com']"); > > endcomp; > >run; > >ODS html close; > >HTH > >Qin >-----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 ><file:///O:\aidsdata\SASDATA\SASWORK\YZG9\DHAP%20Complete%20Data%20Dictionary\formats\HARS_LIB.FORMATS.SURSTA.htm>$SURST. > >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; > > >

*------------------------------------------------* | Ray Pass, Ph.D. voice: (914) 693-5553 | | Ray Pass Consulting eFax: (914) 206-3780 | | 5 Sinclair Place cell: (914) 450-0555 | | Hartsdale, NY 10530 e-mail: raypass@att.net | *------------------------------------------------*


[text/html]


Back to: Top of message | Previous page | Main SAS-L page