I am here to save the day!
THIS IS WHAT HAPPENED:
While Namine was reconstructing Sora's memories, she ran across Ven's memories in Sora's heart and stumbled across the many connections that Sora had forged. She confronted DiZ about this, but there wasn't any time to further investigate because the Organization was on their tails.
Ansem was already starting to regret what he'd done to Roxas and at the last minute began researching a way to bring back anyone who was lost. DiZ implanted the results of his research into Sora's heart just before he woke up, knowing that neither he nor Namine would survive the encounter with the Organization and tell him themselves. Namine implanted a similar failsafe in Jiminy's Journal, which is what you saw in re:coded.
Ansem was blown to the Dark Realm when the Kingdom Hearts encoder exploded at the end of Kingdom Hearts II. He washed up on the dark realm's beach and Aqua found him not much later. That scene is a relatively recent one as far as the timeline of Kingdom Hearts goes. I can't believe how many heads this particular part has flown over since the game's release, but explicitly stating- yes Ansem the Wise is alive and Aqua found him around the same time Re:Coded happened.
The Data Avatar you meet in DDD in Sora's heart is Ansem's research that he implanted while Sora was asleep in KH2. The Data Ansem had no way of knowing the real Ansem's fate, and existed only to pass along his research on how to restore a heart that's been lost.