MainframeMaster

DFSORT vs Syncsort Syntax Differences

DFSORT (IBM) and Syncsort (Syncsort, Inc. / Precisely) are both mainframe sort/merge utilities, but they are different products with different syntax for many control statements and options. Basic sort key specification is often similar, but once you use INREC, OUTREC, date conversion, OUTFIL reports, JOINKEYS, or product-specific options, the exact keywords and formats can differ. This page summarizes the main syntax differences so you know what to check when migrating a job from one product to the other: SORT/MERGE, INREC/OUTREC, SUM, OUTFIL, JOINKEYS, date conversion, and message IDs. Always use the target product manual for the final conversion and test with a small dataset.

Compatibility & Migration
Progress0 of 0 lessons

Why Syntax Differs

DFSORT and Syncsort were developed separately. They both implement sort, merge, copy, and reformatting, but the choice of statement names, keyword spellings, and option formats was made independently. So while many concepts map (e.g. "reformat before sort" exists in both), the exact syntax does not. When you migrate a job, you must translate each control statement to the target product's form; blind copy-paste of SYSIN often leads to errors or different behavior.

Syntax areas and what to expect
AreaDFSORT (typical)Syncsort (typical)
SORT / MERGE FIELDSPosition, length, format, A/D; EQUALS, NOEQUALSSimilar basics; option names may differ
INREC / OUTRECBUILD, FIELDS, FINDREP, IFTHENEquivalent REFORMAT/BUILD; IFTHEN syntax may differ
Date conversionDATE1, JFY, century keywordsDifferent keyword and format names
OUTFIL reportHEADER1/2, TRAILER1/2/3, COUNT=, LINES=Report options and syntax can differ
JOINKEYS / joinJOINKEYS F1/F2, REFORMAT, JOIN UNPAIREDJoin feature and syntax may differ
MessagesICE*WER*

SORT and MERGE Statements

Both products use a SORT or MERGE statement with FIELDS= specifying position, length, format, and A (ascending) or D (descending). Format codes (CH, BI, PD, ZD, etc.) are often similar. Options such as EQUALS (preserve order of equal keys) or NOEQUALS may have the same or different names (e.g. STABLE in some products). Collating sequence and alternate sequence (ALTSEQ) syntax can differ. When migrating, list every option on the SORT or MERGE statement and look up each in the target manual.

INREC and OUTREC

DFSORT uses INREC (reformat before sort) and OUTREC (reformat after sort) with BUILD= or FIELDS=, FINDREP=, and IFTHEN for conditional building. Syncsort has equivalent reformatting capability but may use different statement names (e.g. REFORMAT in a different context) or different keyword order. FINDREP (find/replace) and IFTHEN (conditional overlay or build) often have different syntax or nesting rules. When converting, map each BUILD segment and each IFTHEN clause to the target product's equivalent; test with a few records to ensure field positions and logic match.

Date Conversion

Date conversion is a common source of difference. DFSORT uses keywords like DATE1=, JFY (Julian), and format codes (e.g. MD4, Y2Y) and century windowing options. Syncsort has its own date conversion keywords and format names. The same input format (e.g. YYMMDD) and output format (e.g. YYYYMMDD) may be specified differently. Look up "date conversion" or "date format" in the target manual and rewrite the conversion specification; verify with known dates (e.g. 991231 → 19991231).

SUM Statement

Both products support SUM (or equivalent) for removing duplicates and optionally summing numeric fields. The key and FIELDS= specification are often similar. Overflow handling (e.g. when a sum exceeds the output field) can differ: DFSORT has options like VLSHRT, NOVLSHRT; Syncsort may use different names or behavior. Check overflow and MIN/MAX/AVG options in the target manual.

OUTFIL and Report Writing

OUTFIL in DFSORT supports multiple outputs, BUILD, INCLUDE/OMIT, SPLIT, and report options (HEADER1, HEADER2, TRAILER1, TRAILER2, TRAILER3, SECTIONS, LINES=, COUNT=). Syncsort has similar capabilities but the exact keywords and the format of HEADER/TRAILER (e.g. position:value, DATE=, TIME=, PAGE) can differ. Report layout conversion often requires line-by-line mapping of each header and trailer line and the COUNT or total syntax.

JOINKEYS and Joins

DFSORT uses JOINKEYS F1= and JOINKEYS F2= with REFORMAT and JOIN UNPAIRED. Syncsort may have a different name for the join feature (e.g. JOIN) and different syntax for specifying the two files, the key, and the reformat layout. UNPAIRED options (ONLY, F, F,F, etc.) may be spelled or coded differently. When migrating a file comparison or join job, find the join chapter in the target manual and rewrite the entire join control block.

Message IDs

DFSORT messages typically start with ICE (e.g. ICE000I for informational, ICE001A for abend). Syncsort messages typically start with WER. When a step fails, the message ID tells you which product ran so you look up the explanation in the correct manual. When migrating, keep in mind that the same logical error may produce a different message and code in the other product.

Migration Checklist

  • List every control statement in SYSIN (SORT, MERGE, INCLUDE, OMIT, INREC, OUTREC, SUM, OUTFIL, JOINKEYS, OPTION, etc.).
  • For each statement, find the equivalent in the target product manual; note any options that have no direct equivalent.
  • Rewrite date conversion, IFTHEN, and report layout with target syntax.
  • Rewrite JOINKEYS/join logic with target join syntax.
  • Run with a small input (e.g. 100 records); compare record count and spot-check key fields and totals.
  • Document the mapping (e.g. "DFSORT INREC BUILD → Syncsort REFORMAT ...") for future reference.

Explain It Like I'm Five

DFSORT and Syncsort are like two brands of the same kind of toy: both can sort and change data, but the buttons have different names and some buttons only exist on one brand. When you move from one to the other, you have to read the new box (the manual) to find which button does what, and you cannot assume the old instructions work word-for-word. You try it with a little bit of data first to make sure the result is the same.

Exercises

  1. You have a DFSORT job with INREC BUILD and DATE1= for date conversion. What should you do before running it as Syncsort?
  2. Where would you look to find the Syncsort equivalent of DFSORT JOINKEYS UNPAIRED,ONLY?
  3. Your job failed with message WER123A. Which product ran, and which manual should you use?
  4. Why is testing with a small dataset important when migrating between products?

Quiz

Test Your Knowledge

1. Why can you not always copy DFSORT control cards to a Syncsort step unchanged?

  • You can always copy them
  • The two products use different syntax for many options: statement names, keyword spellings, and formats (e.g. date conversion, IFTHEN) differ, so cards must be converted using the target product manual
  • Only JCL differs
  • Only message IDs differ

2. How do message IDs help when migrating between DFSORT and Syncsort?

  • They are the same
  • DFSORT uses ICE* (e.g. ICE000I), Syncsort uses WER*; when you see an error, the message ID tells you which product ran and which manual to use for the fix
  • Message IDs are only in JCL
  • Only ICE is used

3. What should you do before migrating a DFSORT job to Syncsort (or vice versa)?

  • Nothing; they are identical
  • Obtain the target product manual, list every control statement and option used, and map each to the equivalent in the target product; test with a small dataset and compare output
  • Only change the EXEC PGM=
  • Only change SORT to MERGE

4. Are SORT FIELDS and MERGE FIELDS syntax usually the same between DFSORT and Syncsort?

  • No, completely different
  • Often similar for basic position,length,format,A/D; but options like EQUALS, collating sequence, and format codes can differ—check the target manual
  • Only in DFSORT
  • Only in Syncsort

5. Where do the biggest syntax differences usually appear?

  • Only in SORT FIELDS
  • In advanced features: date conversion, IFTHEN/conditional building, OUTFIL report options (HEADER/TRAILER formats), JOINKEYS/REFORMAT, and product-specific options (e.g. VLSHRT, overflow handling)
  • Only in JCL
  • Only in SUM