How to write an Earl Service Report: A sample
search cancel

How to write an Earl Service Report: A sample

book

Article ID: 36941

calendar_today

Updated On:

Products

Earl

Issue/Introduction

Earl is a powerful report writing tool, capable of producing complex reports. Many Broadcom mainframe products distribute tailored Earl Service report request samples.

This Knowledge Base article provides instructions on creating an EARL report

 

 

Resolution

Earl report request contains at most 6 sections, but only 3 sections are required: 

  •  File Definitions Section
  •  Report Section
  •  End statement.

This article look at these 3 sections. 

The other 3 optional sections are:  the Options Section, the GSA Area Definitions Section, and the Presort Section.

Sample Earl report: 

NOTE ==============================================================
NOTE    This is the FILE DEFINITIONS section - the file and fields
NOTE      to be used are identified here
NOTE ==============================================================
AIRPORTS:  FILE EARLGET RECORD=48
DEF A_NAME       1-18  X    'NAME OF' 'AIRPORT'
DEF A_CITY      20-35  X    'CITY'
DEF A_COUNTRY   37-39  X    'COUNTRY' 'ABBREVIATION'
DEF A_PASS      41-48  N    'NUMBER OF' 'PASSENGERS'
PIC 'ZZ,ZZZ,ZZ9'
NOTE ==============================================================
NOTE    This is the REPORT SECTION - one or more reports may be
NOTE      defined here
NOTE ==============================================================
REPORT 'World''s 50 Busiest Airports, 1998'     ! report title
PRINT  A_NAME  A_CITY  A_COUNTRY  A_PASS     ! print line contents
! =================================================================
!    This is the required END statement
! =================================================================
END !

Earl has many control statements and syntax options.  The following 5 statements are required in every report:

  1. FILE - Identifies the file exit or module to be accessed by the request.
  2. DEFINE - Assigns a name to a field or variable to be used in the request.
  3. REPORT - Identifies each report within a request, and optionally specifies the report headers and footers.
  4. PRINT - Specifies the fields to be included on each line of the report and the order in which the fields will appear on each line of the report. Optionally, may specify accumulations to be performed, whether the report is to be a Detail or a Summary report, and a global spacing value to be used for the entire report.
  5. END - Identifies the end of the Earl Service request, and must be the last statement of the request.

Using only these 5 statements and the standard Earl Service EARLGET user module (which is provided in the Common Services product and contains AIRPORTS file data), a basic Earl Service report request can be created as shown above.

Earl Service source statements are free-form, and normally only columns 1 through 72 are used.  A command may begin in any column, and a single source line may contain multiple commands.  A single source statement may be coded on multiple source lines, but command words, field names, numeric constants and alphanumeric literals cannot spill from one line to the next.

Comments are optional and may be added anywhere in an  Earl Service request. The entire line will be treated as a comment if the first word in the line is NOTE or an exclamation point (!).   A comment may be added to another Earl Service statement by following the command with the word NOTE or an exclamation point (!).  Comments are never continued; the end of the source line is the end of the comment statement.

Additional Information