|
|
NOTE: This API is obsolete.
Reference Type: Supported, Category: Miscellaneous, Integration Agreement: 10046
NOTE: The XUWORKDY routine is maintained for code that might still use
it.
To use the ^XUWORKDY API, you must make sure, on the system that it
is being used on, that Kernel's HOLIDAY file (#40.5) is populated with each
year's holidays for the workday calculation to work correctly. If it is not
populated, you need to populate it yourself (Kernel distributes this file
without data). Only enter holidays that fall on weekdays, however.
You
can call the ^XUWORKDY routine to calculate the number of workdays between two
dates (X, X1) and return the answer in X. If either date is imprecisely
specified, or if the HOLIDAY global is empty, then ^XUWORKDY returns X as the
NULL string. Otherwise, the returned value is positive if X<X1 and negative
if X>X1.
The first FOR loop in ^XUWORKDY checks the HOLIDAY global
and sets %H equal to the number of holidays between the two dates. It is
assumed that the HOLIDAY global contains only weekday holidays.
The
second FOR loop (F %J=%J:1 ... ) steps forward from the earliest date and stops
at the first Sunday or at the ending date (whichever comes first) counting the
number of workdays.
The third FOR loop (F %K=%K:-1 ... ) steps backward
from the latest date and stops at the first Sunday or at the beginning date
(whichever comes first), counting the workdays.
Then %I is set equal to
the number of days between the two Sundays.
Finally, X is set equal to
the total counted days minus the number of weekend days between the two Sundays
( -(%I\7*2) ).
^XUWORKDY
| X: |
(required) Starting date in the YYYMMDD format (e.g., 2850420). |
|
| X1: |
(required) Ending date in the YYYMMDD format (e.g., 2850707). |
|
| x: |
The number of workdays in the interval. |
|
>S X=2850420,X1=2850707 D ^XUWORKDY W X 55
|
VA (Internet) / VA (Intranet) / OI / HSD&D / Site Map / Terms of Use / VA Privacy Policy / Accessibility Reviewed/Updated:
December 14, 2005
|