In the affirmative is wordy for yes. Like many phrases from legal jargon, in the affirmative is useful if you need absolute clarity, but in most contexts the wordiness is unnecessary. In the affirmative could almost always be replaced with affirmatively or simply yes.
In each of these cases, there’s no reason in the affirmative should not be shortened to yes or affirmatively:
The poll asked average Israelis if they support such a program, and 82 percent responded in the affirmative. [Israel Today]
I responded in the affirmative, and the room lit up with a chorus of praise. [CU Columbia Spectator]
These are crucial questions that must be answered in the affirmative. [Forbes]