This section describes the uxdat command used to change a date format, make an offset in days and get the type or position of a day in the calendar.
The seven results are supplied on standard output (UNIX, Windows) or as symbols (OpenVMS). Only one of the seven fields will contain data according to the initial request. The result will be in uppercase if at least on character of the output format is in uppercase.
The default language is international (English). Choice of language is determined by the format itself: j, a, s, for French and d, y, w, for International. The smallest time unit managed is the day, the largest is the year.
Syntax
Only syntactical coherence is verified.
Two types of syntax can be used depending in the results required.
Formatting and Offsets
Offsets are processed in sequence from left to right.
The command syntax is as follows:
uxdat "source date format" "source date" "target date format" "offset"
Example:
uxdat "dd/mm/yyyy" "01/01/2018" "dd-mmm-yy" "-1do/1m"
Output:
Result 1: U_DATE_RES: Date with the target format and the required offset.
Type of Day
The command syntax is as follows:
uxdat "source date format" "source date" "type" [MU=<MU name>]
Example:
uxdat "dd/mm/yyyy" "01/01/2018" "obm"
Output: The result or global symbol (OpenVMS) depends on the value of “Type”. Uxdat valorizes the following global symbols depending on the arguments.
Result 2: U_TYPE_DAY: Status of the source date (Working, Closing, Holiday)
Result 3: U_RGO_BEG_MONTH: Position of a working day from the beginning of the month.
Result 4: U_RGO_END_MONTH: Position of a working day from the end of the month.
Result 5: U_RGO_BEG_YEAR: Position of a working day from the beginning of the year.
Result 6: U_RGO_END_YEAR: Position of a working day from the end of the year.
Result 7: U_NBDAYS: Number of days between two dates.
Description of Items
Source date format and target date format
The date format must use the following codes:
Date Formats |
International |
French |
---|---|---|
Position of month as 1-12 |
m |
m |
Position of month as 01-12 |
mm |
mm |
Month as Jan to Dec (jan to dec) |
mmm |
mmm |
Month as January to December (janvier to décembre) |
mmmm |
mmmm |
Position of day in month as 1-31 |
d |
j |
Position of day in month as 01-31 |
dd |
jj |
Position of day in week as 1 to 7 |
p |
p |
Position of day in week as mon to sun (lun to dim) |
ddd |
jjj |
Position of day in week as Monday to Sunday (lundi to dimanche) |
dddd |
jjjj |
Position of week in year as 1-52 |
w |
s |
Position of week in year as 01-52 |
ww |
ss |
Position of day in year as 1-365 |
q |
q |
Position of day in year as 001-365 |
qqq |
qqq |
Year as 00 to 99 |
yy |
aa |
Year as 0000 to 9999 |
yyyy |
aaaa |
If the input format contains a year in two characters, the year is translated like this:
Source date
Source date must respect the format specified by Source date format. The uxdat command requires dates only between 1970 and 2040.
Offset
Offsets must use the following codes ("n" is an integer):
Offsets |
International |
French |
---|---|---|
Separator |
/ |
/ |
Position |
n |
n |
Negative offset |
-n |
-n |
Positive offset |
+n |
+n |
Positive offset of n calendar days |
+nd |
+nj |
Negative offset of n calendar days |
-nd |
-nj |
Positive offset of n working days |
+ndo |
+njo |
Negative offset of n working days |
-ndo |
-njo |
Set to nth calendar day of the week |
no |
ns |
Set to nth working day of the week |
nwo |
nso |
Positive offset of n weeks |
+nw |
+ns |
Negative offset of n weeks |
-nw |
-ns |
Set to nth calendar day of the month |
nm |
nm |
Set to nth working day of the month |
nmo |
nmo |
Set to nth calendar day (type p) of the month |
nmp |
nmp |
Set to nth working day (type p) of the month |
nmop |
nmop |
Positive offset of n months |
+nm |
+nm |
Negative offset of n months |
-nm |
-nm |
Set to nth calendar day of the year |
ny |
na |
Set to nth working day of the year |
nyo |
nao |
Set to nth day (type p) of the year |
nyp |
nap |
Set to nth working day (type p) of the year |
nyop |
naop |
Set to nth month of the year |
nmy |
nma |
Positive offset of n years |
+ny |
+na |
Negative offset of n years |
-ny |
-na |
Type
The type must use the following codes:
Type |
International |
French |
---|---|---|
Position of a working day from the beginning of the month |
obm |
odm |
Position of a working day from the end of the month |
oem |
ofm |
Position of a working day from the beginning of the year |
oby |
oda |
Position of a working day from the end of the year |
oey |
ofa |
MU=
(Optional) Enter the management unit name of the target calendar. Dollar Universe calendars will only be consulted in the case of working day offsets or requests concerning the status of the source date. All other operations are independent of the Dollar Universe environment.
Examples
Format examples for 01/02/18:
"d" |
1 |
"dd" |
01 |
"ddd" |
Mon |
"dddd" |
Monday |
"dddd mmmm dd yyyy" |
Monday February 01 2018 |
"dd mmmm yyyy" |
01 february 2018 |
"q" |
32 (position in year) |
"qqq" |
032 (position in year) |
"w" |
5 (week) |
"ww" |
05 (week) |
"dd-mmm-yyyy" |
01-Feb-2018 |
Offset examples for 01/02/18:
"+1m/1m/-1do" |
last working day of the month (offset +1 month, set to day 1, offset –1 working day) |
"+1y/1y/-1w/7w" |
Last Sunday of the year (offset +1 year, set to day 1, offset –1 week, set to day 7) |