looking for a script that list MVS job

Several scripts
Post Reply
User avatar
arno76
Nouveau
Nouveau
Posts: 24
Joined: 29 Aug 2008 12:00

looking for a script that list MVS job

Post by arno76 » 23 Sep 2008 11:14

Hello,

i d like to know if it s possible to send a script to controlm like

select a.APPLIC,";",a.APPLGROUP,";",a.JOBNAME,";",a.MEMNAME,";",b.STARTRUN,";",b.ENDRUN,";",b.ELAPTIME,";",b.OSCOMPSTAT,";",b.NODEID
from CMR_AJF a,CMR_RUNINF b
where a.ORDERNO=b.ORDERNO
and
a.STATUS="N"
ORDER BY APPLIC

but for MVS.I know there are some utilities for MVS but i d like to use ORACLE SQL.

Thanks

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 23 Sep 2008 4:02

If you have the EM server connected to the MVS server, and you see from EM the MVS jobs you have also the AJF of MVS server table on the open DB. So you can run the query you want.

User avatar
ranger67
Nouveau
Nouveau
Posts: 52
Joined: 03 Jan 2008 12:00

Post by ranger67 » 23 Sep 2008 4:15

It is not possible to do that as there is no database on the MVS environment. However, you can query CTM/EM for most of this information for the MVS environment. Based on your query below, the only item you would be missing is compstat. You could get status and state which can tell you if it has run and has it run to good completion. The only other thing to remember is that you'll need to query dynamic tables which are created daily at newday. These are easy to get by doing something like this:

select MAX(name) from sysobjects where name like "A%DC%JOB"

you would replace DC with the datacenter specifier from when you defined the datacenters to EM.

Hope this helps.

User avatar
arno76
Nouveau
Nouveau
Posts: 24
Joined: 29 Aug 2008 12:00

Post by arno76 » 23 Sep 2008 4:43

thanks for answers, but have you got exemple of script to run?
must i run this on EM? if yes by which command?
have you got a list of the Dynamic Table?

thanks in advance

User avatar
mauriziog
Nouveau
Nouveau
Posts: 807
Joined: 08 Jun 2007 12:00
Location: Varese - Italy
Contact:

Post by mauriziog » 23 Sep 2008 5:21

If you have almost two ctm/server:
ctmopen + ctmmvs and one EM that have two gateway, one on MVS and one on ctmopen; you have a table in the EM/DB that has a name like this:
A080923MVS_AJOB
is the AJF table for MVS jobs for today where "080923" is YYMMDD date format for today.

So you can for example do this query:

$query="SELECT JOB_NAME, GROUP_NAME, ORDER_ID, APPLICATION, NEXT_TIME, STATUS, STATE FROM A080923MVS_AJOB WHERE (GROUP_NAME = 'GroupName')";

or other as you like.

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 23 Sep 2008 9:24

In addition of 'mauriziog' post if you run this command:

<select ACTIVE_NET_NAME from COMM>

You find out the 'Active Net Name' named <TableCode> for each datacenter.

Please note:
- That it's necessary to prefix the <TableCode> results with "A"
- The name of 'Active Net Name' change every time when one <download> action is occured (Control-M/MVS or Control-M/Server to Control-M/EM)

Regards
Walty

User avatar
arno76
Nouveau
Nouveau
Posts: 24
Joined: 29 Aug 2008 12:00

Post by arno76 » 24 Sep 2008 4:29

thank you very nuch, thats work fine ...
just a little one ;-)
how can i put the result of the query SELECT JOB_NAME, GROUP_NAME, ORDER_ID, APPLICATION, NEXT_TIME, STATUS, STATE FROM A080924003_AJOB; into a file?

thanks

User avatar
Walty
Nouveau
Nouveau
Posts: 473
Joined: 20 Jan 2006 12:00

Post by Walty » 24 Sep 2008 5:52

Example:

SQL -s << EOF >> your file
SELECT JOB_NAME, GROUP_NAME, ORDER_ID, APPLICATION, NEXT_TIME, STATUS, STATE FROM A080924003_AJOB;
EOF

Post Reply