/* Sample program #1 for Project Rosetta Stone
Coded by Barry L. Wolman on 9 December 1972 */
bsort: procedure(a,b,n);
dcl (a,b) dimension(*) fixed binary,
n fixed binary;
dcl (m,i,t) fixed binary,
c bit(1);
m = n;
do i = 1 to n;
b(i) = a(i);
end;
loop: c = "0"b;
m = m - 1;
do i = 1 to m;
if b(i) > b(i+1)
then do;
c = "1"b;
t = b(i);
b(i) = b(i+1);
b(i+1) = t;
end;
end;
if c then goto loop;
end;