BookmarkSubscribeRSS Feed
Linlin
Lapis Lazuli | Level 10

Hi All,

If you get 10 hours vacation time each month and the maximum allowed is 100 hours. Is it possible to track the time  by SAS?

Thank you!

5 REPLIES 5
Haikuo
Onyx | Level 15

LinLin,

Some details may help. Such as 10 hours PTO per month, how you count it? it is calculated by workdays or hours  or just by month, so even you show up for only one day (say the last day of the month), you still get 10 hour PTO?  what is your incoming data look like? 

Haikuo

Peter_C
Rhodochrosite | Level 12

Linlin

do you already record activities, or hours worked, in some way?

If so, we just need to extend that process....

TomKari
Onyx | Level 15

Okay, let's have some fun.

I don't feel that SAS is all that great as a data entry solution, so how do you enter how many hours of holidays you've taken in a month?

Assuming we use the following code to calculate the vacation days available:

data VacationHours;
retain PotentialDays 0;
format StartDate CurrentDate date.;
StartDate = '08AUG1978'd;
CurrentDate = date();

do i = 1 to intck('MONTH', StartDate, CurrentDate);
  PotentialDays = PotentialDays + 10;
  ActualDays = min(PotentialDays, 100);
  output;
end;
run;

(For my actual start date of Aug 8, 1978, I should have 4,150 vacation days, but thanks to your harsh policies I only have 100!)

all we need to do is merge in the days taken, no?

Tom

art297
Opal | Level 21

@linlin: If you don't need a historical record, you might be able to get by with something simple like:

1. create the original file showing the hours you currently have:

libname art "c:\art";

data art.hours_have;

  input hours;

  cards;

95

;

2. create a program that you will run, say thru window's scheduler, on whichever day the new 10 hours are added:

libname art "c:\art";

data art.hours_have;

  hours=max(100,hours+10);

run;

3. create a macro to deduct hours taken:

%macro vacation(time);

  libname art "c:\art";

  data art.hours_have;

    set art.hours_have;

    hours=hours-&time.;

  run;

%mend vacation;

4. Run the macro each time you take a vacation:

%vacation(5)

Linlin
Lapis Lazuli | Level 10

Thank you all for your time and help! I use an excel file similar to the attached file to track my vacation time. I am thinking of switching to SAS.

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
  • 5 replies
  • 838 views
  • 6 likes
  • 5 in conversation