If it doesn't have to be exatly 50/50 then you could use ranuni() in the way:
if a=1 then
if ranuni()>0.5 then a=2;
If it has to be exactly 50/50 but doesn't have to be random then you just could count the total number of obs where A=1 in a first pass through the data and then in a second pass set half of these obs where A=1 to A=2.
If it has to be exactly 50/50 but random which record is set to A=2 then it's getting a bit harder.
You would still have to count the total number of obs where A=1 in a first pass through the data but then use a more sophisticated way for assigning 50% of obs where A=1 with A=2.
The approach I have in mind is mainly the same like picking a random sample (only that instead of writing the data to an sample data set you would assign the value 2 to A). This is the link to the code of how to pick the values together with some explanations: http://groups.google.com/group/comp.soft-sys.sas/browse_thread/thread/231bef19aaf0f2b1/fdabf8498967b...