search

Custom Search
Affichage des articles dont le libellé est BMC. Afficher tous les articles
Affichage des articles dont le libellé est BMC. Afficher tous les articles

jeudi 1 novembre 2012

CONTROL-M system variables




CONTROL-M system variables

%%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 data center for the current
CONTROL-M installation.
Note: 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 group to which the job belongs.
Note: This variable is valid only for jobs in a
group scheduling table and it is evaluated in
base 10.


%%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).
Note: 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.
Name Format Description


%%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.
Note: Not relevant for z/OS jobs. Relevant only
for CONTROL-M/Server version 6.0.01 or later,
or (without SYSOUT) for any job submitted by
CONTROL-M/Agent for Microsoft Windows
2000 version 6.0.01 or later. This variable is not
used with group scheduling tables.


%%PRECMD command Specifies a command to run immediately before
running the job defined by MEMNAME. The
return code is ignored.
Note: Not relevant for z/OS jobs. Relevant only
for CONTROL-M/Server version 6.0.01 or later,
or (without SYSOUT) for any job submitted by
CONTROL-M/Agent for Microsoft Windows
2000 version 6.0.01 or later. This variable is not
used with group scheduling tables.


%%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 Scheduling table.
Note: This variable is available on certain
CONTROL-M computers as of
CONTROL-M version 2.2x.


%%TIME hhmmss Time of day.
Table 49 CONTROL-M system variables (part 3 of 4)
Name Format Description

The following variables are not assigned values until after the job is submitted or
completes execution. These variables can be used only for the Shout, Do Shout, Do
Mail, and Do AutoEdit parameters.


%%WDAY n Current system day of the week (1=Sun.,
2=Mon., and 0=Sat.).


%%YEAR yy Current system year.
NOTE
AutoEdit variables that return runtime statistics for a job must be resolved before the
variables can return any values. AutoEdit variables for job statistics: %%AVG_CPU,
%%AVG_TIME, %%SD_CPU, and %%SD_TIME.
Run the ctmjsa utility to compile data in the Statistical Details table before specifying the
required AutoEdit statistics variable. For more information, see “Runtime Statistics” and
Name Format Description


%%AVG_CPU numeric Average CPU time (in seconds) for previous runs of the
current job. Note: Do not use this variable in a group
scheduling table definition.


%%AVG_TIME numeric Average run time (in seconds) for previous runs of the
current job or group scheduling table.


%%COMPSTAT numeric Completion code assigned to the job by the
operating system of the computer that executes the job.
Initial value: 0.


%%JOBID string Identification assigned to the job by the operating system
of the computer that executes the job. Note: Do not use
this variable in a group scheduling table definition.


%%NODEID string Node ID of agent computer that submitted the job. Note:
This variable is available for certain computers as of
CONTROL-M version 2.2x.


%%SD_CPU numeric Standard deviation of the CPU time (in seconds) from the
average CPU time for previous runs of the current job.
Note: Do not use this variable in a group scheduling table
definition.


%%SD_TIME numeric Standard deviation of the elapsed run time (in seconds)
from the average elapsed run time for previous runs of
the current job or group scheduling table.


dimanche 21 octobre 2012

Useful SQL request for Control-M

 

Some useful SQL request :

Example:

select * from CMR_IOALOG where MSGID='5134' and LOGDATE='20120722'

Here we  put a SQL request  to get the job KO (5134) for the date of 22 July 2012 Jobs OK ==> 5133  

See those who created the jobs and those who have changed ==>

select JOBNAME,CREATIONUSERID,CHANGEUSERID from CMS_JOBDEF

ordered by date descending ==>

select JOBNAME,CREATIONUSERID,CREATIONDATETIME,CHANGEUSERID,CHANGEDATETIME from CMS_JOBDEF ORDER BY CREATIONDATETIME DESC

See the Job Status :

select ORDERNO,STATE,JOBNAME from CMR_AJF where STATE='4'

Here we looking for “executings” jobs.

more complete version :
select ODATE,ORDERNO,STATE,JOBNAME,STARTRUN,ENDRUN,NEXTTIME,OSCOMPMSG from CMR_AJF where STATE='4' order by STARTRUN desc

The status :

wait scheduling -> 0
wait confirm -> 1
submitted -> 2
not submitted -> 3
executing -> 4
ended -> 5
analyzed -> 6
disappered -> 7
post processed -> 8
Not found -> 9
wait rerun -> A
wait time -> B
wait cond -> C
wait ressource -> D
wait submission -> E
not known -> F
retry submit -> G
wait group sch -> H
fail submit -> I
unknown -> Z

With these status you can build your own SQL report ;)


How to install / upgrade Control-M Server / EM 6.4 to 7.0


Hello, In this post we going to install (or upgrade) Control-M Enterprise Manager, Server and agent 6.4 to 7.0 version.

I choose to make an "All in one" howto, because upgrading have only few steps in addition to the installation.

If you are upgrading, the first step is downloading the "Migration tool kit" (find it in the public BMC repository). If you just want install, skip the first step ;)
 



After the installation you can check in the Control-M Enterprise Manager folder, a new one : migration_export
 

Open a shell and execute the "migration.bat" and choose the good option.
 

This step check your data. If all is OK, the export files are stored in "migration_export" folder.
 

Now move this folder to a temp/secure folder because for the upgrade we must uninstall previous Control-M components (and of course everything will be delete...)

Installation

For upgraders : you need to uninstall all Control-M components before.

Installing Control-M Servers and Enterprise manager is really smooth and easy.
Take your Control-M Enterprise Manager CD/packages Double-click "setup.exe"

!!! If you upgrade sometimes we have some little problems !!!
 

Wait...We have already uninstall all components... Check the regedit

 

Delete all "Control-M" input here. Now we can continue...
 

Choose the default settings (for specific settings, wait another post ^^ ) and...



OK...we must install Microsoft .NET Framework 3.5 before...
After that you need to specify all the settings (Installation path, database size, database passwords...)
 

Check if all is OK
 

Click install and...
 

Go for a coffee ^^ It's done !

Upgraders : now take your "migration_export" folder and rename it to "migration_import"
put it in Windows : <em_home>\migration_import\ Launch "migration.bat" and choose option 1 and follow the on-screen instructions until the import is complete.

Done !


How to add and configure Control-M Agents


Adding Control-M agents is very easy.

I show you the differents methods (graphical via CCM or command line via ctm_menu)  to achieve this.

Like always, i make a short video you'll find at the end of post ;)

First, of course, Agents must be installed ( Installation of Control-M Server and Agents soon... ;)  ).  


First method : Control-M Configuration Manager

The easy way ! ^^ Login to CCM (with Administrator privileges)
Go to "Components" ==> "New" ==> "Control-M Agent"
 

Now put the right Control-M Agent name



Click "OK"

 
"Drumroll"....
  


Done !

Isn't that so easy ? :)

Second method : command line via ctm_menu

Choose option n°9 "Agent Status"
    

Next, option n°6 (the easy way ^^)
 

Enter the correct Agent name
 

Press enter
 

OK...check your "Configuration Control-M Manager client" :
 

Done !   Here a quick video





How to start and stop a Control-M Server


Control-M is for me the best Scheduler out there.

The BMC team is listening to its customers and their needs (that's pretty rare in this business...) and are always innovative. More info here This first post is about checking, starting and stopping the Control-M Server (Windows host).

 First open the cmd:

 



 Now, enter "ctm_menu"

 

 Ok, here the ctm_menu. To check, start or stop a Control-M Server,  enter option n°1
 

We have many options here, we will see this later ;)

Now type 1 "Check All" option
   

This option check all the Control-M Server components on the host.
    

Fine ! Everything is working. Now if you want shutdown all the component : Choose the option n°6
 

You can stop a specific component ==> Stopping the database : 7 Stopping Control-M Server : 8 Stopping the configuration agent : 9   Starting all or a specific component is the same way...Choose the good option ;).

A quick video about ctm_menu :