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.
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.
| Item | Action |
|---|---|
| Input file name | Match FILE name to JCL DD name (e.g. PERSNL) |
| Record layout | Document start, length, type for each field |
| Test data | Small file with known records including filter case |
| Compile access | JCL proc or TSO command with SYSPRINT |
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.
12345FILE 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.
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.
123REPORT PAY-RPT LINESIZE 80 TITLE 01 'PERSONNEL REPORT EXAMPLE-1' LINE 01 DEPT EMPNAME EMP-NBR GROSS
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.
1234JOB INPUT PERSNL IF DEPT EQ 911 PRINT PAY-RPT END-IF
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.
123456789101112131415161718PARM 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.
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.
123456//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
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.
| Topic | Why next |
|---|---|
| Control breaks | Subtotals by department with CONTROL on REPORT |
| DEFINE totals | Accumulate GROSS across records |
| SORT | Order output before report when input unsorted |
| FILE macros | Reuse PERSNL layout across programs |
| Compile process | Promote link-edit load modules correctly |
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.
1. The first step in a batch Easytrieve report is usually:
2. JOB INPUT PERSNL means:
3. PRINT PAY-RPT requires:
4. IF DEPT EQ 911 filters:
5. After editing source, beginners should: