Follow

HSORT Documentation

HSORT Description & Purpose

HSORT is a program that works with records by performing various kinds of operations on them such as: filtering, changing, summing, ordering, skipping records, choosing a subset of the records. Its main purpose is to provide an efficient way of manipulating information to enable customers to extract business-relevant data.

 

Prerequisites

An elastic_cobol license is needed in order to use the HSORT product.

In order to execute "EXEC SORT" statements with HSORT instead of the default linux sort, the following property needs to be added to ebp.properties:

ebp.alias.SORT=HSORT

 

DCB dependency

HSORT requires DCB entries to get needed I/O information. There is support for both File DCB and Table DCB.

 

HSORT Error Handling

  • Syntax error check:

          -  All statements that are used should be allowed.

          - Check for correctness of SORT FIELD, INCLUDE/OMIT, INREC/OUTREC, SUM statements.

          - Record length and record type should be specified.

  • Record validity check for numeric fields in PD and ZD formats.
  • When SUM statement is used there is a check for summation overflow.

 

HSORT input and output

The input/output for HSORT could be one of the following:

  • physical file on disk
  • file in VSAM format (a DB table)   
  • file in Record-descriptor-word (RDW) format 
  • input from SYSIPT
  • output to PUNCH

based on what is specified in the JCL and the DCB. Both resources are expected to match and JCL will override the information from DCB in case of a mismatch in the record's length/format. 

We differentiate between the file formats based on the PROTOTYPE property that is set in the DCB:

"VDB:" -> file from database (DB table), "SYNC:" -> physical file in RDW format 

 

HSORT Functionalities

At the moment, HSORT has support for the following JCL statements:

  • SORT FIELDS=(<fields>)
SORT FIELDS=(1,3,CH,A,4,2,PD,D,7,9,ZD,A)
  • SORT FIELDS=COPY
  • MERGE FIELD=COPY
  • INREC FIELDS=(<fields>)
INREC FIELDS=(3,3,X,6,6,2X,12,4,1C'END',2X'4C',5X)
  • OUTREC FIELDS=(<fields>)
 OUTREC FIELDS=(3,3,1C'A',10,4, 4X, 6,4,6,4,X'40404040')
  • SUM FIELDS=(<fields>)
SUM FIELDS=(94,5,PD,121,5,ZD)
  • SUM FIELDS=NONE
  • INCLUDE COND=(<conditions>)
INCLUDE COND=(51,3,CH,EQ,C'972',OR,51,3,CH,EQ,C'763')
  • OMIT COND=(<conditions>)
OMIT COND=(211,5,PD,EQ,0,AND,97,5,PD,EQ,0,AND,102,5,PD,EQ,0) 
  • INPFIL SYSIPT
  • OUTFIL PUNCH
  • OUTFIL FILES=<number>, <statements>
OUTFIL FILES=1, INCLUDE=(106,15,CH,EQ,C'OSLO')
  • OPTION SKIPREC=<number>, NRECS=<number
  • OPTION SKIPREC=10,NRECS=15

HSORT Statistics

HSORT print statistics for the following:

  • Number of records read and bytes read
  • Number Records  written and bytes written
  • Input and output record length

Logging

Logging can be set on through the following constant in ebp.properties:

hsortlog=(true | false)

 

EBCDIC collation 

As of today, HSORT has support for 2 EBCDIC codepages - 037 and 277.

The collation sequences used, match exactly the collation sequences from MSSQL:

  • SQL_EBCDIC037_CP1_CS_AS
  • SQL_EBCDIC277_CP1_CS_AS

In order to specify the codepage, you should add ebp property:

hsort.ebcdic.codepage=<codepage-number>

<codepage-number> should be either 037 or 277.

If something else is provided HSORT will default to codepage 037 (SQL_EBCDIC037_CP1_CS_AS).

Note that there is a slight difference between  Codepage037  and SQL_EBCDIC037_CP1_CS_AS.

This is true for codepage 277 as well.

 

Links to useful resources about commands usage, syntax, etc.:

https://drive.google.com/file/d/1sDQ9-o1HybzdTfrf00yF_as9dHB2JCic/view

https://drive.google.com/file/d/1T_k0KLAlEIl7CFnPQwtHCyBZQKVAbAzy/view

https://www.ibm.com/docs/en/zos/2.1.0?topic=statements-option-control-statement

 

 

 

 

 

 

 

 

 

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk