Nest to any depth:
You can nest qfiles to any depth, as long as the qfiles are not recursively called. If QFILE-1 calls QFILE-2, then within the same nest of qfiles, QFILE-2 cannot call QFILE-1.
Each nested qfile is invoked in turn until the last qfile call is encountered:
select * from department, employee qfile format-report save report dept-employee
At the QFILE FORMAT-REPORT command, the qfile named FORMAT-REPORT begins to execute:
sort on dept-id-0410 in ascending order - and on emp-id-0415 in ascending order compute name-max=max(emp-name-0415) group by dept-id-0410
When the called qfile (FORMAT-REPORT) finishes executing, control is returned to the first qfile at the next command statement:
save report dept-employee
Parameters across qfiles:
You can use parameters across nested qfiles. If you define a parameter in the first qfile, and use the same parameter in the second qfile, the definition stays the same unless you redefine the parameter in the second qfile.
If you do redefine the parameter in the second qfile, the parameter is automatically returned to its first definition when control is returned to the first qfile.
|
Copyright © 2013 CA.
All rights reserved.
|
|