Updated from 4:54 p.m. EDTComputer 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.