3 Creating Reports
A subprogram can be written using REPORT WRITER statements and accessing the workfile. You run this subprogram from Query with the RUN command. Syntax is as follows:
RUN "subprogram name [ volume spec ]" RETURN
NOTE: If you have used the DATABASE command to change databases, you must first execute one of the following commands before running a subprogram with the RUN command: ADD, FIND or INFO. These commands open the database, ensuring that the subprogram can access it.
For example, assume you want to run the subprogram REPORT which is located in the directory whose volume label is "PROGRAMS". You type the following:
RUN "REPORT, PROGRAMS" RETURN