Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
sort:
proc options(main);
dcl
(input_file, output_file) file;
open file (input_file) stream title ('b:x.lib');
open file (output_file) stream output title ('b:y.lib');
dcl
b char (64) var,
i fixed,
switching bit,
buff (250) char (64) var,
bp fixed;
on endfile(input_file)
go to sort_buff;
bp = 0;
do while ('1'b);
get file(input_file) edit(buff(bp+1))(a);
bp = bp + 1;
end;
sort_buff:
switching = '1'b;
do while (switching);
switching = '0'b;
do i = 1 to bp - 1;
if (buff(i) < buff(i + 1)) then
do;
switching = '1'b;
b = buff(i);
buff(i) = buff(i+1);
buff(i+1) = b;
end;
end;
end;
do i = 1 to bp;
put file(output_file) edit(buff(i),'')(a,skip,a);
end;
end sort;