Following a suggestion from John Penney, here is a vastly improved CI only script modified for more than one instance of "whatever" in the input file: setvar keyval,"whatever" file x=input file file y=$newpass ;rec=-80,,f,ascii ;nocctl ;msg run fcopy.pub.sys ;info='from=*x ;to=*y ;subset="!keyval",1' reset x file y=$oldpass while finfo("*y","eof") > 0 input tgtval<*y setvar tgtval,rht(tgtval,-len(keyval)-1) showvar tgtval comment Process tgtval, here... endwhile reset y HTH Campbell Fethers * To join/leave the list, search archives, change list settings, * * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *