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 (February 1998, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 23 Feb 1998 11:33:04 PST
Reply-To:   TWB2%Rates%FAR@bangate.pge.com
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Tim Berryhill 3rd time <TWB2%Rates%FAR@BANGATE.PGE.COM>
Subject:   Re: SAS data views
Comments:   To: Grace La Torra <grace@NMSU.EDU>
Content-Type:   text/plain; charset=us-ascii

Grace, I think Allan was correct that the view will contain the value of &perssem, rather than the macro reference. As he pointed out, you could apply the WHERE in subsequent processing instead of in the view. I can imagine performance reasons why you might want to do it the way you proposed.

I can think of at least one work-around: Store the value of &perssem in a datastep variable and merge it in the view:

DATA WORK.TEMP;PERSSEM="&perssem";OUTPUT;STOP;RUN;

data stuall.persv / view = stuall.persv; IF _N_ EQ 1 THEN SET TEMP; set stuall.personal; by ssn semnum; IF semnum <= PERSSEM; if last.ssn then output; run;

This is ugly. It replaces the WHERE with IF, which costs I/O. It requires the dataset TEMP both when the view is defined and when it is accessed.

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

----------------------[Reply - Original Message]----------------------

Sent by:"Grace La Torra" <grace@NMSU.EDU> I am creating a view of a data set using the following code:

data stuall.persv / view = stuall.persv; set stuall.personal; by ssn semnum; where semnum <= &perssem; if last.ssn then output; run;

I am trying to build a view that will change depending on the macro variable &perssem. In other words, when perssem is set to 60 the view will be different from when perssem is set to 64. The kicker here is that I don't want the macro variable to be resolved when the view is created, but when the view is accessed.

Does anybody have any words of wisdom?

Thanks, Grace La Torra Research Analyst Institutional Research and Planning New Mexico State University

=====================================================================


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