BookmarkSubscribeRSS Feed
Ravikumarpa4
Obsidian | Level 7

based on below dataset how to calculate tenure

conditions

difference between lasthired if available or its need to take today date

  Obs   ID    Phone   LastHired  BirthDate  Height  Month  Day  termination  salary  termin  Tenure

    1  327M  5553489  08APR2000  25APR1978    69       4     8   10JAN2014    15000    t       16
    2  102M  5556012  20AUG1999  16MAR1955    70       8    20           .    26000    a       17
    3  131F  5556781  16MAY1997  10SEP1976    64       6    25   25DEC2016    35000    t       19
    4  709F  5554023  25JUN1994  08JAN1962    69       9    17           .    28000    a       22
    5  056F  5559909  17SEP1991  31JAN1930    59      12    10           .    33000    a       25
    6  287M  5557024  10DEC1993  14JUL1969    78      11    23           .    40000    a       23
    7  097F  5557045  23NOV1994  17AUG1972    68      11    12   15MAY2000    21000    t       22
    8  070M  5555602  12NOV1995  14FEB1946    71       3    27   20FEB2005    23000    t       21
    9  217M  5558114  27MAR2000  19MAY1963    71       7    18           .    58000    a       16
   10  118F  5559100  11OCT1998  06OCT1977    66      12     2           .    47000    a       18
   11  187M  5553688  18JUL1996  22MAR1925    76       1     7           .    63000    a       20
   12  035M  5555131  02DEC1998  23JUN1974    70      12     6   06JUN2008    45000    t       18
   13  254F  5554950  07JAN2000  27FEB1940    63       8    25   28AUG2009    50000    t       17
   14  167F  5558333  06DEC1999  27OCT1969    69       5    22   11NOV2016    39000    t       17
   15  093F  5552525  25AUG1993  05NOV1963    57       2    25           .    42000    a       23
   16  261M  5557831  22MAY1994  01NOV1965    70      11    15           .    24000    a       22
   17  088M  5551006  25FEB2000  28MAY1950    69       9    17   15FEB2017    19000    t       17
   18  134M  5559945  15NOV1998  16AUG1959    73      11     1           .    46000    a       18
   19  207M  5556563  17SEP1996  15APR1947    67      11    25           .    48000    a       20
   20  158F  5555613  01NOV1995  10JAN1971    65      10    28           .    47000    a       21
   21  065M  5552709  04DEC1994  23JUL1964    60       9    30           .    80000    a       22
   22  288M  5551856  25NOV1997  01JUL1965    73       2    22           .    75000    a       19
   23  134F  5554442  28OCT1999  18SEP1979    69       5     5           .    44000    a       17
   24  025F  5552442  30SEP1998  07MAY1971    65      10    15           .    36000    a       18

1 REPLY 1
mkeintz
PROC Star

Clearly you have a multipart homework assignment, and you have chosen to put each part is a separate topic.  But really - separating this "average tenure" request from the "average salary" request?  Yes, one of them (tenure) appears to require some preliminary calculation before getting the average.  But, just as in your "maximum attrition" question you chose not to provide enough information to make the question clear.

 

You want help (more than help actually).  You don't specify what you tried.  You don't inform us what you don't understand.   This is not enouraging to folks who want to help other learn sas.  It seems more like a subcontracting job at very low rates.

 

So tell us, restricting discussion to just this topic, let's just focus on the very first sub-problem:

 

  1. What have you tried for calculating tenure?   Show us your program and the log it generated - essential for good diagnosis.

 

 

 

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1269 views
  • 1 like
  • 2 in conversation