🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
To Solop (and others),
Although it's a late solution to this specific problem, yet there is a simple solution indeed. First sort the dataset using the sequence variable as your key variable. (not shown in the code).
Let's say your sequence variable is exseq. Then, before your SET statement use a RETAIN statement and use the seq variable as the statement's option.
data EX;
retain exseq ; * must retain this variable in order to re-start assigning a new sequence number;
set ex1;
by subject;
if first.subject then exseq = 0;
exseq+1; * this will assign sequential values to exseq variable;
keep subject exseq; * optional!;
run;
Hiope this helps.
- « Previous
-
- 1
- 2
- Next »