Next year, Peter Weis, CIO of Matson, an ocean transportation and logistics company, will see the completion of a long-term IT transformation project that he conceived and nurtured for most of a decade. "We're heading into our eighth and final year," he says. "When we're done, we'll have retired every single legacy IT platform. Our mainframe will be shut down."\n\n\nFinishing this transformation project is a source of enormous pride for him and his team. "The day-to-day pain of working on a project like this fades, but the deep satisfaction stays," he says.\n\n\nRelated: Careers Tips From CIOs\n\n\nIt's an experience many CIOs will never have.\n\n\nWeis has been CIO at Matson for nine years, but the average CIO tenure is just five years and four months, according to a recent CIO magazine survey. This may be good news for the CIOs who spend their careers climbing the ladder by moving from company to company. But most CIOs find themselves leaving positions where they would have preferred to stay.\n\n\n"When we do get called in to do a CIO search, more often than not we're being asked to replace someone who is not succeeding," notes Phil Schneidermeyer, partner at executive search firm Heidrick & Struggles and a CIO columnist.\n\n\nWhy do so many CIOs fail? It's not always their fault. "It could be that the business goes sideways, or events overwhelm perfectly well-intended strategies," Weis says. "There could be a change of management or a change of direction. There are always a lot of headwinds for CIOs to try to get through."\n\n\nIn many cases, a long tenure is a matter of luck. "Some CIOs last because the company hasn't demanded any great feats of strength from IT," notes Martha Heller, president of Heller Search Associates and a CIO columnist. When the company aims for major accomplishments and things go wrong, the CIO can quickly become a scapegoat, she adds. "Top management says, 'IT put in that new system and we're still having problems!'"\n\n\nThe problem could be that users haven't changed their processes, or many other elements outside IT's control, she says. Nevertheless, "Sometimes companies throw so much mud at the door of the IT department that there's no choice but for the CIO to go," Heller says.\n\n\nWhen things don't go as planned, it's easy for IT to lose the CEO's confidence, Weis adds. "That lack of confidence can show up as capital drying up and investments in IT slowing. The momentum slows on your strategy, projects slow down, and you begin to lose talent." With the best talent leaving, it becomes harder to meet goals and fulfill expectations, and so confidence in IT sinks even lower.\n\n\n"You've got a spiral downwards," Weis says.\n\n\nAnd sometimes a short tenure really is the CIO's fault. Classic blunders include the following:\n\n\n1.\u00a0Technical failures, missed deadlines and cost overruns. "If the email server goes down several times in a row, that will cause a problem for the CIO," says Nigel Fenwick, vice president and principal analyst at Forrester Research and a former IT executive at Reebok UK. "And that's just email. If a core system like ERP goes down for an extended period and the company grinds to a halt, the CIO is responsible. So taking care of business is fundamental."\n\n\nFailures in this area can quickly sour a CIO's all-important relationships with top executives. "My boss said, 'You can't have a strong relationship with me if you don't have one with my other direct reports,'" Weis says. "For me to understand all my peers' day-to-day worries is absolutely crucial, and that's a key to staying power."\n\n\n2.\u00a0Talking technology instead of finance. "If you approach the CEO and you want to talk about the coolest new storage subsystem you just installed and your Rackspace and the new [voice-over-IP] network you're implementing, that's a pitfall," says Rick Roy, who's been CIO for nine years at CUNA Mutual Group, an insurance and financial services company serving credit unions and their members.\n\n\n"Not many CEOs want to have that conversation, unless they're in the technology industry." Roy says. "Can you translate what you're doing into business language? How is it helping your company against its competitors? That's a very different conversation from talking about the new gadget of the day."\n\n\nWeis agrees. "There's a squirm factor for CEOs when you start talking about technology. They don't want to learn about it and they're uncomfortable with the conversation," he notes. "You have to be able to speak the CEO's language of corporate finance. How does a balance sheet look? How is return on invested capital measured?"\n\n\nTo make sure he understood these core concepts, Weis got an MBA in his 40s. "It made me a better CIO and way stronger." Many of the other IT executives at Matson have done the same.\n\n\n3. Constantly asking for more money. "Some CIOs have an expectation that with every new technology, their operating budget should go up," says Rick Mears, who for the past seven years has been senior vice president and CIO at Owens and Minor, an $8.6 billion healthcare supply company. "That's a recipe for a short-term CIO."\n\n\nInstead, he says, successful CIOs understand that operating expense is a finite resource. "I see it as technology's responsibility to free up [operating expense] dollars to offset the funds we need for new [high-impact] technology." For instance, he asks, can moving servers to the cloud create enough savings to pay for a new e-commerce or business intelligence system that will benefit the business? "That's an approach that will get the business more comfortable with IT."\n\n\n4. Inability to build and maintain relationships in the C-suite. When CIOs do fail, "most often the piece they're not succeeding at is the relationship-management side," Schneidermeyer says. "Those who succeed have very strong relationship-building skills. It's a critical core competency at the CIO level, far more so than technical competency or even expertise in the company's business or industry. A CIO may have grown into that role through strength in managing projects such as application development or consolidating data centers, and that was fine when that was 'the job.' But as the CIO role becomes focused on the business, those skills won't take you to the next level."\n\n\nThe most critical relationship is the one with the CEO, whether or not a CIO reports to him or her directly. "The CIO has governance responsibility with regard to information security," notes Roy at CUNA Mutual. "That's fairly high on the corporate risk list, so there's going to be some board-level attention and you need to collaborate with the CEO."\n\n\nBut that's just one relationship to manage. Even CIOs who report directly to the CEO need to nurture their ties with the rest of the organization's top management. "CIOs who understand the need to communicate across the executive level and the C-suite get support from the C-suite to help them stay in that role," says Forrester's Fenwick.\n\n\nHaving those relationships in place stands CIOs in good stead during the inevitably difficult conversations that arise around technology. "Everyone wants to button everything up, but not change processes. Everybody wants the latest and greatest technology, but doesn't want to consider risk management," Schneidermeyer says. Faced with these tough choices, "it all boils right down to relationship management, and being able to balance competing demands. And you do that by coming together as a management team." (Fore more tips on outlasting the average tenure, see "Tips for the Politically Astute CIO.")\n\nSurviving a CEO Changeover\n\nOne of the toughest times for a CIO to hang on to his or her job is when a new CEO takes over. In some cases, the battle is lost before it's even begun. "Some CEOs know before they arrive that they're going to bring in their own management team," notes Heller, an executive recruiter.\n\n\nOther times, the new arrival brings a change in priorities or focus that can bode ill for the CIO. "Our new CEO was really focused on making changes in the line-oriented part of the business, rather than the support side," reports one former CIO who asked for anonymity. The new CEO restructured the lines of business but didn't seem all that interested in discussing the company's technology.\n\n\n"There was recognition that IT is a key component of change, but it was hard to get the CEO to focus on it," she says. "I got the feeling that once the reorganization was finished on the line side, the CEO would evaluate the back office. So there was change coming, probably." Rather than wait to find out, she moved on to a job as CIO of a different company.\n\n\nThough the situation can be challenging, there are ways CIOs can improve their chances of faring well in the new regime. Begin by making sure you get to have at least a couple good conversations with the new CEO, advises Roy, at CUNA Mutual. Roy stayed on as CIO when Jeff Post took over as CEO in 2005.\n\n\nGetting face time with the CEO can be challenging, he concedes. "Thinking back to when Jeff joined us, he's a very externally focused CEO who spends a lot of time with our customers and in our industry. In the very early days, I had to orchestrate some travel times together and attended some industry events with him."\n\n\nIt's not common for CIOs to accompany chief executives to their industries' trade events, but Roy says it was a great opportunity to learn more about the business. "You have to step out of your comfort zone to engage that leader wherever he or she happens to be," he says. "It's not coming to you; you have to go get it." If, despite such efforts, the new CEO still won't meet with you, it's a sign you should probably move on, he adds.\n\n\nOnce you've got face-to-face time with the CEO, there are a couple of conversations you need to have, Roy says. One is checking to make sure the CIO and the CEO agree about what is expected of IT. The other is a situational assessment. Do you and the CEO see the current state of IT operations in the same light?\n\n\n"If I think everything is fine and the new CEO thinks everything is broken, we need to reconcile as to why we have different points of view and what we're going to do about it," Roy says. "You can't just find yourself 180 degrees from what the new leader is thinking, because that's not sustainable."\n\n\nIt's important for incumbent CIOs to be able to demonstrate--with solid information and accomplishments--the value of their IT departments. "That's big," Roy says. "If you have the opportunity to tell your story as CIO, do it just as you would to your board. Most presentations I've done to our board are 20 minutes or less, and you have to make sure you get to the point and leave them with the key takeaway." Take that same approach with the new CEO, he advises, since most don't have the time or mental bandwidth to absorb details.\n\n\nLining up talking points about IT's performance will also help you if the new CEO brings in a consulting firm to review IT operations--another sign that you may be in a precarious position as CIO. "If you have a good story and you tell it well, it will be harder for the consultancy to throw you under the bus," Roy notes.\n\n\nAll the recommended strategies so far will serve a CIO especially well when a new CEO comes in from another company. But more than 75 percent of CEOs are promoted from within, according to a 2011 study by Booz and Company. A CIO can best prepare for this event by being sure to maintain excellent relationships with all the company's C-suite executives, because who knows when one of them could become your new boss?\n\n\nThat strategy worked well for Weis, the Matson CIO. Matson was formerly a subsidiary of Alexander and Baldwin, but it split off into its own company earlier this year, and Matt Cox, formerly the head of the subsidiary, became the new entity's CEO.\n\n\n"I reported to Matt when he was not CEO," Weis recalls. "Because of my credibility with him, that reporting relationship didn't change even though his number of direct reports grew. I did not go through a transition where I was placed under Finance or a COO, and that's because of how comfortable he was working with IT directly."\n\n\n"If a CIO is managing internal customer relationships well, that's a great head start," Roy says. "Now the customer got elevated to a bigger role [as CEO], and if that's a happy customer, life is good. You're there to help that person be even more successful. If that's an unhappy customer, it's probably not so good." In that case, he says, it may be time to start looking for a new job.\n\nDo You Fit In?\n\n"Having deep industry knowledge is another key part of staying very close to the CEO," Weis says. "Know your industry--know your boss's industry! If you know the business and how your CEO is measured, the more closely aligned you are, and the more likely [you are] to achieve success."\n\n\nEven more important is for the CIO to fully understand the company's values, Weis says. "Acknowledge the values, write them down, and think about them," he advises. "Operate by leveraging those values and not trying to change them."\n\n\nFor example, Matson is a logistics company that values operational excellence and consistency, Weis says. "I can't make Matson value speed over operational excellence and steadiness--I can't do it. I can nibble along the edges of how fast things can get done, but that's all."\n\n\nDoes this add time to projects? Probably, he acknowledges. "Maybe the eight-year plan would have been a four- or five-year plan at some other company where we could have had more disruption and I could break a few things." But in a company where every ship must arrive on time and every delivery must be consistently correct, that wasn't possible.\n\n\nOn the other hand, Matson's focus on steadiness and consistency meant top executives never wavered from the plan, despite dramatically changing circumstances. "It's a testament to our organization's commitment that they hung in there through lots of technical changes and the worst economic downturn of recent times," Weis says.\n\n\nAnd he's grateful. "Achieving this large transformation has a lot of meaning for me," he says. "It seems like a once-in-a-lifetime opportunity."\n\nCareers Tips From CIOs\n\nLongtime CIOs offer the following tips for building and maintaining the executive relationships that could make the difference between a long or short tenure as CIO:\n\n\n1. Figure out who all the stakeholders are. "The trap CIOs get caught in is not knowing who the key stakeholders are," says Phil Schneidermeyer, partner at executive search firm Heidrick & Struggles and a CIO columnist. "You could have a very hierarchical organization where your key stakeholders are as small as half a dozen people on an executive committee. It could be a partnership organization with 500 stakeholders, each of them a mini-CEO. Whatever it is, you have to know who they are, where they're coming from, how best to communicate with them, and how often. You have to have credibility, and it doesn't come from your background. It comes from the relationships you build."\n\n\n2. Recognize that the IT department doesn't have all the answers. "No idea is a good idea unless it was created by a business person and a technology person working together," says Rick Mears, CIO at Owens and Minor. "So get over the belief that you know what everybody needs and they'll figure out that they need it after you give it to them."\n\n\n3. Earn credibility by completing IT projects on time and keeping systems up and running. "You have to deliver relentlessly over time," says Peter Weis, CIO of Matson. "Executive sponsors are accountable, and they're measured based on the large IT initiatives we're driving that they've supported. You have to deliver on time--not one or two times, but over years--so that they don't have to apply a discount factor to what you say you are going to do. You're not going to be perfect, but you have to have way more wins than losses. It's a whole bunch of doubles and singles, as opposed to a few home runs."\n\n\n4. Humility and accountability are essential for a long-term CIO. "Accept responsibility for errors and acknowledge the effect on the business when those rare instances of failure occur," Weis advises.\n\n\n5. When projects succeed, share the credit as much as possible. "To me, a CIO will earn more respect and more power if he or she points the finger at others and says, 'You brought more to the table, and so did you, and you, and you,'" says Brian Shipman, who became chief Internet officer at Heritage Auctions in 1999 and then CIO in 2007.\n\n\nAnd, Weis adds, if your business contacts try to steal the credit for a successful IT initiative, let them. "It's a lesson I've learned over time: You're better off making business partners look good than coming off as the smartest one in the room," he says. "Trust is only as good as the level of comfort you've built with your business partners, and making every success look like a business success will build that trust."\n\n\nIt can be tough, he acknowledges, because letting business peers take credit for a success means robbing your own hardworking IT staff of those kudos. "That's a hard one, because you want them to have that recognition. But if you don't do it, you're going to lose political support. And IT is by its nature a somewhat thankless job."\n\n\nMinda Zetlin is a business technology writer based in New York and co-author of The Geek Gap: Why Business and Technology Professionals Don't Understand Each Other and Why They Need Each Other to Survive.\n\n\nFollow everything from CIO.com on Twitter @CIOonline, on Facebook, and on Google +.