Self-describing numbers

You are encouraged to solve this task according to the task description, using any language you may know.
There are several so-called "self-describing" or "self-descriptive" integers.

An integer is said to be "self-describing" if it has the property that, when digit positions are labeled 0 to N-1, the digit in each position is equal to the number of times that that digit appears in the number.

For example,   2020   is a four-digit self describing number:

   position   0   has value   2   and there are two 0s in the number;
   position   1   has value   0   and there are no 1s in the number;
   position   2   has value   2   and there are two 2s;
   position   3   has value   0   and there are zero 3s.


Self-describing numbers < 100.000.000  are:     1210,   2020,   21200,   3211000,   42101000.



Task Description
 Write a function/routine/method/... that will check whether a given positive integer is self-describing.
 As an optional stretch goal - generate and display the set of self-describing numbers.


Related tasks

   Fours is the number of letters in the ...
   Look-and-say sequence
   Number names
   Self-referential sequence
   Spelling of ordinal numbers


$ include "seed7_05.s7i";
 
const func boolean: selfDescr (in string: stri) is func
  result
    var boolean: check is TRUE;
  local
    var integer: idx is 0;
    var array integer: count is [0 .. 9] times 0;
  begin
    for idx range 1 to length(stri) do
      incr(count[ord(stri[idx]) - ord('0')]);
    end for;
    idx := 1;
    while check and idx <= length(stri) do
      check := count[pred(idx)] = ord(stri[idx]) - ord('0');
      incr(idx);
    end while;
  end func;
 
const proc: gen (in integer: n) is func
  local
    var array integer : digits is 0 times 0;
    var string: stri is "";
    var integer: numberOfOneDigits is 0;
    var integer: idx is 0;
  begin
    while numberOfOneDigits <= 2 and numberOfOneDigits < n - 2 do
      digits := n times 0;
      digits[1] := n - 2 - numberOfOneDigits;
      if digits[1] <> 2 then
        digits[digits[1] + 1] := 1;
        digits[2] := 2;
        digits[3] := 1;
      else
        digits[2] := ord(numberOfOneDigits <> 0);
        digits[3] := 2;
      end if;
      stri := "";
      for idx range 1 to n do
        stri &:= chr(ord(digits[idx]) + ord('0'));
      end for;
      if selfDescr(stri) then
        writeln(stri);
      end if;
      incr(numberOfOneDigits);
    end while;
  end func;
 
const proc: main is func
  local
    const array integer: nums is [] (1210, 1337, 2020, 21200, 3211000, 42101000);
    var integer: number is 0;
  begin
    for number range nums do
      write(number <& " is ");
      if not selfDescr(str(number)) then
        write("not ");
      end if;
      writeln("self describing");
    end for;
    writeln;
    writeln("All autobiograph numbers:");
    for number range 1 to 10 do
      gen(number);
    end for;
  end func;