       d = open("plan")
       getfirst(d)
       for i = 1 to size(d)
          if trim('Расчеты'.d) != "РС" & trim('Расчеты'.d) != "рс" then goto 900
          dbfname = trim('Номер'.d) + ".btr"
          system("del z.btr")
          system("del z.str")
          comm = "rename " + dbfname  + " Z.BTR"
          system(comm)
          comm = "rename " + trim('Номер'.d) + ".str"  + " Z.STR"
          system(comm)
          comm = "copy " + "rasch.btr " + dbfname
          system(comm)
          comm = "copy " + "rasch.str " + trim('Номер'.d) + ".str"
          system(comm)
          dz = open("z")
          da = open(trim('Номер'.d))
          for j = 1 to size(dz)
             if j = 1 then goto 100
             getnext(dz)
             goto 200
100          getfirst(dz)
200          clearbuf(da)
             'Субсчет'.da = 'Субсчет'.dz
             'Название'.da = 'Название'.dz
             'DbS_начало'.da = 'DbS_начало'.dz
             'KrS_начало'.da = 'KrS_начало'.dz
             'Db_оборот'.da = 'Db_оборот'.dz
             'Kr_оборот'.da = 'Kr_оборот'.dz
             'DbS_конец'.da = 'DbS_конец'.dz
             'KrS_конец'.da = 'KrS_конец'.dz
             insert(da)
          next
          close(da)
          close(dz)
900       getnext(d)
       next
       close(d)
       end