turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Data Mining
- /
- Assigning Numbering Sequence

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-25-2009 09:06 PM

How do i assign a number sequence by observation?

If there are unequal number of observations from subjects:

Subject Observation Sequence

A XY 1

A AB 2

A ZW 3

B XY 1

C AB 1

C HG 2

How do i create the Sequence column such that it is of running sequence by subject?

If there are unequal number of observations from subjects:

Subject Observation Sequence

A XY 1

A AB 2

A ZW 3

B XY 1

C AB 1

C HG 2

How do i create the Sequence column such that it is of running sequence by subject?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

11-26-2009 09:53 AM

One option is to assign a SAS numeric variable and after sorting your file with PROC SORT and using a specific BY variable list, use a DATA step to assign the numeric sequence variable. You will need to look at using a BY statement in the DATA step and using IF FIRST. to reset your sequence variable as needed.

Suggest you search the SAS support http://support.sas.com/ website for DOC and supplemental technical reference and conference papers on the topic -- here is a Google advanced search argument to consider using:

first last by group processing site:sas.com

Scott Barry

SBBWorks, Inc.

Suggest you search the SAS support http://support.sas.com/ website for DOC and supplemental technical reference and conference papers on the topic -- here is a Google advanced search argument to consider using:

first last by group processing site:sas.com

Scott Barry

SBBWorks, Inc.