dms ; ; s er=$$OW^cA710("\\ws-ku-2\c\temp\dms.txt") i er w !,"fout" q s i="" f s i=$o(^DMS(i)) q:i="" s j="" f s j=$o(^DMS(i,j)) q:j="" d . s a=j_$c(9)_$p(^(j,0),D)_$c(9)_$$DP^cAFA1(j)_$c(13,10) . s er=$$WF^cA710("\\ws-ku-2\c\temp\dms.txt",a) i er x "stop" s er=$$CF^cA710("\\ws-ku-2\c\temp\dms.txt")