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!
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
Linlin
do you already record activities, or hours worked, in some way?
If so, we just need to extend that process....
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
@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)
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.