Narrative:

After takeoff; tower advised a different [company aircraft] to contact departure. Since we knew there were no other company airplanes airborne in the vicinity; I queried the tower as to whether they intended for us to contact departure instead. Tower replied 'negative' and told us that someone else had taken our squawk code. Tower seemed very confused as to which company flight was airborne. Tower again told a different [company aircraft] to contact departure; and that crew advised that they were still taxiing to the runway. At that point tower directed us to squawk 1200 and again mentioned that someone had taken our squawk code. At about this time I pointed out to her that we were still flying the runway heading and maintaining 3;000 feet (our takeoff clearance). Tower then told us to contact departure. I immediately switched frequencies and advised departure of our heading and altitude and that we were squawking 1200. They gave us an immediate left turn to the south and a climb to 8;000 feet. They assigned a new squawk code and the rest of the flight was uneventful.it seems to me that somehow the tower controller got the squawk codes for two company flights swapped. Although tower cleared us to takeoff using our correct callsign; tower seemed to have it in her mind that the other company flight was actually airborne.I really can't say what caused our squawk codes to be swapped. The captain and I followed fom procedure perfectly with regards to both of us listening to a voice-issued ATC clearance. We read back the clearance and assigned squawk and received a 'read back correct.' I really don't see any way we could have mistakenly put in an incorrect squawk code that just happened to be exactly the code assigned to another company aircraft on that same ramp on that same night.

Google
 

Original NASA ASRS Text

Title: Air carrier pilot reported confusion resulted when ATC swapped their squawk code with another company flight.

Narrative: After takeoff; tower advised a different [Company Aircraft] to contact departure. Since we knew there were no other Company airplanes airborne in the vicinity; I queried the tower as to whether they intended for us to contact departure instead. Tower replied 'negative' and told us that someone else had taken our squawk code. Tower seemed very confused as to which Company flight was airborne. Tower again told a different [Company Aircraft] to contact departure; and that crew advised that they were still taxiing to the runway. At that point Tower directed us to squawk 1200 and again mentioned that someone had taken our squawk code. At about this time I pointed out to her that we were still flying the runway heading and maintaining 3;000 feet (our takeoff clearance). Tower then told us to contact departure. I immediately switched frequencies and advised departure of our heading and altitude and that we were squawking 1200. They gave us an immediate left turn to the south and a climb to 8;000 feet. They assigned a new squawk code and the rest of the flight was uneventful.It seems to me that somehow the tower controller got the squawk codes for two Company flights swapped. Although Tower cleared us to takeoff using our correct callsign; Tower seemed to have it in her mind that the other Company flight was actually airborne.I really can't say what caused our squawk codes to be swapped. The Captain and I followed FOM procedure perfectly with regards to both of us listening to a voice-issued ATC clearance. We read back the clearance and assigned squawk and received a 'Read back correct.' I really don't see any way we could have mistakenly put in an incorrect squawk code that just happened to be exactly the code assigned to another Company aircraft on that same ramp on that same night.

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.