Narrative:

While on an IFR flight plan to ZZZ; I had a near midair collision; near midair collision; with another aircraft not talking with ATC and had to immediately take evasive action to avoid the other aircraft by climbing.the other aircraft was less than a half-mile away; closing within 50 degrees of a head-on collision and level at our assigned altitude of 3;000 feet MSL. The other aircraft flew directly under us within 200-300 feet from what we could tell and took no action to maneuver away from us. ATC had given us a traffic advisory call; saying; 'traffic; 2;700 feet and at your 1 o'clock; northbound; unknown type.' I could see them on ads-B in and saw that they were actually in a slight climb and then leveled off at 3;000 about 10 seconds after the traffic call-out. Ads-B in showed 0 feet vertical separation. Because of this; I was vigilantly staring at my 12 to 1 o'clock looking for them. [I] saw them closing towards us and in less than a second; I pulled up and gained 300 feet less than 2 seconds later; they passed directly under us.after ensuring they were no longer a factor; I began correcting our altitude back down to our assigned altitude of 3;000 feet and called ATC to let them know we had a near midair collision. He said; 'I showed that traffic at 2;700 feet' again and didn't ask anything more about the situation. I feel like ATC should have done more to separate us and given us a vector away from the closing traffic. Yes; at that moment; we were in VMC and were able to avoid at the last moment; but we had just emerged from the clouds and only saw the traffic as we got around the corner of another cloud. If we had reacted seconds later; I feel [that] we would've collided.

Google
 

Original NASA ASRS Text

Title: C172 Pilot reported a NMAC and states that ATC could have done more in the way of separation.

Narrative: While on an IFR flight plan to ZZZ; I had a near midair collision; NMAC; with another aircraft not talking with ATC and had to immediately take evasive action to avoid the other aircraft by climbing.The other aircraft was less than a half-mile away; closing within 50 degrees of a head-on collision and level at our assigned altitude of 3;000 feet MSL. The other aircraft flew directly under us within 200-300 feet from what we could tell and took no action to maneuver away from us. ATC had given us a Traffic Advisory call; saying; 'Traffic; 2;700 feet and at your 1 o'clock; northbound; unknown type.' I could see them on ADS-B In and saw that they were actually in a slight climb and then leveled off at 3;000 about 10 seconds after the traffic call-out. ADS-B In showed 0 feet vertical separation. Because of this; I was vigilantly staring at my 12 to 1 o'clock looking for them. [I] saw them closing towards us and in less than a second; I pulled up and gained 300 feet Less than 2 seconds later; they passed directly under us.After ensuring they were no longer a factor; I began correcting our altitude back down to our assigned altitude of 3;000 feet and called ATC to let them know we had a NMAC. He said; 'I showed that traffic at 2;700 feet' again and didn't ask anything more about the situation. I feel like ATC should have done more to separate us and given us a vector away from the closing traffic. Yes; at that moment; we were in VMC and were able to avoid at the last moment; but we had just emerged from the clouds and only saw the traffic as we got around the corner of another cloud. If we had reacted seconds later; I feel [that] we would've collided.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.