INCLUDE Command

If you have lengthy defines, or standard heading and footing text, they can be stored separately to simplify maintenance and then incorporated into report requests using the -INCLUDE command.  The -INCLUDE command calls in FOCUS commands at the time the report is executed.

 

The syntax is: -INCLUDE procedure

 

Example 1

The define below creates a new field named EEGROUP for use in the AC file.  Assume the procedure containing the defined field is stored in the common library as 'MYDEFINE'.  Note that only the commands required for beginning and ending the defined field are stored.   Be sure to use ADD with the DEFINE FILE file command, otherwise your own define(s) will override the standard defines.    

 

-* my own define for employee groups (fieldname: EEGROUP)

DEFINE FILE AC ADD

EEGROUP/A10 = IF AC:CBID EQ 'R03' THEN 'FACULTY' ELSE

              IF AC:CBID EQ 'MPP' THEN 'MANAGEMENT' ELSE 'STAFF';

END

 

To use the defined field EEGROUP in a report request (e.g. as a sort field), include the procedure containing the define (-INCLUDE MYDEFINE) after executing the standard defines or the join and before the TABLE FILE command.  The system will search your personal library for a member named MYDEFINE, and if not found will search the common library.  Note:  The procedure MYDEFINE can only be called into requests using the AC file.    

 

-* REPORT REQUEST:  EMPSTATS

EX AC

-INCLUDE MYDEFINE

TABLE FILE AC

COUNT AC:POSITION

BY EEGROUP

end

Example 2

The heading text below can be reused over and over again without change in any report generated for printing.  Assume the footing text is stored in your personal library as 'MYHEADER'.

 

-* MY STANDARD HEADING FOR PRINTED REPORT REQUESTS

HEADING

"CALIFORNIA STATE UNIVERSITY"

" "

 

To use the heading in a report request, include the procedure (-INCLUDE MYHEADER) after the TABLE FILE command.  

 

-* REPORT REQUEST:  EMPSTATS

EX AC

-INCLUDE MYDEFINE

TABLE FILE AC

-INCLUDE myHEADER

COUNT AC:POSITION

BY EEGROUP

end

 

For more information on the -INCLUDE command, refer to your FOCUS documentation.