Solved

Numbering records with same client number - SAS

Posted on 2013-12-10
1
399 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

717 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