I actually do this for a living (IBM style), so I figured I'd chime in; you don't see too many mainframe questions around. I'm guessing the reason for that is that they've all been asked already, in 1981. Mainframe technology, as seen from a programmer's standpoint, hasn't changed all that much in the last several years. Want to program? No problem, pick one of about 6 languages and get started. Need to interact with users? We can do that, here's CICS. Have at it. Don't feel like writing actual code? Check out DFSORT and ICETOOL.
This can work in your favour, if you let it. Learn the stuff, and you'll be set for years. There's another answer here to this question that raises the point that the industries that typically use mainframes (financial/insurance) will eventually see the cost of maintaining their legacy systems become too high, and switch to a more modern, distributed, platform. There is, however, a large cost to converting all these systems over to cheap, x86 servers running java. Not just the cost of doing it, but the risk involved in doing it wrong. If, hypothetically, you were to convert a system from mainframe COBOL to midrange java, and you messed up a bunch of account values or lost data in any manner, you'd probably be on the bad end of a class action lawsuit, not to mention potential punative regulatory action. This is why nobody does that. My system has about 4 million lines of COBOL, and they all (mostly)work. Like they say, "If it ain't broke, don't fix it."
But its not all sunshine and roses. Remember when I said that things haven't really changed much in a while? Well, that's not always a good thing. Mainframe programming, to me at least, is easy. Easy means boring. There's only so many things you'll need to do. Once you've done them all, you win! What do you win? The chance to do them all again! Read this file, table up the values, multiply them, get some rows from that database table, slap them together, write a report. You kinda have to go out of your way to do something cool.
So if mainframes are so boring, and dull, why would anyone use one, in this cloudy, virtualized, feel-good era? They're solid as hell. I got to go on a tour of our datacenter a while ago, and saw the zSeries we have. Its a giant, 7 foot tall, imposing black box with a giant, glowing, blue bar on the front. It looks imposing, and its reliability backs that up. Im the 4 years I've been at my current job, I remember it needing to be rebooted one time outside its normal maintenance window. I don't think we have an x86 server that can even come close to that uptime. It can process 4 million records of work in about an hour an a half during our cycle's critical path. Thats about 40GB of data in, spun around, and back out again. We process about 1 million online transactions per day, no problem. Multiply that by around 4 (other systems share the mainframe with mine), and it can still keep up. There are database tables that exceed 1TB apiece, and we can slice and dice those all day and nobody notices the drain. Mainframes are really only good for 1 thing, but they're really good at it. If you need to do the same thing millions and millions of times, every day, and the fate of the company rides on it getting done, then you want a mainframe.
This isn't to suggest that mainframes cant do cool stuff. MQSeries can do some interplatform communication. CICS has a webservice hosting facility, as well as a client. COBOL can interact with java classes to provide additional functionality. Normally you don't get to play around with that, because the vendor package has done all the "guts" for you. So there is the potential to do cool stuff with a mainframe, it just doesn't come up as frequently as it would working with newer technologies.
I don't think mainframes are a bad way to go, as a programmer. There's always a job somewhere, because there aren't many people who can do it. Just try to get involved in small, non-mainframe, side projects while you're doing it, to keep things fresh.