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 (October 1997, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 30 Oct 1997 07:24:17 +0000
Reply-To:     "M. Esther Colwell" <mec7@ITSA.UCSF.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         "M. Esther Colwell" <mec7@ITSA.UCSF.EDU>
Subject:      Re: How to JOIN without SQL
In-Reply-To:  <01BCE4BA.E9091DB0.kmself@ix.netcom.com>
Content-Type: text/plain; charset="us-ascii"

Another alternative is to access the SASHELP.VTABLE and put the number of obs. in a macro variable, e.g.

Data _null_; set sashelp.vtable; where libname = 'Yourlibrary' and memname = 'Yourdata'; call symput('numobs', put(nobs,8.)); run;

At 10:30 PM 10/29/97 -0800, you wrote: >To join the fray, I suspect that Tim's suggestion could be simplified by >eliminating the first SET statement on ZIPFILE and moving the NOBS= option >to the second set statement. NOBS= is calculated at compile time, not >execute time (I thin, very much, without actually being able to test it). > >To prove or refute, try the following, which never _executes_ the set >statement. I believe it should work as intended: > > /* With apologies to the current thread on style */ > data in; do i= 1 to 100; output; end; run; > > data _null_; > put nobs=; > stop; > set in nobs= nobs; > run; > >I believe you will have > nobs= 100 > >...output to your log. > >See below for appropriate modifications. > > >On Wednesday, October 29, 1997 10:46 AM, Tim Berryhill 3rd time >[SMTP:TWB2%Rates%FAR@bangate.pge.com] wrote: >> Esther, I think your friend is concerned about a problem which does not >> apply. >> She would not actually need a STOP statement. SAS does not stop a data >> step for >> reading the last obs using random access, so the reads to ZIPFILE would >> not stop >> the step. Just to be cute I might avoid coding the number of obs in >> ZIPFILE: >> >> DATA DISTFILE; >> /* if 0 then set zipfile nobs=maxobs; /* commented */ >> SET HOSPFILE; >> DO OBSNUM=1 TO maxobs; >> SET ZIPFILE POINT=OBSNUM nobs= maxobs; /* nobs added */ >> DISTANCE = ....................... >> output; >> end; >> run; >> >> Tim Berryhill - Contract Programmer and General Wizard >> TWB2@PGE.COM or http://www.aartwolf.com/twb.html >> Frequently at Pacific Gas & Electric Co., San Francisco >> The correlation coefficient between their views and >> my postings is slightly less than 0 > >Karsten M. Self (kmself@ix.netcom.com) > > What part of "gestalt" don't you understand? > (Welchen Teil von <<Gestalt>> verstehn Sie nicht?) > >


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