Date parameters in SAS Visual Analytics

Reply
Frequent Contributor
Posts: 103

Date parameters in SAS Visual Analytics

Good day my friends:

 

I'm begining to work with dates, and i can't solve this simple problem:

 

This store has the record of payment of its workers like this:

 

Worker Date
1 09/20/1998
2 09/26/1998
3 09/27/1998
1 10/20/1998
2 10/26/1998
3 10/27/1998
1 11/21/1998
2 11/26/1998
3 11/27/1998
1 12/21/1998
2 12/27/1998
3 12/28/1998
1 01/22/1999
3 01/28/1999
3 02/28/1999
3 03/28/1999
3 04/28/1999
3 05/28/1999
3 06/28/1999
3 07/28/1999
3 08/28/1999

 

So, what is needed is: first group by workers, into workers is needed order the dats from older to newer, and add a colum indicating the number of payment, manually could be done and obtain this:

 

Order Worker Date
1 1 09/20/1998
2 1 10/20/1998
3 1 11/21/1998
4 1 12/21/1998
5 1 01/22/1999
1 2 09/26/1998
2 2 10/26/1998
3 2 11/26/1998
4 2 12/27/1998
1 3 09/27/1998
2 3 10/27/1998
3 3 11/27/1998
4 3 12/28/1998
5 3 01/28/1999
6 3 02/28/1999
7 3 03/28/1999
8 3 04/28/1999
9 3 05/28/1999
10 3 06/28/1999
11 3 07/28/1999
12 3 08/28/1999

 

how can i do to make this using SAS??

 

Thank you very much

 

Occasional Contributor
Posts: 6

Re: Date parameters in SAS Visual Analytics

You can try the below code

 

Proc SQL;
Select Sum (Worker) as Order, Worker, Date from Table1
Group by Worker, date
Order by Worker, date;
Quit;

 

Ask a Question
Discussion stats
  • 1 reply
  • 196 views
  • 0 likes
  • 2 in conversation