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​​

  • Where 'procedure' is the name of the member in your personal library or the common library where the commands are stored.  
  • ​The -INCLUDE command can be used anywhere in your report request, as long as it's in a logical order for execution.

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


Last Updated: February 27, 2024