Workload Manager Policy in XML Format – Part I

(Originally posted 2009-04-06.)

This isn't particularly new – but I'm guessing most people who work with WLM don't know about this…

For some time now you've been able to download a java application that enables you to convert your WLM Service Definition to and from XML. Perhaps more importantly, the application provides a nice way to edit the Service Definition – and that is actually its main purpose.

You can get the program from here. Unfortunately – from my perspective as someone who aspires to migrate to Linux over time – it is packaged for Windows. (I have mentioned this to Development – as it appears to be a java/Swing application and hence potentially portable.)

To retrieve the ISPF-based Service Definition, to convert it to and from XML, and to update it on z/OS a pair of batch jobs are used, submitted via FTP. If you get the setup right – and this is quite easy – the whole round-trip works well.

In any case the java application is a nice way to edit the Service Definition.

Now to the main purpose of this blog entry.

Manipulating the XML WLM Service Definition using PHP

The java application saves a copy of the XML Service Definition to your local workstation.XML is really nice as you can manipulate it in so many different ways.

Consider PHP, as an example. I may blog about this some more one day but I've installed Apache, with PHP support, on my Thinkpad. And this webserver is permanently up but only accessible via "localhost" URLs. (I've written a few scripts that automate most of the tedious parts of retrieving performance reports from the mainframe and displaying them.)

PHP is a good webserver scripting language, well suited to lots of tasks, and with an active development community. One of the things it's good at is processing XML. The following code example does some basic processing that's useful to me. You might find it useful to build on.

$dom=new DOMDocument;
$xpath=new DOMXPath($dom);

// List classification rules
echo "<h2>Classifications</h2>\n";
echo "<ul>\n";
foreach($classifications as $c)
  echo "<li>$subsys - $desc\n";
  echo "<ul>\n";
  foreach($crs as $cr)
    echo "<li>$qtype - $qvalue ($sclass / $rclass)\n";
  echo "</ul></li>\n";
echo "</ul>\n";?>

In XML terms the root node is <ServiceDefinition>. You can get to the classification rules with an XPath of


The "wlm" in the above XPath expression refers to the need to register a namespace. The line


does that. Using this XPath expression yields a list of <Classification> nodes, which the code stores in the PHP variable $classifications. The rest of the code loops through the list, pumping out list items. Each list item in this sample describes the classification rule and (in brackets) the Service Class and Report Class the rule's firing leads to.

This is all simple PHP. I chose this small part of the WLM Service Definition to format as it's an example of something that's not in RMF's Type 72 record. When I look at how customers have set up WLM I really think I need to know how the classification rules were coded.

I'm hoping this code fragment will get you thinking about the value of having the WLM Service Definition in XML form. (By the way the XML form is saved on z/OS as part of the conversion and download process – and the conversion code is very visible if you nose around a bit.)

I've written "Part I" in the title of this blog post because I think I'm going to play with some more XML-related technologies – just to show the flexibility of the approach.

Published by Martin Packer

I'm a mainframe performance guy and have been for the past 35 years. But I play with lots of other technologies as well.

2 thoughts on “Workload Manager Policy in XML Format – Part I

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: