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 (November 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 20 Nov 2003 10:10:38 -0500
Reply-To:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject:   Re: Setting Dataset Multiple Times
Comments:   To: Jeff Cohen <jcohen@AESSUCCESS.ORG>
Content-Type:   text/plain

Jeff: This solution has a crippling limitation, but it has other virtues of interest. The maximum number of table references in a SAS V8.2 SQL query is 32. If that number increases in future versions, a view of the unions of a dataset to itself would produce the data you require:

data test; tag='XXXXXXXX'; value='YYYYYYYY'; run; %let __n=31; filename tmp 'c:\Windows\temp\tmp.sas'; data _null_; file tmp; put ' proc sql; create view tempvw as select * from ' / ' (select * from work.test) ' ; do i=1 to &__n; put ' union all ' / ' (select * from work.test) ' ; end; put '; quit;'; run; %inc tmp; proc freq data=tempvw; table tag value/list; run;

A view gives you a virtual dataset, but occupies only the space required to store a program. This program also illustrates a method for using a SAS datastep to write a SAS program. Sig -----Original Message----- From: Jeff Cohen [mailto:jcohen@AESSUCCESS.ORG] Sent: Wednesday, November 19, 2003 9:10 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Setting Dataset Multiple Times

Is there a way to create dataset A by setting dataset B multiple times, with the number of times dynamically determined? On the first run the dataset will be set 37 times, based on a number in the first observation. That number can and will change on subsequent runs, sometimes up and sometimes down.


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