Easytrieve Intermediate Interview Questions

Intermediate panels assume you have maintained real batch jobs—not just passed a fundamentals course. Interviewers ask about VSAM keyed access, when to SORT, how control breaks accumulate subtotals, how macros differ from PROC, and how you handle bad records without corrupting month-end totals. You may whiteboard a multi-file JOB or explain why a report subtotal does not tie. This page provides model answers at that depth, with code snippets and comparison tables interviewers expect mid-level candidates to discuss confidently. Adapt answers with examples from your resume: a reconciliation report, an inbound feed validation, or a store rollup with break levels.

Progress0 of 0 lessons

File Processing and VSAM

How does Easytrieve process VSAM KSDS files?

FILE definition specifies organization and access: sequential pass versus keyed READ using a key field. KSDS stores records by key; random READ retrieves one record; sequential pass reads in key order when the file is opened sequentially. Wrong key field length causes wrong record or status errors. Intermediate answer: verify key position matches IDCAMS DEFINE, handle invalid key or end conditions per site standards, and mention alternate index only if you have used PATH definitions.

Sequential versus indexed FILE—when use each?

Sequential QSAM or VSAM sequential pass fits full-file scans—nightly extracts, bulk transform. Keyed access fits random lookup of master records during JOB INPUT when each transaction carries a key. Mixing them wrong doubles I/O: reading entire KSDS sequentially when you only need ten keys wastes window time. Interviewers want tradeoff awareness, not dogma.

File access comparison (interview flash card)
AccessBest forCommon pitfall
Sequential JOB INPUTFull file scan, extractsProcessing unsorted data before break report
Keyed READMaster lookup by IDKey length or type mismatch
VIRTUAL scratchMulti-pass without permanent DSNVFM space exhaustion
GDG input (+1)Daily incremental feedsWrong generation referenced in JCL

SORT and Record Order

When do you SORT inside Easytrieve versus in JCL?

SORT activity or SORT statement orders records before REPORT or WRITE when keys are wrong. External DFSORT step makes sense when many downstream jobs consume the same ordered file or when sort keys are complex merges. Internal sort adds CPU and WORK space inside the Easytrieve step—acceptable for single-consumer jobs. Intermediate answer: presort once when chain has three report programs reading the same extract; sort inside when only one program needs order and extract layout cannot change.

What are duplicate keys in SORT?

DUP handling determines whether duplicate sort keys appear once or multiple times in output order. Finance reports often need all duplicates; summary jobs may collapse. Know your site default and how it affects control-break subtotals. Misconfigured DUP causes missing rows or double-counted totals—classic reconcile failure interview scenario.

Control Breaks and Reporting

Explain BREAK-LEVEL and AFTER-BREAK.

BREAK-LEVEL declares fields that trigger control groups—store, then department. AFTER-BREAK procedure runs when a break occurs at that level: print subtotal, reset accumulators for the next group. BEFORE-BREAK may initialize line counters or headings. Order of break levels must match sort order of input. Strong answer: input sorted by STORE-NUM then DEPT; BREAK-LEVEL 1 STORE, 2 DEPT; accumulators reset in BEFORE-BREAK at dept level and roll up to store in AFTER-BREAK.

text
1
2
3
4
5
6
7
REPORT SALES-RPT BREAK-LEVEL STORE-NUM BREAK-LEVEL DEPT-CODE AFTER-BREAK. PROC PRINT SUBTOTAL-LINE END-PROC

Why do report totals sometimes not tie?

Common causes: unsorted input for breaks, arithmetic on wrong field types, duplicate records after sort, reset logic clearing accumulators too early, or mixing net and gross amounts. Intermediate candidates describe a debug approach: SYSPRINT control counts, small test file, trace accumulators in AFTER-BREAK with limited DISPLAY, compare to SQL or spreadsheet subtotals.

Macros

How is a macro different from PERFORM?

Macro expands source at compile time via %MACRONAME; PROC runs at execution via PERFORM. Macros share FILE layouts across programs; PROC shares runtime logic within one program (per activity scope). Interview trap: saying macros run faster at runtime—they do not execute; they generate code before compile.

What happens when a shared macro changes?

Callers must recompile to pick up new expansion. Layout change without regression compile causes offset bugs. Intermediate answer mentions change control, regression list of invoking programs, and comparing LIST output before promote—shows enterprise awareness.

Table LOOKUP and Reference Data

How do you implement code table lookup?

Load table at job start into array (DEFINE table with OCCURS) from sequential reference file, or use LOOKUP / binary search on sorted table depending on release syntax. Map transaction code to description or rate. Discuss memory limits for huge tables versus keyed VSAM read per record tradeoff. Mid-level answer quantifies: ten thousand rows in memory OK; ten million needs different design.

SCREEN Activities (Intermediate)

What is the SCREEN activity flow?

INITIATION once at start; each iteration BEFORE-SCREEN prepares map data; product sends screen; AFTER-SCREEN processes input; TERMINATION at end. BEFORE-SCREEN often GETs master record; AFTER-SCREEN validates and may GOTO SCREEN to redisplay. Invalid: GOTO SCREEN in BEFORE-SCREEN per Broadcom restrictions.

What is RESET on DEFINE in screen programs?

Fields with RESET reinitialize before BEFORE-SCREEN each cycle. Design flags carefully so AFTER-SCREEN state is not accidentally cleared. Common bug in maintenance interviews.

Error Handling

How should invalid records be handled in a feed job?

Validate, increment error counter, write exception record with reason code, continue or stop based on threshold. Silent skip fails audit. Intermediate answer references validation framework pattern: PERFORM VALIDATE, branch to LOG-EXcep, SYSPRINT summary at end.

Intermediate Flash Table

High-frequency intermediate prompts
QuestionStrong short answer
BUFNO purpose?Sequential buffer count; tune hot files only after measure.
WORK file in report?Temporary space for report writer processing; watch size on big breaks.
CALL versus PERFORM?CALL external load module; PERFORM internal PROC in activity.
LOOKUP versus READ loop?LOOKUP searches table; READ loop loads or scans file.
END-IF required?Yes for structured IF blocks; match IF/END-IF nesting.
TITLE versus LINE?TITLE headings; LINE detail or summary print columns.

Explain It Like I'm Five

Intermediate questions are like sorting trading cards by team, then team by player, and saying the team score after each team pile—if you mix the order, the scores lie. You also know when to use a stamp (macro) to print the same card back design on every pack versus when to shuffle cards during the game (PERFORM at runtime).

Practice Exercises

  1. Explain control break order versus sort key order with a two-level retail example.
  2. Compare macro versus PROC for a shared PERSNL FILE layout scenario.
  3. Describe debug steps when report grand total differs from file sum by five percent.
  4. Answer VSAM keyed READ versus sequential pass for a customer inquiry job.
  5. Sketch SCREEN procedure order with one sentence per hook.

Quiz

Test Your Knowledge

1. KSDS VSAM files in Easytrieve typically use:

  • Keyed READ or sequential access per FILE definition
  • JCL only without FILE
  • SCREEN maps
  • Macro MEND

2. Macros expand at:

  • Compile time via % invocation
  • Runtime PERFORM
  • JCL execution only
  • CICS startup

3. AFTER-BREAK runs:

  • When a control break field value changes
  • Before JOB starts
  • Only in SCREEN
  • At compile time

4. Internal SORT versus presorted input:

  • Presorted input can skip sort work when order already matches keys
  • SORT never used in Easytrieve
  • Presorted input always slower
  • SORT only in JCL never in program

5. VIRTUAL files use:

  • Temporary VFM space for scratch data
  • Permanent catalog only
  • CICS TD queues
  • SYSPRINT
Published
Read time16 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: Broadcom Easytrieve intermediate topics for interviewsSources: Broadcom Easytrieve Language Reference; file and report chaptersApplies to: Easytrieve intermediate interview preparation