这是典型的自上而下扫描一个dataset中每一行,而做相应处理的Rexx脚本,几乎所有的处理文件I/O的Rexx脚本都会涉及到:
ADDRESS TSO
indataset = 'IBMUSER.REXX.EXEC(INFILE)' /*read in input file */
"alloc f(fin) ds('"indataset"') shr reuse"
"execio * diskr fin (finis stem in."
"free f(fin)"
do i=1 to in.0 /*loop in file until the last line reached */
one_line = strip(in.i)
call Do_Something
end
EXIT 0
Do_Something:
...
Comments !