d$! DO SOME {Function {File_spec {Trailer {Comfirm}}}} $! Executes the same command on files of a given type. ,$! $! The procedure prompts for missing items $! if any item is more than 1 word, it must be entered via a pompt X$! $! Function? The command to be issued. $! File_spc? The specification, to DIR of the files. $! Func_end? The rest of the command, after the file name. $! NO == no trailer L$! Confirm_? If the Command is to run without a response or is to $! wait each time for a Yes to proceed. $! NO == no confirm, no command print x$! NOT == No confirm, Command printout $! @$! after answering, the command does the directory, issues the command $! as specified. If there are errors, the user can either Proceed or $! terminate the cycle. l$! $! note.. This creates and deletes SOMETEMP.VX 4$! $!-end.of.info- $ ` $ if(p1.eqs."") then inquire p1 "Funct" $ if( p1.eqs."" ) then EXIT ( $ $ if(p2.eqs."") then inquire p2 'p1'" Files" $ if('f$locate("SCI_",p2).ne.'f$length(p2) ) then goto getsci T $gotsci: $ dd := ""  $ dp = 'f$locate("]",p2)+1 $ if( dp.lt.'f$length(p2) ) then dd := 'f$extract(0,dp,p2) $ H $ if(p3.eqs."") then inquire p3 'p1'" "'p2'" Trail" $ if( p3.eqs."NO" ) then p3 := "" $ if(p4.eqs."") then inquire p4 'p1'" "'p2'" "'p3' " Conf" t$ $ dir/brief/out=SOMETEMP.VX 'p2 <$ open/read SOME SOMETEMP.VX $ on error then goto err $ on control then goto err h$ $nxtfil: 0$ read/err=endfil SOME filename $ filename := 'f$extract(2,100,filename) $ if( 'f$locate(";",filename).eq.'f$length(filename) ) then goto nxtfil \$ if( p4 ) then goto inqfil $ if( p4.nes."NO" ) then write sys$output "$ ",p1," ",filename," ",p3 $$ goto doit $ $inqfil: P$ inquire ok "$ "'p1' 'filename' 'p3'" " $ if( ok.eqs."" ) then goto doit $ if( .not.ok ) then goto nxtfil |$ $doit: D$ if( "''f$extract(0,1,p1)'".nes."@" ) then assign/user tt: sys$input $ 'p1 'dd''filename' 'p3 $ goto nxtfil p$ $err: 8$ on error then goto err $ on control then goto endfil $ inquire cnt "Stop" d$ on control then goto err $ if( .not. cnt ) then goto nxtfil ,$ $endfil: $ close SOME X$ delete SOMETEMP.VX;* $ exit $ $getsci: $ temp := 'f$extract(0,7,p2) L$ p2 := 'f$logical(temp)''f$extract(8,100,p2) $ goto gotsci