Reputation: 11
I'm using ControlM and in a command, I would like to find a variable that gives me the date in this format : YYYYMM
I found there is %%$DATE variable but it gives YYYYMMDD
Thanks for you help
Upvotes: 1
Views: 8069
Reputation: 23
You should add dot in each end of parameter
YYYY = %%$OYEAR.
MM = %%OMONTH.
YYYYMM = %%$OYEAR.%%OMONTH.
Upvotes: 0
Reputation: 335
Prefer %%$OYEAR AND %%OMONTH over %%$YEAR and %%MONTH
I suggest using the variables %%$OYEAR and %%OMONTH over %%$YEAR and %%MONTH. The reason is that date variables beginning with O refer to processing dates and do not necessarily coincide with the system date. For this case you could use any of the following options:
1. YYYYMM = %%$OYEAR.%%OMONTH
2. YYYYMM = %%SUBSTRING %%$ODATE 1 6
The $ symbol preceding the variable %%$OYEAR or %%$ODATE indicates that the year is returned in 4-digit format, instead of OYEAR or ODATE which print the year with only 2 digits.
The dot (.) character is used for concatenate variables.
For example: For the order day May 29, 2020.
1. %%$ODATE would print 20200529
2. %%ODATE would print 200529
Upvotes: 2
Reputation: 8386
It is possible to define and concatenate a variable that will represent the date in such a format.
These are available:
Upvotes: 3