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:         Wed, 21 Aug 2002 11:41:08 -0500
Reply-To:     Bob Hutchins <bhutchins@GTRESOURCES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Bob Hutchins <bhutchins@GTRESOURCES.COM>
Subject:      unsubscribe
Content-type: text/plain; charset=iso-8859-1

----- Original Message ----- From: "Automatic digest processor" <LISTSERV@LISTSERV.UGA.EDU> To: "Recipients of SAS-L digests" <SAS-L@LISTSERV.UGA.EDU> Sent: Wednesday, August 21, 2002 10:52 AM Subject: SAS-L Digest - 21 Aug 2002 - Special issue (#2002-1190)

> There are 13 messages totalling 1022 lines in this issue. > > Topics in this special issue: > > 1. suggest: list config file name > 2. nice-looking code vs. quick execution - quite confused > 3. Counting to 100 (code) > 4. Importing .csv files containing missing values > 5. proc report ID option and ODS PDF causing column overlay - v8.2 o n HP UX. > 6. enhancements in viewTable > 7. Clear the results-window > 8. 3sls with ar(1) > 9. Reading a HTML Page thru SAS (2) > 10. SQL ORDER BY and SORT > 11. Tip: HotFixes > 12. Proc Report, ODS HTML, and Call Define, Repeated > > ---------------------------------------------------------------------- > > Date: Wed, 21 Aug 2002 10:16:18 -0400 > From: "Fehd, Ronald J. (PHPPO)" <rjf2@CDC.GOV> > Subject: Re: suggest: list config file name > > > From: Peter Crawford [mailto:peter.crawford@db.com] > > ah, so, > adding the command line option > -verbose > gets me this: > > ==== Processed Configuration File(s) ==== > u:\dls\SAS\SASv8SITE.cfg > > I'd prefer it in the regular start-up message tho, > please and thank you. > > Peter notes that there is an: > option config=<filename(s)>; > which value can be fetched with his macro: > > > And it shows both with getoption(). > > 1 %macro sy(o) ; > > 2 %sysfunc(getoption(&o,keyword)) > > 3 %mend sy; > > 4 > > 5 %put %sy(config); > > that doesn't solve my problem, > because that is a hard-coded reference in an option statement, > that can occur, at the earliest, in an autoexec, > which is executed -after- the configuration file. > > Ron Fehd the macro maven CDC Atlanta GA USA RJF2@cdc.gov > > ------------------------------ > > Date: Wed, 21 Aug 2002 08:58:05 -0500 > From: Walter Scott <Walter.Scott@STATE.TN.US> > Subject: Re: nice-looking code vs. quick execution - quite confused > > This is a MIME message. If you are reading this text, you may want to > consider changing to a mail reader or gateway that understands how to > properly handle MIME multipart messages. > > --=_306C639A.E989F2BE > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: quoted-printable > > Dave, > I could suggest using a proc format like this: > > proc format; > value choose > (list of codes I want)=3D1 > (List of codes you don't want)=3D0 > other=3D.; > run; > > Then, in the data step: > . > . > . > GoodCode=3Dinput(put(CODE,Choose.)); > if GoodCode; > . > . > . > > I have used this type of logic before with fairly large "code tables" = > and have not noticed any significant performance penalty however, I have = > made any direct comparisons either. > Diadvantage: Perhaps not as reader friendly as "IF CODE IN (...);" > Advantage: All the codes and their translations are in one location, = > a little easier to modify if you want a different set of codes next time. > = > Walter > > > >>> Dave Pettit <davepettit338@YAHOO.COM> 12:38:35 20-Aug-02 >>> > Hi, > > I am having a bit of a dilemma here, having to choose between > prettying up my code so others will be better able to deal with it, > and getting the job to run faster. I am reading from a flat-file and > inputting several fields. I then check one of the fields to see > whether I want to bring the record in or not. The code currently > looks like this: > > IF CODE=3D'1' or CODE=3D'2' or CODE=3D'3' or CODE=3D'4' or CODE=3D'5' or = > ...; > > There are about 50 codes I'm looking for. Now, what I would like to > do is use a statement like > > IF CODE IN ('1','2','3','4','5',...), which as far as logic goes is an > equivalent statement, but is easier to look at and see what the values > are a little more quickly. > > The problem is that changing to the second line of code nearly doubles > the execution time of the program, which is not what I would like to > happen at all... I am assuming it has something to do with how many > comparisons each code would do--- e.g. if CODE=3D'2', then the first > statement breaks and returns TRUE after the second comparison, whereas > the second one would compare '2' to all of the values in the list > ('1','2','3','4',...) before breaking. Is this right? > > Also, is there a way to combine nice code and quick execution in this > case? > > Thanks, > Dave Pettit > > --=_306C639A.E989F2BE > Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable > Content-Description: HTML > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <HTML><HEAD> > <META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"= > > > <META content=3D"MSHTML 6.00.2716.2200" name=3DGENERATOR></HEAD> > <BODY style=3D"MARGIN-TOP: 2px; FONT: 8pt Tahoma; MARGIN-LEFT: 2px"> > <DIV><FONT size=3D1>&nbsp; Dave,</FONT></DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp;&nbsp; I could suggest using a proc = > format=20 > like this:</FONT></DIV> > <DIV><FONT size=3D1></FONT>&nbsp;</DIV> > <DIV><FONT size=3D1>proc format;</FONT></DIV> > <DIV><FONT size=3D1>&nbsp; value choose</FONT></DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp; (list of codes I want)=3D1</FONT></D= > IV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp; (List of codes you don't=20 > want)=3D0</FONT></DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp; other=3D.;</FONT></DIV> > <DIV><FONT size=3D1>run;</FONT></DIV> > <DIV><FONT size=3D1></FONT>&nbsp;</DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp;&nbsp; Then, in the data step:</FONT>= > </DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1>GoodCode=3Dinput(put(CODE,Choose.));</FONT></DIV> > <DIV><FONT size=3D1>if GoodCode;</FONT></DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1>.</FONT></DIV> > <DIV><FONT size=3D1></FONT>&nbsp;</DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp;&nbsp; I have used this type of = > logic before=20 > with fairly large "code tables" and have not noticed any significant = > performance=20 > penalty however, I have made any direct comparisons either.</FONT></DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp;&nbsp; Diadvantage:&nbsp; Perhaps = > not as=20 > reader friendly as "IF CODE IN (...);"</FONT></DIV> > <DIV><FONT size=3D1>&nbsp;&nbsp;&nbsp;&nbsp; Advantage:&nbsp; All the = > codes and=20 > their translations are in one location, a little </FONT><FONT size=3D1>easi= > er to=20 > modify if you want a different set of codes next time.</FONT></DIV> > <DIV><FONT=20 > size=3D1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb= > sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb= > sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 > Walter</FONT></DIV> > <DIV><BR><BR>&gt;&gt;&gt; Dave Pettit &lt;davepettit338@YAHOO.COM&gt; = > 12:38:35=20 > 20-Aug-02 &gt;&gt;&gt;<BR>Hi,<BR><BR>I am having a bit of a dilemma here, = > having=20 > to choose between<BR>prettying up my code so others will be better able to = > deal=20 > with it,<BR>and getting the job to run faster.&nbsp; I am reading from = > a=20 > flat-file and<BR>inputting several fields.&nbsp; I then check one of the = > fields=20 > to see<BR>whether I want to bring the record in or not.&nbsp; The code=20 > currently<BR>looks like this:<BR><BR>IF CODE=3D'1' or CODE=3D'2' or = > CODE=3D'3' or=20 > CODE=3D'4' or CODE=3D'5' or ...;<BR><BR>There are about 50 codes I'm = > looking=20 > for.&nbsp; Now, what I would like to<BR>do is use a statement like<BR><BR>I= > F=20 > CODE IN ('1','2','3','4','5',...), which as far as logic goes is=20 > an<BR>equivalent statement, but is easier to look at and see what the=20 > values<BR>are a little more quickly.<BR><BR>The problem is that changing = > to the=20 > second line of code nearly doubles<BR>the execution time of the program, = > which=20 > is not what I would like to<BR>happen at all... I am assuming it has = > something=20 > to do with how many<BR>comparisons each code would do--- e.g. if CODE=3D'2'= > , then=20 > the first<BR>statement breaks and returns TRUE after the second comparison,= > =20 > whereas<BR>the second one would compare '2' to all of the values in the=20 > list<BR>('1','2','3','4',...) before breaking.&nbsp; Is this right?<BR><BR>= > Also,=20 > is there a way to combine nice code and quick execution in=20 > this<BR>case?<BR><BR>Thanks,<BR>Dave Pettit<BR></DIV></BODY></HTML> > > --=_306C639A.E989F2BE-- > > ------------------------------ > > Date: Wed, 21 Aug 2002 10:35:16 -0400 > From: "David L. Ward" <dward@SASHELP.COM> > Subject: Re: Counting to 100 (code) > > Franz, > > There are MANY ways to accomplish the summary that you want, including using > data steps, proc freq, and proc means. Here's a proc means solution. Means > will add the total row and can't (to my knowledge) add the percentages of > the total, while freq can add the percentages but not the total row. > > DATA test; > INPUT center; > CARDS; > 001 > 001 > 001 > 002 > ; > RUN; > proc means data=test noprint; > class center; > var center; > output out=test2 (drop=_type_ _freq_) n=freq p1=pct; > run; > data result; > retain tot; > set test2; > if _n_=1 then tot=freq; > pct=100*freq/tot; > drop tot; > run; > > Hope this helps > David W > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Franz > Sent: Wednesday, August 21, 2002 9:07 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Counting to 100 (code) > > DATA test; > INPUT center; > CARDS; > 001 > 001 > 001 > 002 > ; > RUN; > > DATA test; > SET test; > all = 1; /*All patients*/ > RUN; > > PROC FREQ DATA = test NOPRINT; > TABLES center * all / OUT = result1; > RUN; > > PROC FREQ DATA = test NOPRINT; > TABLES all / OUT = result2; > RUN; > > DATA RESULT; > SET result1 result2; > IF center = . THEN center = 100; /*All patients*/ > RUN; > > > Any better solution? > Many thanks, > Franz. > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com > > ------------------------------ > > Date: Wed, 21 Aug 2002 14:57:44 GMT > From: "Michael G. Sadof" <mgs@MGSNET.NET> > Subject: Re: Importing .csv files containing missing values > > I have noticed that if the input file contains the missing value indicator > (.) in a field then it sets all the records to missing. Try removing the > dot (.) and replacing with blank. It might help. > > "Mike Fetchel" <mike.fetchel@SNET.NET> wrote in message > news:200208210242.g7L2ggW20190@listserv.cc.uga.edu... > > I'm importing a .csv (comma separated values) file using Proc Import in > the > > Unix environment using SAS Ver. 8.2. One of the columns (containing > > numeric data) in the .csv file has missing values in some of the records > > (but not all). When I submit my Proc Import program, the variable > > representing this column has all missing values in, including the records > > that had values in the .csv file. When I stripped out the records that > had > > missing values for that numeric column from the .csv file and then re-ran > > the import program, it worked fine. Does any one know why this is > happening > > and how to fix this properly? > > > > Thanks in advance for any help. > > ------------------------------ > > Date: Wed, 21 Aug 2002 10:51:37 -0400 > From: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM> > Subject: proc report ID option and ODS PDF causing column overlay - v8.2 o n HP > UX. > > Listers: > > I'm subscribed to the list, but not through this email address. Please > respond to the list AND this email address so I'll be able to benefit from > your wisdom. TIA > > We're creating PDF reports from a dataset with roughly 35 columns of data. > In order to provide context for the columns that spill onto subsequent > pages, the first two columns are to be repeated on each page, perfect > application for the ID option in proc report. > > Unfortunately, there's an acknowledged problem with combining ID and ODS > PDF. Here's what I received from SAS support: > > The behavior you are seeing is caused by the use of the ID > option. The following SAS note contains detailed information: > http://www.sas.com/service/techsup/unotes/SN/007/007704.html > <http://www.sas.com/service/techsup/unotes/SN/007/007704.html> > The only circumvention at this point is to remove the ID > option. > > Have any of the report / ODS gurus found a workaround for this? > > Yes, I could split my output into X columns / page, generating multiple proc > report steps, each specifying only X columns, but that provides > unsatisfactory results. Similarly I could create alias columns for the two > ID columns, inserting the alias columns where appropriate and specifying the > page option. Those solutions don't work nicely because some columns are > much wider than others - both workarounds result in pages with skinny > columns having wide margins and creates a very lengthy report. > > Note that the programs are run in batch mode, I don't have the option of > examining the data and tweaking the program before each run. > > My code follows ( the %else the X columns / page solution that I use for > HTML to prevent horizontal scrolling ). Note that the cellwidth style > option does not fix the problem, it results in white space between the > columns and still overlays. > > /************************************************************************ > Let the ID option on the define statement take care of the > repeating > of the first two columns. We don't have that luxury in HTML > because > the concept of page width is kinda lost in a browser > unfortunately. > ID option repeats that column and all columns to the left in > the event > of horizontal page overflow. > > *************************************************************************/ > > %if &dest = pdf %then %do; > > proc report data=rpt_&print_ds > split="^" style(header)=[just=c] > style(column)=[just=c]; > column desc_col date&lang var&min_var -- var&max_var; > define desc_col / display style=[just=l > cellwidth=2in] ; > define date&lang / display style=[just=l > cellwidth=1in] id ; > run; > %end; %else %do; > > %do p = 1 %to &&&dest&l._no_prints; > proc report data=rpt_&print_ds ( keep = desc_col > date&lang &&&dest&l._print_vars&p ) > split="^" style(header)=[just=c] > style(column)=[just=c]; > column desc_col date&lang > &&&dest&l._print_vars&p ; > define desc_col / display style=[just=l]; > define date&lang / display style=[just=l]; > %if &dest = html and &p = &&&dest&l._no_prints > %then %do; > footnote1 "&f1"; > footnote2 "&f2"; > footnote3 "&f3"; > %end; > run; > %end; > %end; > > ------------------------------ > > Date: Wed, 21 Aug 2002 11:05:16 -0400 > From: Randy Herbison <RandyHerbison@WESTAT.COM> > Subject: Re: enhancements in viewTable > > Peter, > > The reserved numbers seem to work as documented, but the functionality has > been available by using the formViewer's default popup menu or the navigator > buttons. > > The documentation for the tableViewer's _gotoRow method, doesn't specify if > the row parameter is relative or absolute. I tried a quick test which seems > to indicate that it is relative, but the reserved numbers available for the > formViewer's _goToRowNumber method do not work for the tableViewer's > _goToRow method. The tableViewer, as implemented in Viewtable, does provide > the TOP and BOTTOM commands as well as the First Row and Last Row popup menu > items. > > RandyHerbison@westat.com > > -----Original Message----- > From: Peter Crawford [mailto:peter.crawford@DB.COM] > Sent: Tuesday, August 20, 2002 6:58 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: enhancements in viewTable > > > I see a new/updated usage note that may contribute to > at least one wish-list item for ViewTable > product = AF > 008095 Reserved numbers that perform routine actions for the > _gotoRowNumber > method > SN http://www.sas.com/service/techsup/unotes/SN/008/008095.html > > This contains some "magic row numbers" > > Information on the reserved numbers that perform routine actions for the > _gotoRowNumber method of the Form Viewer Control were left out of the > documentation. Details on these reserved numbers for the row-num > argument are provided below. > > row-num N specifies the row to display. Row-num is a relative row > number. Reserved numbers that perform routine actions are > > -1 go to the first row > -2 go to the previous row > -3 go to the next row > -4 go to the last row. > With row-num -4 > we might get a fast route to the last row=end of table. > > Can anyone confirm this ? > > Regards > Peter Crawford > > > > -- > > Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte > Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail > irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte > Weitergabe dieser Mail ist nicht gestattet. > > This e-mail may contain confidential and/or privileged information. If you > are not the intended recipient (or have received this e-mail in error) > please notify the sender immediately and destroy this e-mail. Any > unauthorized copying, disclosure or distribution of the material in this > e-mail is strictly forbidden. > > ------------------------------ > > Date: Wed, 21 Aug 2002 08:37:12 -0700 > From: Wei Cheng <WCheng@ISISPH.COM> > Subject: Re: Clear the results-window > > This is a multipart message in MIME format. > --=_alternative 0055BB0B88256C1C_= > Content-Type: text/plain; charset="us-ascii" > > dm odsresults 'clear' wpgm; > > > > > > "Albrecht O. Schweikert" <schweikert@AOS-CONSULT.DE> > Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> > 08/21/02 03:22 AM > Please respond to "Albrecht O. Schweikert" > > > To: SAS-L@LISTSERV.UGA.EDU > cc: > Subject: Clear the results-window > > > Hi all, > > Usually I clear the windows within SAS-statements e.g. with DM 'CLEAR LOG; > This works fine for LOG and OUT but I could not find the corresponding > command for the resutls window. > > How can I clear the results-window with a SAS-statement? > > TIA Albrecht > > > > > --=_alternative 0055BB0B88256C1C_= > Content-Type: text/html; charset="us-ascii" > > > <br><font size=1 face="Sasfont">dm odsresults 'clear' wpgm;</font> > <br> > <br> > <br> > <br> > <table width=100%> > <tr valign=top> > <td> > <td><font size=1 face="sans-serif"><b>&quot;Albrecht O. Schweikert&quot; &lt;schweikert@AOS-CONSULT.DE&gt;</b></font> > <br><font size=1 face="sans-serif">Sent by: &quot;SAS(r) Discussion&quot; &lt;SAS-L@LISTSERV.UGA.EDU&gt;</font> > <p><font size=1 face="sans-serif">08/21/02 03:22 AM</font> > <br><font size=1 face="sans-serif">Please respond to &quot;Albrecht O. Schweikert&quot;</font> > <br> > <td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;SAS-L@LISTSERV.UGA.EDU</font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Clear the results-window</font></table> > <br> > <br> > <br><font size=2 face="Courier New">Hi all,<br> > <br> > Usually I clear the windows within SAS-statements e.g. with DM 'CLEAR LOG;<br> > This works fine for LOG and OUT but I could not find the corresponding<br> > command for the resutls window.<br> > <br> > How can I clear the results-window with a SAS-statement?<br> > <br> > TIA &nbsp; &nbsp;Albrecht<br> > <br> > </font> > <br> > <br> > --=_alternative 0055BB0B88256C1C_=-- > > ------------------------------ > > Date: Wed, 21 Aug 2002 11:42:45 -0400 > From: Steve Albert <SAlbert@AOL.COM> > Subject: Re: 3sls with ar(1) > > Actually, you might be better off going over to the Economics department and talking to one of the econometricians; they're much more likely to be familiar with this than are the stats faculty, let alone the stats grad students. (Even the nine volume Encyclopedia of Statistical Sciences has only two passing references to 3sls; it's really an econometric technique, and covered in the econometrics literature.) > > It's also possible (warning: heresy!) that you might be better off doing this in a different package -- STATA or one of the specialized econometrics packages. If you're at a university, you may be able to get access to those in one of the computer labs, or buy them at very favorable students prices. From the traffic I've seen on the STATA discussion list, it appears to be very popular these days among folks doing econometrics. > > Steve Albert > Director of Biostatistics > Spectrum Pharmaceutical Research Corp. > San Antonio, TX > SAlbert at SpectrumCRO dot com > > > > Date: Wed, 21 Aug 2002 14:35:21 +0200 > > From: Jones John <John.Jones@UCB-GROUP.COM> > > Subject: Re: 3sls with ar(1) > > > > For your thesis? > > > > Your universities stat department should have gradute students who work as > > consultants. Your very best bet is to go there and find out. > > > > John > > > > -----Original Message----- > > From: jason [mailto:jshy_us@YAHOO.COM] > > Sent: Tuesday, August 20, 2002 10:17 PM > > To: SAS-L@LISTSERV.UGA.EDU > > Subject: 3sls with ar(1) > > > > > > Does anyone know how to estimate a 3sls model with correction for AR(1) > > under SAS? It has taken me a long time and I still could > > not figure out > > how. I need it urgently for the purpose of my thesis. > > Thanks a lot for any help! > > ------------------------------ > > Date: Wed, 21 Aug 2002 15:45:35 +0000 > From: Prasad Prabhudesai <prasad_prabhud@HOTMAIL.COM> > Subject: Reading a HTML Page thru SAS > > I would like to know if it is possible to read a HTML page and write to > a EXCEL File. I have some search results around 150 on the HTML page. > But only thing is that on the HTML page I have to click on next after > every 10 results. Is it possible to dump all the 150 results into one > EXCEL file? > > > -- > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG > > ------------------------------ > > Date: Wed, 21 Aug 2002 08:41:53 -0700 > From: Xavier Autret <xav_x@NOOS.FR> > Subject: Re: SQL ORDER BY and SORT > > Hello Chris, > > Good question, > > Well I ve done that code but pearhaps there s an options > that I don t know... > > Xavier > > Code==> > data TOTO; > length x $8 y aa 8; > x='1'; y=1; aa=0; > output; > x='A'; y=0; aa=.; > output; > run; > > proc sort data=TOTO out=SORT; > by _ALL_; > run; > > data _NULL_; > dsid=open('SORT'); > sort=attrc(dsid, 'SORTEDBY'); > put sort=; > rc=close(dsid); > run; > > %macro allVARS(data=); > %let dsid=%sysfunc(open(&data)); > %if &dsid ^= 0 %then %do; > %do i=1 %to %sysfunc(attrn(&dsid, NVARS)); > %if &i>1 %then ,&i; > %else &i; > %end; > %let rc=%sysfunc(close(&dsid)); > %end; > %mend allVARS; > > proc sql; > create table SQL as > select * > from TOTO > order by %allVARS(data=TOTO); > quit; > > data _NULL_; > dsid=open('SQL'); > sort=attrc(dsid, 'SORTEDBY'); > put sort=; > rc=close(dsid); > run; > > vercellc@eng.it (christian) wrote in message news:<29feb93d.0208210029.761ba61b@posting.google.com>... > > Hallo! > > I want to use PROC SQL instead PROC SORT to sort a dataset. > > I want to sort it using all variables.Using PROC SORT I can use the > > keyword _ALL_, what do i have to use in PROC SQL? > > Thanks,Chris > > ------------------------------ > > Date: Wed, 21 Aug 2002 08:46:59 -0700 > From: Wei Cheng <WCheng@ISISPH.COM> > Subject: Re: Tip: HotFixes > > This is a multipart message in MIME format. > --=_alternative 0056A08688256C1C_= > Content-Type: text/plain; charset="us-ascii" > > Thanks Lex, > > I tested on my WinNT, it works like a charm. > > Thank you for the tip, I think it's handy and useful. > > Wei > > > > > > Lex Jansen <news@UNSPAMLEX-JANSEN.DEMON.NL> > Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> > 08/21/02 07:24 AM > Please respond to Lex Jansen > > > To: SAS-L@LISTSERV.UGA.EDU > cc: > Subject: Tip: HotFixes > > > In an environment where validation and change control are important I > create > a macro, %_HotFix, and put the following statements in my AUTOEXEC.SAS to > keep track of installed Hotfixes: > > %PUT NOTE: HotFixes installed:; > %PUT %_HotFix; > %PUT; > > Which would give in the SAS LOG, for example: > > NOTE: HotFixes installed: > 82BA36WN 82BA47WN 82BA53WN 82BA59WN 82BA62WN 82BA63WN 82BA73WN 82BA74WN > 82BA78WN 82BX01WN 82OC01WN 82OC02WN 82PF01WN 82ST08WN 82ST09WN > > Any suggestions or comments are very welcome. > > Lex Jansen > > > ======== MACRO _HotFix ==================== > > %macro _HotFix / des='List installed Hotfixes'; > > %local _HotFix filrf rc did memcount member i; > > %* This macro only works on Windows and SAS version at least 8; > %if (&sysscp NE WIN) or (%scan(&sysver,1,.) LT 8) %then %goto endmac; > > %let _HotFix=; > %let filrf=MYDIR; > %let > rc=%sysfunc(filename(filrf,%sysfunc(sysget(sasroot))\core\sasinst\hotfix)); > %let did=%sysfunc(dopen(&filrf)); > %if &did %then %do; > %let memcount=%sysfunc(dnum(&did)); > %do i=1 %to &memcount; > %let member=%sysfunc(dread(&did, &i)); > %if %index(%upcase(&member), .AUD) > 0 and > %index(%upcase(&member), AUD.00) = 0 /* Double installed HotFix > */ > %then %let _HotFix=&_HotFix %upcase(%scan(&member,1,.)); > %end; > %let rc=%sysfunc(dclose(&did)); > %end; > &_HotFix > > %endmac: > > %mend _HotFix; > > ======== MACRO _HotFix ==================== > > > > > --=_alternative 0056A08688256C1C_= > Content-Type: text/html; charset="us-ascii" > > > <br><font size=2 face="sans-serif">Thanks Lex,</font> > <br> > <br><font size=2 face="sans-serif">I tested on my WinNT, it works like a charm.</font> > <br> > <br><font size=2 face="sans-serif">Thank you for the tip, I think it's handy and useful.</font> > <br> > <br><font size=2 face="sans-serif">Wei</font> > <br> > <br> > <br> > <br> > <table width=100%> > <tr valign=top> > <td> > <td><font size=1 face="sans-serif"><b>Lex Jansen &lt;news@UNSPAMLEX-JANSEN.DEMON.NL&gt;</b></font> > <br><font size=1 face="sans-serif">Sent by: &quot;SAS(r) Discussion&quot; &lt;SAS-L@LISTSERV.UGA.EDU&gt;</font> > <p><font size=1 face="sans-serif">08/21/02 07:24 AM</font> > <br><font size=1 face="sans-serif">Please respond to Lex Jansen</font> > <br> > <td><font size=1 face="Arial">&nbsp; &nbsp; &nbsp; &nbsp; </font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; To: &nbsp; &nbsp; &nbsp; &nbsp;SAS-L@LISTSERV.UGA.EDU</font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; cc: &nbsp; &nbsp; &nbsp; &nbsp;</font> > <br><font size=1 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Subject: &nbsp; &nbsp; &nbsp; &nbsp;Tip: HotFixes</font></table> > <br> > <br> > <br><font size=2 face="Courier New">In an environment where validation and change control are important I create<br> > a macro, %_HotFix, and put the following statements in my AUTOEXEC.SAS to<br> > keep track of installed Hotfixes:<br> > <br> > %PUT NOTE: HotFixes installed:;<br> > %PUT %_HotFix;<br> > %PUT;<br> > <br> > Which would give in the SAS LOG, for example:<br> > <br> > NOTE: HotFixes installed:<br> > 82BA36WN 82BA47WN 82BA53WN 82BA59WN 82BA62WN 82BA63WN 82BA73WN 82BA74WN<br> > 82BA78WN 82BX01WN 82OC01WN 82OC02WN 82PF01WN 82ST08WN 82ST09WN<br> > <br> > Any suggestions or comments are very welcome.<br> > <br> > Lex Jansen<br> > <br> > <br> > ======== &nbsp;MACRO _HotFix ====================<br> > <br> > %macro _HotFix / des='List installed Hotfixes';<br> > <br> > %local _HotFix filrf rc did memcount member i;<br> > <br> > %* This macro only works on Windows and SAS version at least 8;<br> > %if (&amp;sysscp NE WIN) or (%scan(&amp;sysver,1,.) LT 8) %then %goto endmac;<br> > <br> > %let _HotFix=;<br> > %let filrf=MYDIR;<br> > %let<br> > rc=%sysfunc(filename(filrf,%sysfunc(sysget(sasroot))\core\sasinst\hotfix));< br> > %let did=%sysfunc(dopen(&amp;filrf));<br> > %if &amp;did %then %do;<br> > &nbsp; &nbsp;%let memcount=%sysfunc(dnum(&amp;did));<br> > &nbsp; &nbsp;%do i=1 %to &amp;memcount;<br> > &nbsp; &nbsp; &nbsp; %let member=%sysfunc(dread(&amp;did, &amp;i));<br> > &nbsp; &nbsp; &nbsp; %if %index(%upcase(&amp;member), .AUD) &gt; 0 and<br> > &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %index(%upcase(&amp;member), AUD.00) = 0 /* Double installed HotFix<br> > */<br> > &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; %then %let _HotFix=&amp;_HotFix %upcase(%scan(&amp;member,1,.));<br> > &nbsp; &nbsp;%end;<br> > &nbsp; &nbsp;%let rc=%sysfunc(dclose(&amp;did));<br> > %end;<br> > &amp;_HotFix<br> > <br> > %endmac:<br> > <br> > %mend _HotFix;<br> > <br> > ======== &nbsp;MACRO _HotFix ====================<br> > <br> > </font> > <br> > <br> > --=_alternative 0056A08688256C1C_=-- > > ------------------------------ > > Date: Wed, 21 Aug 2002 11:02:06 -0400 > From: "Gerstle, John" <yzg9@CDC.GOV> > Subject: Re: Proc Report, ODS HTML, and Call Define, Repeated > > Steve, > Ran your program here. Did you notice that your URL's for each cell has a > large space in them? Ie.. 'x034y 3.html' ?? > > But what are you trying to do? I guess I don't understand your problem where > PROC FORMAT does not solve it. Are you trying to add the format name to the > URL? Why not, if you know the values of your new format, just assign them > in the PROC FORMAT? > > Ie.. > PROC FORMAT; VALUES colfmt 1 = 'n01' 2 = 'n02' ...etc....; > Run; > > Then when the PROC REPORT runs, SAS will have the new format in the work > library, and it should show up in the URL. > > John Gerstle > Biostatistician > CDC Information Systems Support Services (CISSS) > Contractor Support to NCHSTP > / Division of HIV/AIDS Prevention - Surveillance Branch > Phone: 404-639-3980 Fax: 404-639-2980 > Cell: 770-639-5060 Email: jgerstle@cdc.gov > > -----Original Message----- > From: Steve Bloom [mailto:scbloom@MINDSPRING.COM] > Sent: Wednesday, August 21, 2002 10:18 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Proc Report, ODS HTML, and Call Define, Repeated > > I've been trying to get PROC REPORT to have a unique hyperlink for each cell > within a table. The URL is dependent on the ROW and COLUMN, not the value of > the cell. I was needing this for a "drill-down" SAS/INTRNET application. I > could not figure out a solution not using PROC FORMAT. Any improvements > would be appreciated. > > Steve Bloom > > > data html; > do x=1 to 100 by 3; > do y=1 to 10 by 2; xy=x*y; > output; > end; > end; > run; > > PROC SORT; BY Y; > > data cntlin; set html; > by y; > if first.y; > start + 1; > retain fmtname 'colfmt' type 'n'; > label = put(y,z2.); > keep start fmtname type label; > run; > > proc format library=library cntlin=cntlin; > run; > > ods listing close; > ods html style=sasweb file='c:\temp\sas.html'; > proc report data=html nowd; > column x y, xy; > define x/ group ''; > define y/ across ''; > define xy/ ANALYSIS sum ''; > compute xy; > href = 'x' || put(_c1_,z3.) || 'y' || put(_col_-1,colfmt.) || '.html'; > call define(_col_,"URL",href); > endcomp; > run; > ods html close; > ods listing; > > > ____________________________________________________________________ > eMail Privacy Protected by QuarantineMail (http://www.quarantinemail.com) > Licensed to: scbloom@mindspring.com > > ------------------------------ > > Date: Wed, 21 Aug 2002 10:52:51 -0500 > From: Michael S Hines <mshines@PURDUE.EDU> > Subject: Re: Reading a HTML Page thru SAS > > Two steps. > 1. HTML is an acceptable input format to SAS... create SAS dataset > 2. EXCEL can be written from SAS... use SAS dataset to create Excel > spreadsheet... > > You SAS help can show you how to do each of these steps. Search HTML, > and/or EXCEL as keywords. > > Speaking of v8.0+ - probabily not doable in older versions. > > msh > --------------------------------------------------------- > Michael S Hines | Phone 765-494-5875 > Purdue University | FAX 765-496-1380 > Information Technology@Purdue | Email mshines@purdue.edu > OS/390 Systems Programmer | Certifications: > 1059 Freehafer Hall | CIA, CISA, CFE, CDP > West Lafayette, IN 47907-1061 | > > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of > Prasad Prabhudesai > Sent: Wednesday, August 21, 2002 10:46 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Reading a HTML Page thru SAS > > > I would like to know if it is possible to read a HTML page and write to > a EXCEL File. I have some search results around 150 on the HTML page. > But only thing is that on the HTML page I have to click on next after > every 10 results. Is it possible to dump all the 150 results into one > EXCEL file? > > > -- > Posted via Mailgate.ORG Server - http://www.Mailgate.ORG > > ------------------------------ > > End of SAS-L Digest - 21 Aug 2002 - Special issue (#2002-1190) > ************************************************************** >


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