- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-21-2010 02:52 PM
(20138 views)
I need to create a dataset of only odd account numbers from a larger data set. Any suggestions?
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello Acaims,
A possible solution:
[pre]
data r;
set i;
if MOD(AccountNo,2)=1 then output;
run;
[/pre]
Sincerely,
SPR
A possible solution:
[pre]
data r;
set i;
if MOD(AccountNo,2)=1 then output;
run;
[/pre]
Sincerely,
SPR
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!!! That worked great!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Consider using the mod function. Assuming there is an integer variable in your dataset called ACCOUNT, odd numbered accounts could be selected with the following where statement.
[pre]
where mod(account, 2)=1;
[/pre]
[pre]
where mod(account, 2)=1;
[/pre]
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much! I also just figured that I can merge all the datasets and it will give me my desired dataset.