Easytrieve Quick Guide

This quick guide walks you from zero to a working batch report—the same shape Broadcom uses in Day 1 checklist examples: FILE personnel layout, JOB INPUT read loop, IF filter by department, PRINT to a named report, REPORT with TITLE and LINE. Each step explains what you type, why it belongs in Library versus Activity, and what happens at compile and runtime. Follow the steps in order on your test LPAR; adapt file names and field positions to your shop's data dictionary. When you finish, you will understand the skeleton that hundreds of production Easytrieve programs share, and you will know which tutorial pages to open next for SORT, subtotals, and macros.

Progress0 of 0 lessons

Before You Start

Gather four facts from your data owner or copybook: record length (LRECL), record format (FB or VB), field names, and starting byte positions with lengths and types. Confirm the Easytrieve compiler is available on your LPAR—STEPLIB points to product load libraries—and you have a test PDS member for source. You do not need COBOL knowledge; you do need patience to align field positions exactly—one-byte errors shift every column right of the mistake.

Prerequisites checklist
ItemAction
Input file nameMatch FILE name to JCL DD name (e.g. PERSNL)
Record layoutDocument start, length, type for each field
Test dataSmall file with known records including filter case
Compile accessJCL proc or TSO command with SYSPRINT

Step 1 — Declare the FILE

In the Library section, FILE names the logical file and its organization. FB(150 1800) means fixed blocked records of 150 bytes with block size 1800—typical for many shop standards. Each field line gives name, start position (1-based in Easytrieve), length, type A/N/P, and packed decimals if P. This block is declarative: no records move yet; you are drawing a map.

text
1
2
3
4
5
FILE PERSNL FB(150 1800) EMPNAME 17 8 A EMP-NBR 9 5 N DEPT 98 3 N GROSS 94 4 P 2

EMPNAME starts at byte 17 for 8 characters alphanumeric. DEPT at 98 for 3 numeric digits is your filter key. GROSS is packed decimal with two decimal places—common for salary amounts. Verify positions against a hex dump or copybook if output looks wrong.

Step 2 — Define the REPORT Layout

Still in Library, REPORT names the printed layout PAY-RPT. LINESIZE 80 fits standard printer lines. TITLE 01 sets the first title line—often includes report name; date and page may be automatic depending on options. LINE 01 lists columns for one detail row. The report writer aligns fields when PRINT runs.

text
1
2
3
REPORT PAY-RPT LINESIZE 80 TITLE 01 'PERSONNEL REPORT EXAMPLE-1' LINE 01 DEPT EMPNAME EMP-NBR GROSS

Step 3 — JOB INPUT and Filter

Activity section starts with JOB INPUT PERSNL. Easytrieve opens PERSNL, reads each record, runs statements inside the job for that record, repeats until EOF. IF DEPT EQ 911 keeps only department 911 employees for the PRINT below. END-IF closes the condition. Without IF, every record prints.

text
1
2
3
4
JOB INPUT PERSNL IF DEPT EQ 911 PRINT PAY-RPT END-IF

Step 4 — Complete Program and STOP

Add STOP at end of activities for explicit termination—many programs rely on implicit end after JOB completes. Full minimal program combines Library and Activity. Optional PARM LIST FILE at top requests listing and file diagnostics during development compile.

text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PARM LIST FILE FILE PERSNL FB(150 1800) EMPNAME 17 8 A EMP-NBR 9 5 N DEPT 98 3 N GROSS 94 4 P 2 JOB INPUT PERSNL IF DEPT EQ 911 PRINT PAY-RPT END-IF REPORT PAY-RPT LINESIZE 80 TITLE 01 'PERSONNEL REPORT EXAMPLE-1' LINE 01 DEPT EMPNAME EMP-NBR GROSS STOP

Broadcom samples sometimes place REPORT before JOB; both orders compile when Library rules are met—keep REPORT definitions together for readability. Your site standard may require REPORT immediately after FILE.

Step 5 — JCL Outline

JCL allocates datasets and invokes Easytrieve runtime. STEPLIB includes product libraries. SYSIN points to your source member. PERSNL DD points to input file. SYSPRINT captures listing and runtime messages. REGION=0M is common on current releases for large programs.

text
1
2
3
4
5
6
//QUICK JOB ... //STEP1 EXEC PGM=EZTPA00,REGION=0M //STEPLIB DD DSN=PROD.EZT1106.SLOAD,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSIN DD DSN=DEV.EZT.SOURCE(QUICKRPT),DISP=SHR //PERSNL DD DSN=DEV.PERSNL.TEST,DISP=SHR

Step 6 — Compile, Run, Verify

  1. Submit job or compile step; open SYSPRINT.
  2. Fix syntax errors—line numbers reference source.
  3. Run with test data; locate spool report output.
  4. Verify only DEPT 911 rows appear with correct names and GROSS.
  5. Compare field alignment—if columns shift, recheck FILE positions.
  6. Remove DEBUG PARM before promoting to production proc.

Expected Report Output

Broadcom filtered report sample shows dated header, page number, column headings, and detail lines for department 911 employees. Titles and spacing come from report writer defaults plus your TITLE and LINE definitions. Totals are not in minimal sample—add CONTROL and accumulators in next learning step.

Common First-Program Mistakes

  • FILE start positions off by one—compare to copybook.
  • PRINT name not matching REPORT name.
  • DD name in JCL not matching FILE name.
  • Missing END-IF after IF block.
  • Packed field without decimal clause when dollars expected.
  • Using production file before testing filter logic.

Next Steps After Quick Guide

Learning path
TopicWhy next
Control breaksSubtotals by department with CONTROL on REPORT
DEFINE totalsAccumulate GROSS across records
SORTOrder output before report when input unsorted
FILE macrosReuse PERSNL layout across programs
Compile processPromote link-edit load modules correctly

Explain It Like I'm Five

You tell the computer what is in each row of the file (FILE), how the printed page should look (REPORT), then say read every row (JOB INPUT), only keep kids in room 911 (IF), and print a line for each (PRINT). JCL is how you plug the file and program into the big computer. SYSPRINT is the note from the teacher saying if you made a spelling mistake.

Exercises

  1. Type the full sample and change filter to another department.
  2. Add a second field to LINE and observe column spacing.
  3. Remove IF temporarily—count rows printed versus filtered run.
  4. Sketch JCL DD names matching each FILE in your program.
  5. List three differences between Library and Activity statements in your sample.

Quiz

Test Your Knowledge

1. The first step in a batch Easytrieve report is usually:

  • Define FILE and field layout
  • Write STOP only
  • Create CICS map
  • Link-edit load module

2. JOB INPUT PERSNL means:

  • Read PERSNL file records in automatic loop
  • Print only
  • Sort PERSNL to tape
  • Delete PERSNL

3. PRINT PAY-RPT requires:

  • A REPORT block named PAY-RPT defined in Library
  • Only JCL
  • A SCREEN activity
  • No FILE statement

4. IF DEPT EQ 911 filters:

  • Records where department field equals 911
  • All records always
  • Only titles
  • Compiler options

5. After editing source, beginners should:

  • Compile and read SYSPRINT for errors before production
  • Schedule immediately
  • Skip listing
  • Delete source
Published
Read time18 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve 11.6 Day 1 filtered report workflowSources: Broadcom Easytrieve 11.6 Getting Started generate filtered reportsApplies to: Easytrieve beginner quick start batch report