d$! DO VER file {YES or Result_file} $! Get the version of a file, and set SCI_VER == version ,$! $! Write the version to sys$output if {YES} $! and if {Result_file} then write to the result_file X$! $! Thus to get the latest version of a file, e.g. FIL.TYP, $! $! $ DO VER FIL.TYP YES $! L$! 1) The version, 0 if the file doesn't exist, is stored in SCI_VER, $! a global symbol, and thus can be used by a following command. $! 2) Since YES was specified, the version information is output to x$! SYS$OUTPUT. $! 3) If, instead of YES, a Result_file had been specified, then the @$! version information would be output to this Result_file. $! $! ..note.. Creates, deletes: VER.SCI l$! $!-end.of.info- 4$ $ assign/user nl: sys$output $ assign/user nl: sys$error ` $ dir 'p1'/out=VER.SCI $ SCI_VER == 0 ( $ open/read/err=nover ver VER.SCI $ $again: T $ read/err=nxver ver line $ ipos = 'f$locate( ";",line )+1  $ if( ipos.ge.'f$length(line) ) then goto again $ SCI_VER == 'f$extract( ipos,5,line ) $ goto again H $ $nxver: $ close ver t$ delete VER.SCI;* $ <$nover: $ if( p2.eqs."" ) then exit $ if( p2.nes."Y" .and. p2.nes."YES" ) then goto fileout h$ write sys$output "The latest version is ",p1,";",SCI_VER $ exit 0$ $fileout: $ open/write resfil 'p2 $ write resfil "The latest version is ",p1,";",SCI_VER $ close resfil