Date: Thu, 31 Jan 2002 16:43:02 -0500
Reply-To: Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject: Re: Is set with point option the answer?
Content-Type: text/plain; charset="iso-8859-1"
Without knowing more about the problem it is impossible to say whether it is
better to use the POINT= option, store the needed data in arrays for an ID
and then loop through the arrays, or find some completely different
solution; since your statement of the problem is mostly your idea of a
solution rather than the problem that needs solving.
POINT= will be slower than sequential reads, but as long as all the records
for an ID usually fit in the buffers at one time it will not be much slower.
The array solution could be a monster if the number of variables is very
large. On the other hand a combination of the two ideas might work very
If you use the POINT= option it would simplify the code to have a file of
the beginning and ending position of each ID. However this will cost an
data pass to obtain the information. Almost as good might be to have a
variable indicating the end of each ID.
When you code remember that each physical reference to the SAS data
represents a new buffer, so it is probably best to place the SET statement
in a subroutine. You might not have this option depending on the problem.
From: Rob James [mailto:rob@AECHIDNA.COM]
Sent: Thursday, January 31, 2002 3:16 PM
Subject: Is set with point option the answer?
I have large datasets of transations, typically unindexed but sorte by ID
and date. Within the subset of records for
individual i, I need to be able to (minimally) pass
through the data twice, and potentially to pass through the
data multiple times - with the number of times determined
by what I find in the first pas of the data.
In another language, I would just know the record numbers, and manipulate
the index, but SAS does not seem to like this - implicit do loops and all,
so.... what are the current strategies that people use. Someone suggested
the set command with the point option.