First understand why your code doesn't work:
<xsl:when test="DTM/DTM01 = '150'">
returns true if the context node has a child DTM element that has a child DTM01 element whose string value is "150"
<xsl:value-of select="substring(DTM/DTM02,5,2)"/>
selects all the DTM02 children of all the DTM children of the context node, then takes the string value of the first node in this node-set (in document order). (In XPath 2.0 this will give you an error if there's more than one node in the node-set, to catch people making this common mistake).
You're making an assumption that the "DTM" in the second expression somehow means the particular "DTM" that you matched in the first expression, and of course it doesn't.
The way to do this kind of thing is with a single expression:
DTM[DTM01="150"]/DTM02
this selects all the DTM elements children of the context node with a child DTM01 element equal to "150", and then selects the DTM02 children of these selected DTM elements.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference