There are two types of variables in Control-M
1. User defined Variable
2. System defined Variable.
Here is the list of Control-M system variables:
1. User defined Variable
2. System defined Variable.
Here is the list of Control-M system variables:
Name
|
Format
|
Description
|
%%$DATE
|
yyyymmdd
|
Current system date (4-digit year).
|
%%$NEXT
|
yyyymmdd
|
Next scheduling date for the job (4-digit
year).
|
%%$ODATE
|
yyyymmdd
|
Original scheduling date of the job (4-digit
year).
|
%%$OYEAR
|
yyyy
|
Original scheduling year of the job (4-digit
year).
|
%%$PREV
|
yyyymmdd
|
Previous scheduling date for the job (4-digit
year).
|
%%$RDATE
|
yyyymmdd
|
Installation current working date (4-digit
year).
|
%%$RYEAR
|
yyyy
|
Installation current working year (4-digit
year).
|
%%$YEAR
|
yyyy
|
Current system year (4-digit year).
|
%%APPLGROUP
|
string
|
Name of the group to which the job belongs.
|
%%APPLIC
|
string
|
Name of the Application to which the job’s
group belongs.
For z/OS jobs the %%APPL
variable is used to reference the Application name.
|
%%BLANKn
|
n spaces
|
Resolves to n blanks, where n is a number
between 1 - 214.
|
%%CENT
|
yy
|
First two digits in the current year (for
example, 20 in year 2006).
|
%%CYCLIC
|
Y|N
|
This variable is used in the command line of
the ctmorder utility to override the Cyclic parameter in cases where the user
wishes to order a single run of a job that is defined as cyclic.
Y – job is cyclic
N – job should be run only once.
|
%%DATACENTER
|
string
|
Name of the Control-M/Server for the current
Control‑M installation.
This variable is
available on certain Control-M computers as of
Control‑M version 2.20. However, prior to CONTROL‑M/EM version 6.1.02, %%DATACENTER returned the host name for the current Control‑M/Server. |
%%DATE
|
yymmdd
|
Current system date.
|
%%DAY
|
dd
|
Current system day.
|
%%GROUP_ORDID
|
nnnnnn
|
Order ID of the Active Folder to which the job
belongs.
§ This variable is valid only for jobs in an
Active folder and it is evaluated in base 10.
§ This variable has been retained for versions
of Control-M earlier than version 7.0.00.
|
%%JOBNAME
|
string
|
Name of the submitted job. This variable can
be used to override the value specified for the JOBNAME parameter (for
example, in the ctmorder utility).
On a Microsoft Windows computer, JOBNAME must
comply with Microsoft naming conventions (for example, it cannot contain /
and \ characters).
|
%%JULDAY
|
nnn
|
Current system day of the year (Julian
format).
|
%%MEMLIB
|
string
|
Mem Lib (name of the library or directory in
which job script is stored) of the job.
|
%%MONTH
|
mm
|
Current system month.
|
%%NEXT
|
yymmdd
|
Next scheduling date for the job.
|
%%ODATE
|
yymmdd
|
Original scheduling date of the job.
|
%%ODAY
|
dd
|
Original scheduling day of the job.
|
%%OJULDAY
|
nnn
|
Original scheduling day of the year (Julian
format).
For example, 36 for February 5th.
|
%%OMONTH
|
mm
|
Original scheduling month of the job.
|
%%ORDERID
|
nnnnnn
|
Unique job order ID under Control‑M.
|
%%OWDAY
|
d
|
Original scheduling day of the week of the job
(1= Sun., 2= Mon., and 0=Sat.).
|
%%OWNER
|
string
|
Owner (user ID) associated with the job.
|
%%OYEAR
|
yy
|
Original scheduling year of the job.
|
%%POSTCMD
|
command
|
Specifies a command to run immediately after
running the job defined by MEMNAME. The return code is ignored.
Not relevant for z/OS jobs. Relevant only for Control‑M/Server version 6.0.01 or later, or (without OUTPUT) for any job submitted by Control-M/Agent for Microsoft Windows 2000 version 6.0.01 or later. This variable is not used with SMART Folder. |
%%PRECMD
|
command
|
Specifies a command to run immediately before
running the job defined by MEMNAME. The return code is ignored.
Not relevant for z/OS jobs. Relevant only for
Control‑M/Server version 6.0.01 or later, or (without OUTPUT) for any job
submitted by Control-M/Agent for Microsoft Windows 2000 version 6.0.01 or
later. This variable is not used with SMART Folder.
|
%%PREV
|
yymmdd
|
Previous scheduling date for the job.
|
%%RDATE
|
yymmdd
|
Installation current working date.
|
%%RDAY
|
dd
|
Installation current working day.
|
%%RJULDAY
|
nnn
|
Installation current working day of the year
(Julian format).
For example, 36 for February 5th.
|
%%RMONTH
|
mm
|
Installation current working month.
|
%%RUNCOUNT
|
nnnn
|
Number of times the job order has been
submitted for execution (that is, the first time the job is being
submitted, this variable returns a value of 1).
|
%%RWDAY
|
n
|
Installation current working day of the week
(1=Sun., 2=Mon., and 0=Sat.).
|
%%RYEAR
|
yy
|
Installation current working year.
|
%%SCHEDTAB
|
string
|
Name of the job’s folder.
This variable is available on certain Control‑M
computers as of
Control‑M version 2.2x. |
%%FOLDER_ID
|
nnnnnn
|
Order ID of the folderto which the job
belongs.
This variable is valid only for jobs in an
active folder and it is evaluated in base 10.
|
%%TIME
|
hhmmss
|
Time of day.
|
%%WDAY
|
n
|
Current system day of the week (1=Sun.,
2=Mon., and 0=Sat.).
|
%%YEAR
|
yy
|
Current system year.
|
it very good, but you need to change the background color.
ReplyDeleteso true hahaha
DeleteIs it possible to pass the dates to the Batch scripts ?
ReplyDeleteyour_script.bat %%ODATE
DeleteGracias muy bueno. Pero faltan ejemplos. Porque el %%$DATE_0 en un nombre de archivo da error de sintaxis ???
ReplyDeletexxxxxxx_yy_zz_%%$DATE_0 da error pero xxxxxxx_yy_zz_%%$DATE pasa bien. Que zuzede ???
How to create a named pool variable
ReplyDelete%%\\\
DeletePhil
%%\\named_pool\variable_name
DeletePhil
How to subtract business days from odate
ReplyDeletehttps://documents.bmc.com/supportu/9.0.19/help/Main_help/en-US/index.htm#94590.htm is probably what your are looking for
DeletePhil
Hi,
ReplyDeleteI can see commands for loading the job for previous day.Is it possible to load the job next day? If so, can u give me the command please?
Que tal buenas tardes, planifiqué un job que ejecuta el 1er día hábil del mes y quiero calcular en una variable el último día hábil del mes anterior, usé la variable %%$PREV pero me calcula el día anterior natural y necesito el día anterior hábil, se puede?
ReplyDeleteHow about good afternoon, I planned a job that runs on the 1st business day of the month and I want to calculate in a variable the last business day of the previous month, I used the variable %% $ PREV but it calculates the previous calendar day and I need the previous business day , It can?
How to get the ordered Job(which is present in log)id as an output in control m???Do we have any function for that!!
ReplyDeletehttps://www.youtube.com/watch?v=SFqcsrr9YJk
DeleteIS there any way to get the user who ordered the job ?
ReplyDeleteIn log
DeleteYou can try : %%BSM_ORDERED_BY
Deleteupdated BMC documentation is :
ReplyDeletehttps://documents.bmc.com/supportu/controlm-saas/en-US/Documentation/Variables.htm#System
Could anyone help with the info on how to receive the field %%JOBNAME in the cobol program?
ReplyDeletehello,
ReplyDeleteI am looking for a variable to find the last day of the following month.
I found the manipulation for the last day of the current month, for the previous month, but nothing for the last day of the following month.
Thanks,
bonjour,
je cherche une variable pour retrouver le dernier jour du mois suivant.
J'ai trouvé la manipulation pour le dernier jour du mois en cours, pour le mois précédent, mais rien pour le dernier jour du mois suivant.
Merci,
Hi great info thanks a lot, there's anyway to get the hours and the minutes in different variables?
ReplyDelete