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
Solved

Numbering records with same client number - SAS

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
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…

829 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