cat > data <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
-50495
43297
-34303
-52383
-64703
8097
42625
64993
-19519
-8671
-1279
-44959
-13247
25761
-2175
43745
-13119
13089
-58367
-29343
13633
-13919
-6015
30689
-31295
-22495
56577
-5535
15937
20129
31105
25825
57025
15649
-49663
26465
-6335
-3167
-21887
29153
-10303
-3551
16129
-64415
-53183
47265
-33919
40673
28865
50977
-8191
-16031
6465
40353
-4991
60385
43457
48161
8449
40545
41537
-23903
64897
-42783
33473
-11999
-65023
-25759
52033
-14431
44673
-6687
-1087
1569
33537
47201
37953
-62303
65409
37601
-60223
-42207
41985
-2719
-703
-36447
-3967
-40991
-12863
-12255
-39679
-44447
-63935
63137
-32383
19681
9921
-39647
50689
53089
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 data
cat > script <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
create t set a longinteger, b char(1024,1);
insert into t set a from data;
select a from t;
select a,b from t order by a, b;
set MSSORTSPACE 2048;
select b width 2 ,a from t order by a, b;
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 script
cat > stdout <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* create t set a longinteger, b char(1024,1);
* insert into t set a from data;

Number of records entered = 100
* select a from t;
          a

     -50495
      43297
     -34303
     -52383
     -64703
       8097
      42625
      64993
     -19519
      -8671
      -1279
     -44959
     -13247
      25761
      -2175
      43745
     -13119
      13089
     -58367
     -29343
      13633
     -13919
      -6015
      30689
     -31295
     -22495
      56577
      -5535
      15937
      20129
      31105
      25825
      57025
      15649
     -49663
      26465
      -6335
      -3167
     -21887
      29153
     -10303
      -3551
      16129
     -64415
     -53183
      47265
     -33919
      40673
      28865
      50977
      -8191
     -16031
       6465
      40353
      -4991
      60385
      43457
      48161
       8449
      40545
      41537
     -23903
      64897
     -42783
      33473
     -11999
     -65023
     -25759
      52033
     -14431
      44673
      -6687
      -1087
       1569
      33537
      47201
      37953
     -62303
      65409
      37601
     -60223
     -42207
      41985
      -2719
       -703
     -36447
      -3967
     -40991
     -12863
     -12255
     -39679
     -44447
     -63935
      63137
     -32383
      19681
       9921
     -39647
      50689
      53089
* select a,b from t order by a, b;
          a  b

     -65023
     -64703
     -64415
     -63935
     -62303
     -60223
     -58367
     -53183
     -52383
     -50495
     -49663
     -44959
     -44447
     -42783
     -42207
     -40991
     -39679
     -39647
     -36447
     -34303
     -33919
     -32383
     -31295
     -29343
     -25759
     -23903
     -22495
     -21887
     -19519
     -16031
     -14431
     -13919
     -13247
     -13119
     -12863
     -12255
     -11999
     -10303
      -8671
      -8191
      -6687
      -6335
      -6015
      -5535
      -4991
      -3967
      -3551
      -3167
      -2719
      -2175
      -1279
      -1087
       -703
       1569
       6465
       8097
       8449
       9921
      13089
      13633
      15649
      15937
      16129
      19681
      20129
      25761
      25825
      26465
      28865
      29153
      30689
      31105
      33473
      33537
      37601
      37953
      40353
      40545
      40673
      41537
      41985
      42625
      43297
      43457
      43745
      44673
      47201
      47265
      48161
      50689
      50977
      52033
      53089
      56577
      57025
      60385
      63137
      64897
      64993
      65409
* set MSSORTSPACE 2048;
* select b width 2 ,a from t order by a, b;
b             a

         -65023
         -64703
         -64415
         -63935
         -62303
         -60223
         -58367
         -53183
         -52383
         -50495
         -49663
         -44959
         -44447
         -42783
         -42207
         -40991
         -39679
         -39647
         -36447
         -34303
         -33919
         -32383
         -31295
         -29343
         -25759
         -23903
         -22495
         -21887
         -19519
         -16031
         -14431
         -13919
         -13247
         -13119
         -12863
         -12255
         -11999
         -10303
          -8671
          -8191
          -6687
          -6335
          -6015
          -5535
          -4991
          -3967
          -3551
          -3167
          -2719
          -2175
          -1279
          -1087
           -703
           1569
           6465
           8097
           8449
           9921
          13089
          13633
          15649
          15937
          16129
          19681
          20129
          25761
          25825
          26465
          28865
          29153
          30689
          31105
          33473
          33537
          37601
          37953
          40353
          40545
          40673
          41537
          41985
          42625
          43297
          43457
          43745
          44673
          47201
          47265
          48161
          50689
          50977
          52033
          53089
          56577
          57025
          60385
          63137
          64897
          64993
          65409
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout
cat > stdout.jp_euc <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
* create t set a longinteger, b char(1024,1);
* insert into t set a from data;

ϥ쥳ɿ = 100
* select a from t;
          a

     -50495
      43297
     -34303
     -52383
     -64703
       8097
      42625
      64993
     -19519
      -8671
      -1279
     -44959
     -13247
      25761
      -2175
      43745
     -13119
      13089
     -58367
     -29343
      13633
     -13919
      -6015
      30689
     -31295
     -22495
      56577
      -5535
      15937
      20129
      31105
      25825
      57025
      15649
     -49663
      26465
      -6335
      -3167
     -21887
      29153
     -10303
      -3551
      16129
     -64415
     -53183
      47265
     -33919
      40673
      28865
      50977
      -8191
     -16031
       6465
      40353
      -4991
      60385
      43457
      48161
       8449
      40545
      41537
     -23903
      64897
     -42783
      33473
     -11999
     -65023
     -25759
      52033
     -14431
      44673
      -6687
      -1087
       1569
      33537
      47201
      37953
     -62303
      65409
      37601
     -60223
     -42207
      41985
      -2719
       -703
     -36447
      -3967
     -40991
     -12863
     -12255
     -39679
     -44447
     -63935
      63137
     -32383
      19681
       9921
     -39647
      50689
      53089
* select a,b from t order by a, b;
          a  b

     -65023
     -64703
     -64415
     -63935
     -62303
     -60223
     -58367
     -53183
     -52383
     -50495
     -49663
     -44959
     -44447
     -42783
     -42207
     -40991
     -39679
     -39647
     -36447
     -34303
     -33919
     -32383
     -31295
     -29343
     -25759
     -23903
     -22495
     -21887
     -19519
     -16031
     -14431
     -13919
     -13247
     -13119
     -12863
     -12255
     -11999
     -10303
      -8671
      -8191
      -6687
      -6335
      -6015
      -5535
      -4991
      -3967
      -3551
      -3167
      -2719
      -2175
      -1279
      -1087
       -703
       1569
       6465
       8097
       8449
       9921
      13089
      13633
      15649
      15937
      16129
      19681
      20129
      25761
      25825
      26465
      28865
      29153
      30689
      31105
      33473
      33537
      37601
      37953
      40353
      40545
      40673
      41537
      41985
      42625
      43297
      43457
      43745
      44673
      47201
      47265
      48161
      50689
      50977
      52033
      53089
      56577
      57025
      60385
      63137
      64897
      64993
      65409
* set MSSORTSPACE 2048;
* select b width 2 ,a from t order by a, b;
b             a

         -65023
         -64703
         -64415
         -63935
         -62303
         -60223
         -58367
         -53183
         -52383
         -50495
         -49663
         -44959
         -44447
         -42783
         -42207
         -40991
         -39679
         -39647
         -36447
         -34303
         -33919
         -32383
         -31295
         -29343
         -25759
         -23903
         -22495
         -21887
         -19519
         -16031
         -14431
         -13919
         -13247
         -13119
         -12863
         -12255
         -11999
         -10303
          -8671
          -8191
          -6687
          -6335
          -6015
          -5535
          -4991
          -3967
          -3551
          -3167
          -2719
          -2175
          -1279
          -1087
           -703
           1569
           6465
           8097
           8449
           9921
          13089
          13633
          15649
          15937
          16129
          19681
          20129
          25761
          25825
          26465
          28865
          29153
          30689
          31105
          33473
          33537
          37601
          37953
          40353
          40545
          40673
          41537
          41985
          42625
          43297
          43457
          43745
          44673
          47201
          47265
          48161
          50689
          50977
          52033
          53089
          56577
          57025
          60385
          63137
          64897
          64993
          65409
* 
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 stdout.jp_euc
cat > tag <<'+-+-+-+-+-END-OF-FILE-+-+-+-+-+'
Test sorting; including explicit test for external sort/merge.
+-+-+-+-+-END-OF-FILE-+-+-+-+-+
chmod 644 tag
