Updated from 4:54 p.m. EDT

Computer Associates ( CA)swung to a second-quarter profit from a big loss a year ago and surprised Wall Street with a nearly doubled cash flow from operations.

The mainframe and system software giant earned a profit of $41 million, or 7 cents a share, compared with a loss of $98 million, or 17 cents a share in the same quarter last year.

Sales were $942 million, an increase of 9%, about $3 million less than analysts expected.

Excluding about $75 million in items, the Islandia, N.Y., company earned $146 million, or 24 cents a share. Analysts polled by Thomson First Call were looking for a profit of 24 cents.

The small miss on the top line (as well as somewhat weak sales and EPS guidance) was overshadowed by the increase in billings and in cash generated from operations, which jumped to $299 million from $152 million reported a year ago.

If payments to the restitution fund (set up to reimburse shareholders in the wake of the company's multibillion accounting scandal) are added back, cash flow would have been $378 million.

Billings for the quarter, a key measure of future business, were $975 million -- up 14% year over year -- a record increase, the company said. Sales of products from newly acquired companies accounted for 6% of the increase.

On a trailing 12-month basis, which CA executives said is the more meaningful number, billings were up 3% over the previous 12-month period. Subscription revenue was up 12% to $696 million.

Wall Street's initial reaction to the earnings announcement was modestly positive, with shares recently gaining 11 cents after hours to $27.65. "I give them credit for the cash flow. One quarter doesn't make a trend, and it's too early to make a call, but they are heading in the right direction," said WR Hambrecht analyst Robert Stimson.

Stimson, added however, that he is concerned about the relatively small increase in organic growth and said that the market wants to see the company's mainframe software revenue, which was flat, grow in the third quarter. His company does not have an investment banking relationship with CA.

The company also announced that its board has authorized the repurchase of an additional $200 million of its shares during the current fiscal year, for a full-year total of up to $600 million.

The company expects to repurchase at least $100 million of its shares per quarter and will likely repurchase the entire $600 million of stock by the end of the fiscal year.

The extensive use of cash for buybacks prompted questions from analysts about whether CA is bringing its string of acquisitions to halt. CEO John Swainson said on a conference call that he doesn't foresee making any major acquisition in the short run.

"There's not a lot out there," he said. What's more, he and COO Jeff Clarke indicated that they see stock repurchases as a better driver of shareholder value than more acquisitions, at least for now.

Looking to the third quarter, the company said to expect an operating profit of 24 cents, on revenue ranging from $950 million to $980 million. Wall Street was looking for a 25-cent-a-share profit on revenue of $980 million.