?
Solved

Numbering records with same client number - SAS

Posted on 2013-12-10
1
Medium Priority
?
404 Views
Last Modified: 2013-12-10
Experts,

I have an Excel file that has a client_number and start_date end_date residual_start residual_end.

I would like to number the records if they have the same client_number so I can do an edit on the dates to ensure there is no overlapping.

Can someone tell me how to number the records in SAS?  I woule like to program to get the number which is currently in record_number.

See attached example.
Numbering-Sample.xlsx
0
Comment
Question by:morinia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
bradanelson earned 2000 total points
ID: 39709629
Import the data into a SAS Dataset. Let's call it 'Client_data'.

Sort the data by Client.
PROC SORT DATA=Client_data; BY Client; RUN;

Add the Record_Number column.
DATA Client_data;
    SET Client_data;
    BY Client;

    IF FIRST.Client THEN Record_Number=1;
    ELSE Record_Number+1;

    RETAIN Record_Number;
RUN;
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question