SET DELETED ON
OPEN DATABASE d:\2021\robno\baze\belcar shared
USE kalkstav ALIAS kalkSTAV shared IN 0 
SELECT kalkstav

OPEN DATABASE d:\2020\robno\baze\belcar shared
USE KALKSTAV ALIAS SKALK shared IN 0

SELECT kalkstav
GOTO top
DO WHILE !EOF()
if ALLTRIM(kalkstav.brdok)<>"PS"
	SKIP
	LOOP
ENDIF
a1=kalkstav.sifrob
SELECT SKALK
SET ORDER TO tag SIFROB1
GOTO top
SEEK a1
IF FOUND()
	SELECT kalkstav
	replace kalkstav.ncena WITH SKALK.NCENA
	REPLACE KALKSTAV.DOBCEN WITH SKALK.NCENA
ENDIF
SELECT kalkstav
SKIP
ENDDO
RETURN