file i/o - entry points
PARM fileset=./@, entry="main”# This script reads a file produced by LISTFILE,6 and measures CPU msecs# using entry points and script redirectionif "!entry" = "main" then setvar savecpu hpcpumsecs errclear continue listfile !fileset,6 > lftemp if hpcierr = 0 then xeq !hpfile !fileset entry=read <lftemp endif echo ![hpcpumsecs - savecpu] msecs to read !eof records. deletevar cntr,eof,rec purge lftemp;temp return . . . (continued on next slide)
Notes:
- The choices of “entry” for the name of the entry control parameter and “main” for the default value of the entry control parameter value are arbitrary but self-documenting.
- All initialization should be done in the “main” entry portion of the script, rather than earlier in the script. This is more efficient (and perhaps the only correct way) since the initialization code is invoked only once.