You will have to write the whole code
on the style
Code:
dsn.0 = 0
do i = 1 to stmt.0
buff = strip(stmt.i)
if pos("DSN=",buff) = 0 then iterate
start = pos("DSN=",buff) + 4
/* find the end of the dsname */
e1 = pos(" ",buff,start)
if e1 = 0 then e1 = length(buff) + 1
e2 = pos(",",buff,start)
if e2 = 0 then e2 = 9999
e3 = pos("(",buff,start)
if e3 = 0 then e3 = 9999
/* assuming that the statement is correct */
end = min(e1,e2,e3)
j = dsn.0 + 1
dsn.j = substr(buff,start,end-start)
dsn.0 = j
end
do j = 1 to dsn.0
say right(j,2) dsn.j
end