Sync Sort | Software | Computer Programming

SYNCSORT - AN OVERVIEW

Table of Contents

1. OverView ...................................................................................................... 1 2. SYNCSORT Commands ............................................................................... 2 2.1 SORT......................................................................................................... 2 2.2 MERGE ..................................................................................................... 2 2.3 INCLUDE and OMIT................................................................................ 2 2.4 INREC and OUTREC ............................................................................... 3 2.5 SUM .......................................................................................................... 3 2.6 ALTERNATE COLLATING SEQUENCE .............................................. 4 2.7 OPTION Statement ................................................................................... 4 2.7.1 EQUALS AND NOEQUALS ............................................................. 4 2.7.2 RECORD............................................................................................. 4 2.7.3 SKIPREC............................................................................................. 4 2.7.4 STOPAFT............................................................................................ 4 2.7.5 COPY .................................................................................................. 5 2.8 OUTFIL..................................................................................................... 5 3. JCL Requirement........................................................................................... 5 SYSIN . ...................................................................................................... 5 SYSOUT ..................................................................................................... 5 SORTIN ...................................................................................................... 5 SORTIN## .................................................................................................. 5 SORTOUT .................................................................................................. 5 SORTOUT# ................................................................................................ 5 SORTOT## ................................................................................................. 5 SORTWK##................................................................................................ 5 4. PROCESSING ORDER ................................................................................ 5
1. OVERVIEW
Syncsort belongs to Syncsort IncC that can sort data, merge data, selectively process data, reformat data, create summary records from data and create extensive reports from input data. It can also perform any combination of the above mentioned functions and more. This document tries to explain in brief the various items related to processing data using Syncsort. This document describes a subset of the Syncsort functions and does not claim to be a replacement nor does the author guarantee the exactness of details or syntax.
Syncsort.doc Page 1 of 6

SORT FIELDS=({begcol}.. {D|A}]. GT.{begcol}. starting with 1 for the first byte.).{D|A}[. The length of the field must be specified in bytes. PD for packed decimal (COMP-3 fields of COBOL). The list of fields and their formats must be specified for this statement. INCLUDE COND=({begcol1}. {D|A}].{fieldtype}.2 2.{length}. 2.doc Page 2 of 6 . then the options specified will determine if the input order is maintained for such records.{length}. The second form of the SORT statement can be used when all the fields specified for the sort sequence are of the same type.{length}. irrespective of the field type. The different formats of the INCLUDE and OMIT statements are shown below. {length}.) or SORT FIELDS=({begcol}.{length}. The SORT statement requires the sort sequence for the data. BI for binary (COMP fields of COBOL)..1 SYNCSORT COMMANDS SORT The SORT statement can be used sort a dataset or concatenated datasets. The valid comparison operators are EQ.{fieldtype}. MERGE FIELDS=({begcol}.SYNCSORT . The output records are sorted in the specified sequence.{length2}.{fldtype1}.{length1}. NE. ZD for zone decimal and AQ for alternate collating sequence (refer to later section on alternate collating sequence)..{begcol}. The frequently used ones are CH for character.{D|A}]. MERGE The MERGE statement can be used merge two or more pre-sorted datasets.{fieldtype} The beginning column is specified in bytes..{begcol}. The multiple records contain the same sort sequence key..{comp. Syncsort.oper}. The format of the SORT statement is as follows.{fieldtype}. LE and GE.{fldtype2}) The above statement can be used to compare two fields within the same record.{D|A}[. The format of the MERGE statement is as follows. Both statements cannot be used together.{D|A}[.{D|A}[.) or MERGE FIELDS=({begcol}.{fieldtype}.{length}... The list of fields and their formats must be specified for this statement. LT. {length}.). 2.AN OVERVIEW 2.{D|A}].{fieldtype} Please refer to SORT statement above for description of the statement.{begcol}.. There are many field types.{length}. The MERGE statement requires the sort sequence for the data.3 INCLUDE AND OMIT The INCLUDE statement can be used to specify the conditions for inclusion of records from the input during processing. {begcol2}. The OMIT statement can be used to specify the conditions for exclusion of records from the input during processing.

The syntax is as follows. MERGE and SUM statements must reflect the output from the INREC processing.{length}. Whenever there is an overflow of a numeric field.oper}.{length}. spaces or zeroes can be placed in the record at specific positions.) Parenthesis can be used to group conditional statements to form complex conditions. In the example above.[{OR|AND}. more than one record may be created. For example.4 INREC AND OUTREC The INREC statement can be specified to reformat the input records before SYNCSORT processes them for SORT or MERGE.) The Outpos description is optional.EDIT=SIII. {constant}) The above statement can be used to compare a field in the record with a character..stmt}. Customized picture clauses can be specified by using appropriate syntax. Constant fields can also be introduced in the record. The format for the INREC and OUTREC statements are similar.{length} [.. If numeric fields are specified for summation. I is equivalent of Z PIC clause of COBOL and T is equivalent of 9 PIC clause.{cond. The default is to place it at the current position in the output record. SUM The SUM statement can be used to summarize data based on the SORT statement. The SYNCSORT software does not guarantee unique records if numeric fields are required to be summed up.stmt}]. placing the first field specified at column 1.. For OMIT statements replace the INCLUDE verb by OMIT verb in the above examples.stmt} is the part of statement between the parenthesis in either of the statements mentioned above.IIT. Using the convention that {cond. This specifies the position in the output record where the field must be placed. 2.AN OVERVIEW INCLUDE COND=({begcol}.{length}].. The OUTREC statement can be specified to reformat the processed records into the required layout for the output records or the report that is generated.{fldtype}. compound statements can be constructed as follows.doc . NOTE: When using INREC fields.{fldtype}.5 Syncsort.{fldtype}.TT) Default picture clauses are provided and named M0 to M9. SUM FIELDS=NONE or Page 3 of 6 2. the S character is for sign field.[{outpos}:]{begcol}. INCLUDE COND=({cond. Conventions for the sign displayed for numeric fields can be specified after the edit parameter. An example syntax is given below. decimal or hexadecimal constant. The individual numeric fields can also be reformatted from any form to zone decimal. those fields will be summed up. using SIGNS parameter.EDIT=M#) or INREC FIELDS=({begcol}. One record will be produced for each unique key present in the input.{comp. INREC FIELDS=([{outpos}:]{begcol}. the column positions and lengths in the SORT.{length}. INREC FIELDS=({begcol}.SYNCSORT .

{fldtype}]. The new hex code will not replace the hex codes in the output or the reports... OPTION EQUALS should be used if the order of input data must be maintained during the SORT processing. When EQUALS is used the data for the non key fields are taken from the first input record for that key value. When NOEQUALS is specified the data for the non keyfields are unpredictable. This will help the user in sorting records in a different sequence than the EBCDIC character set.{hexcode}{newhexcode}].doc Page 4 of 6 .7.6 ALTERNATE COLLATING SEQUENCE The alternate collating sequence can be specified using the ALTSEQ statement.. STOPAFT The STOPAFT parameter of the OPTION statement can be used to specify the number of records to be included for processing.SYNCSORT .3 2. SKIPREC The SKIPREC parameter of the OPTION statement can be used to specify the number of records of input to skip before any processing should begin. MERGE and SUM processing. ALTSEQ CODE=({hexcode}{newhexcode}[.) The new hex code will be used for the sorting or merging process only for the appropriate hex code specified for it. 2. OPTION STATEMENT The option statement can be used to control parameters during SORT. RECORD The record option of the OPTION statement can be used to specify if the input data to be processed are Variable length records or Fixed length records.1 2.{length}. The valid values are RECORD=V and RECORD=F.AN OVERVIEW SUM FIELDS=({begcol}. 2.7. EQUALS AND NOEQUALS The default of NOEQUALS specifies that SYNCSORT need not retain the order of input data when duplicate record keys are found.7 2.. This parameter will affect the non-summation data in SUM processing. This may be required in situations where the character codes for fields.4 Syncsort. The second format is used when numeric summation is required when duplicate records exist.7. This is required when both the input and output from the SORT or MERGE processing are VSAM files.{fldtype}[.{length}. are not in EBCDIC collating sequence. STOPAFT=100 specifies that SYNCSORT stop taken any more input after 100 records that match the criteria are selected.2 2.{begcol}. SKIPREC=20 specifies that the first 20 records of the input must be skipped.) The first format is used when duplicate records need to be removed and no numeric summation is required. that the user intends to sort on.7.

report formatting is available.doc Page 5 of 6 . Syncsort. selected records can be copied to output based on specific conditions in field values. 2. this statement can help create separate reports for each department into a different dataset or sysout and route them to the appropriate destination. This is where the SYNCSORT messages are placed. like producing reports. including 3 levels of HEADER#. For example. The SYNCSORT manual should be referred if the OUTFIL statement is required.1 SYSIN It should point to the SYNCSORT control statements mentioned above. SORTIN## These statements should refer to the individual datasets to be merged. When COPY is combined with INREC or OUTREC processing (INREC is more efficient in this case).SYNCSORT . OUTFIL The OUTFIL statement can be used to produce multiple output datasets. These individual datasets are required to be in pre-sorted order.1. Further. Section processing and Section breaks. SORTOUT This dataset should point to the dataset where the output must be placed.1.8 3. 3 levels of TRAILER#. The FILE parameter specifies the DD name suffix to be used for the dataset output. If COPY is combined with INCLUDE or OMIT condition statements. 4. Each output dataset can have its own INCLUDE or OMIT condition and its own INREC and OUTREC parameters. If neither SORT processing nor MERGE processing is required this is ideal to use. SORTOT## The same as SORTOUT#. This statement must be used if elaborate formatting is required.5 COPY The COPY parameter can be used if a simple COPY operation is required. There must be a one to one correspondence between the FILES parameter in the OUTFIL statement and the list of DD statements specified. 3.AN OVERVIEW 2. PROCESSING ORDER The processing order of the control statements by SYNCSORT is as follows. SYSOUT It should point to a dataset or SYSOUT. SORTIN This dataset should point to the input dataset(s) for the sort process.7. a reformatted output can be produced. The parameter when combined with SKIPREC and STOPAFT helps copy selected records to output based on number of records. SORTWK## These statements should refer to temporary volumes with appropriate space parameters depending on the volume of data to be processed. JCL REQUIREMENTS The different DD statements required for the SORT step are as follows. One OUTFIL statement is required for each output dataset. summation. SORTOUT# These datasets should point to the individual output datasets referred in the OUTFIL statements.

3.doc Page 6 of 6 . 5.SYNCSORT . OUTREC processing. The processing order will drastically change if OUTFIL statement is present in the SYSIN of SYNCSORT. 4. SORT. SUM statement processing. INREC statement processing. MERGE or COPY processing (including alternate collating sequence processing for SORT and MERGE). The processing is very complex if the OUTFIL statements use different INREC statements and different INCLUDE or OMIT statements. 1.AN OVERVIEW INCLUDE or OMIT condition statement processing. Syncsort. 2.

Sign up to vote on this title
UsefulNot useful