Skip to main content
Modernization Hub

File Conversion - FB to VB Performance Challenge

Interview Question

"Our daily inventory extract file is 50GB, Fixed Block (FB), LRECL=500, BLKSIZE=27500.

Downstream consumer (vendor's system) requires Variable Block (VB) format. Currently using a COBOL program to read FB and write VB - takes 2.5 hours and uses significant CPU.

Your task: Redesign this using SORT utility to:

1. Reduce processing time to under 30 minutes

2. Minimize CPU consumption

3. Handle records that might have trailing spaces

Show me the SORT control statements. Explain the BLKSIZE calculation for VB output."

What This Tests

  • SORT utility advanced features
  • Understanding of record formats and blocking
  • Performance optimization skills
  • VB format specifications (RDW, BDW)

Good Answer Should Include

1. SORT Control Card:

//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC BUILD=(1,500)
  OUTFIL VTOF,VLFILL=C' '
/*

2. BLKSIZE calculation: For VB, BLKSIZE must be 4 bytes larger than max LRECL (for BDW)

  • LRECL=500 + 4 (RDW) = 504
  • BLKSIZE should be multiple of 504, e.g., 27504 (accommodates ~54 records)

3. JCL example showing proper DCB parameters

4. VLFILL handles trailing spaces by padding variable records

5. Performance gains: SORT utility is highly optimized, uses E15/E35 exits

Red Flags

  • ❌ Suggests writing COBOL program (misses the SORT requirement)
  • ❌ Wrong BLKSIZE calculation (forgets RDW/BDW)
  • ❌ Doesn't mention VTOF (Variable To Fixed) or vice versa
  • ❌ Can't explain why SORT is faster than COBOL

Follow-Up Questions

  • "What if some records are only 200 bytes but LRECL is still 500?"
  • "How do you verify the conversion was successful?"
  • "If the file has packed decimal fields, does record format matter?"

Difficulty Level

Mid-Level

Relevant Roles

Developer, Performance Analyst, System Programmer