Features

What Portasort supports

Portasort implements the control statements of the z/OS sort program and the ICETOOL utility as the mainframe documentation describes them, and checks them as strictly, so that your decks stay portable between the two platforms.

Control statements

  • SORT and MERGE: every control field format, bit fields included, FORMAT=, EQUALS, SKIPREC=, STOPAFT=, FILSZ=, Y2PAST=; merges of up to 100 inputs.
  • INCLUDE and OMIT: character, numeric and date comparisons, decimal, character, hexadecimal and date constants, bit tests, substring tests, NUM and alphanumeric tests, regular expressions, UTF-8/16/32 comparisons, AND and OR.
  • INREC and OUTREC: BUILD, OVERLAY, FINDREP, IFTHEN with WHEN=INIT, ANY, NONE and GROUP, PARSE; editing masks, TO= conversions, arithmetic, SEQNUM, TRAN=, JFY, SQZ, CHANGE lookups, date conversions and date arithmetic.
  • SUM: FIELDS=NONE and sums of binary, packed, zoned and floating-point fields, with overflow handling.
  • OUTFIL: any number of outputs with their own INCLUDE, BUILD and IFTHEN; SPLIT, REPEAT, VTOF and FTOV; reports with headers, trailers, sections, counts and totals; IFTRAIL.
  • JOINKEYS, JOIN and REFORMAT: inner and outer joins of two files, sorted or not, with the JNF1CNTL and JNF2CNTL subtask statements.
  • SYMNAMES: symbols for fields and constants, system symbols, JPn symbols.
  • DFSPARM and the EXEC PARM: overriding statements and options with the mainframe's override rules.
  • OPTION, ALTSEQ, RECORD, MODS, DEBUG: every operand; those about storage, work data sets, tapes and VSAM are checked and have no effect.

ICETOOL

Every operator, with ICETOOL's messages, return codes and modes (STOP, CONTINUE, SCAN):

  • COPY, SORT, MERGE
  • COUNT, STATS, RANGE
  • UNIQUE, VERIFY
  • SELECT, SUBSET
  • DATASORT, RESIZE
  • SPLICE
  • DISPLAY: simple, tailored and sectioned reports
  • OCCUR
  • DEFAULTS, MODE

Files and data

  • Fixed-length records, as unloaded from FB data sets.
  • Variable-length records with an emulated RDW, so that the positions of VB decks work unchanged.
  • Text files, one record per line.
  • Micro Focus variable files, read and written with their headers.
  • Concatenated inputs, DISP=MOD outputs, any input format written in any output format.
  • Packed and zoned decimal, with the zoned sign convention of your data (EBCDIC overpunch translated to ASCII, or Micro Focus).
  • Binary fields in big- or little-endian byte order, per file or per field.
  • Floating point (IEEE), free-form numbers, two- and four-digit-year dates, SMF, TOD and ETOD times.
  • EBCDIC: hexadecimal constants translated from your code page, and, on request, the EBCDIC collating sequence for character data.

Behaviour you can rely on

  • Return codes 0, 4 and 16, as on the mainframe; ICETOOL's 0 to 20.
  • The IBM-supplied installation defaults: SZERO, Y2PAST=80, EQUALS for variable-length records and so on.
  • Messages that show the statement and a caret at the column of an error.
  • Invalid numeric data ends the job with the record, the field and its bytes: the counterpart of an S0C7 abend.
  • Records too short for a field, counts that do not match FILSZ=, out-of-sequence merge inputs: each a clear message, never a silent result.

Large sorts

Inputs larger than storage are sorted in runs on work files and merged, with EQUALS respected. You choose the storage (PORTASORT_MEMORY) and the work directories (PORTASORT_WORK, spread over several disks); work files are removed as soon as they are merged. Big sorts are limited by the disks, not by the processor.

The extended dialect

With PORTASORT_DIALECT=EXTENDED, Portasort also accepts the extensions of another widely used mainframe sort product, and follows that product where the two behave differently:

  • SUM with XSUM and XSUMFIL; DUPKEYS with SUM, MIN, MAX, AVG, ALLDUPS, NODUPS, FIRSTDUP and LASTDUP; XDUP and XDUPFIL.
  • RANGE and XRANGE conditions; substring tests to the end of the record, with the wildcards * and %.
  • JOINKEYS keys with formats and different lengths, SKIPREC, STARTREC and ENDREC per file.
  • TRAN= translation tables, CTOX and XTOC; packed year expansion; OPTION and EXEC PARM aliases.

User exits

E15 and E35 exits are C functions in shared libraries, named on MODS statements as on the mainframe and called with the mainframe's return codes: insert, delete, replace, stop. The package includes the C header and sample exits. E61 and E32 exits need the Java edition of Portasort. The exits whose work Portasort does itself (E11, E16, E17, E18, E19, E31, E37, E38, E39) are accepted with a warning.

Not supported

  • User exits written in Assembler, COBOL or other mainframe languages: rewrite them in C.
  • EFS programs (formats D1 and D2) and locales (LOCALE=name, COLLKEY): character data is compared as bytes, or by EBCDIC weights.
  • UTF-8/16/32 fields as SORT or MERGE control fields.
  • The ICETOOL parameter list interface (calling ICETOOL from a program).

The user manual has the details of every statement, variable and message.

See it with your own decks

The quickest test is your own job steps and data. Ask for a trial license.

Request a trial