FALSE

Page Nav

HIDE

Grid

GRID_STYLE

SORTING AND MERGING

SORTING Concepts:           Sorting consists of arranging records in ascending or descending sequence.The sort order of Alphanumeric data is...

SORTING Concepts:
          Sorting consists of arranging records in ascending or descending sequence.The sort order of
Alphanumeric data is termed its collating sequence ,which specifies the sort order of each alphanumeric character in the character set.The two popular collating sequences are EBCDIC and ASCII.
For MVS it is EBCDIC only.

In ascending order:
Blank,
special charcters
a-z
A-Z
0-9

SORT FIELDS=(start,length,format,order,..)
Start-starting byte position in the record
Length-length of the field in bytes
Format-the format ex: PD-Packed Decimal,FI-Fixed , BI=Binary ,CH-EBCDIC charcter,ZD- Zoned decimal..etc

SORT FIELDS=(4,6,CH,A,12,3,CH,D) == >SORT FORMAT=CH,FIELDS=(4,6,A,12,3,D)

SORT Options:
          SKIPREC =  n    this will skip fst n records
          STOPAFT= n      this will stop after n records

INCLUDE:
          To select records from SORTIN dataset by testing specified fields in the input records.
INCLUDE COND=(field,comparison,field/constant).
Ex:    INCLUDE COND=(8,5,CH,EQ,C’MUTHU’)

OMIT:
          To exclude records from the SORTIN dataset by testing fields in the input records.
OMIT COND=(8,3,CH,EQ,C’DEV’)

You can code as many AND ,OR ‘s.
OMIT COND=((8,3,CH,EQ,C’DEV’),OR, (8,3,CH,EQ,C’EVI’) )

SORT Efficiency:
          Sort with JCL than with application program sort statements.
          Sort fewer records
          Sort shorter records
          Reduce the number of keys
          Block should be big

MERGE:
MERGE merges several input datsets having identical record formats into a single output dataset in the same sequence.
//EXEC SORTD
//SORTIN01       DD    …
//SORTIN02       DD    …
..
//SORTIN16       DD    …
//SYSIN               DD    *
MERGE FIELDS=(SORT-KEY,SORT-KEY,..)
/*

No comments