DFSORT

1. JOINKEYS

2.REFORMAT FIELDS

3.REMOVECC

     REMOVECC WILL REMOVE 1ST COLUMN VALUES  ’1′

     REMOVE THE ANSI CARRIAGE CONTROL CHARACTERS

     observe the Header1 and HEADER2 examples

4.HEADER1

   a. how to put the headers in output file

//STEP010     EXEC PGM=SORT

//SORTIN       DD DSN=MMTS.SRIDHAR..PS6,DISP=SHR

//SORTOUT   DD DSN=MMTS.TEST.SRIDHAR.PS7,

//                              DISP=(NEW,CATLG,DELETE),

//                              SPACE=(CYL,(10,10),RLSE),

//                              UNIT=SYSDA,

//                              DCB=(LRECL=80,BLKSIZE=0,RECFM=FB)

//SYSOUT    DD  SYSOUT=*

//SYSIN DD *

    SORT FIELDS=COPY

    OUTFIL FILES=OUT,REMOVECC,

    HEADER1=(‘FULL-NAME’,5X,’LAST-NAME’,4X,’AGE’,8X,’DESIG’)

/*

b.how to put the headers along with underlines

//SYSIN DD *

SORT FIELDS=COPY

OUTFIL REMOVECC,

HEADER1=(‘FULL-NAME’,5X,’LAST-NAME’,4X,’AGE’,8X,’DESIG’,

                        1/1:’———’,5X,’———’,4X,’—’,8X,’—–’)

/*

c.

//SYSIN DD *

SORT FIELDS=COPY

OUTFIL FILES=OUT,REMOVECC,

HEADER1=(1/1:’REPT DATE :’,DATE(MD4/),5X,’TEST REPORT’,5X,

‘PAGE:’,&PAGE=(FS,LENGTH=5),

1/1:’FULL-NAME’,5X,’LAST-NAME’,4X,’AGE’,8X,’DESIG’,

1/1:’———’,5X,’———’,4X,’—’,8X,’—–’,37X),

TRAILER1=(‘TOT NO.OF RECORDS:’,COUNT=(M11,LENGTH=8))

/*

5.HEADER2

//SYSIN DD *

SORT FIELDS=COPY

OUTFIL REMOVECC,

LINES=5,

HEADER1=(‘ MY BANK TEST REPORT ‘),

HEADER2=(‘FULL-NAME’,5X,’LAST-NAME’,4X,’AGE’,8X,’DESIG’,

1/1:’———’,5X,’———’,4X,’—’,8X,’—–’),

TRAILER2=(‘NO.OF RECORDS:’,COUNT=(M11,LENGTH=8)),

TRAILER1=(‘TOT NO.OF RECORDS:’,COUNT=(M11,LENGTH=8))

//*

6.TRAILER1

7.TRAILER2

8.OPTION COPY, OPTION EQUALS

9.JOIN UNPAIRED

UNPAIRED Syntaxes:

a. UNPAIRED, F1, F2 or UNPAIRED:

Unpaired records from F1 and F2 as well as paired records. This is known as a full outer join.

b.UNPAIRED, F1:

Unpaired records from F1 as well as paired records. This is known as a left outer join.

c.UNPAIRED, F2:

Unpaired records from F2 as well as paired records. This is known as a right outer join.

d.UNPAIRED, F1, F2, ONLY or UNPAIRED, ONLY

Unpaired records from F1 and F2.

e.UNPAIRED, F1, ONLY

Unpaired records from F1.

f.UNPAIRED, F2, ONLY

Unpaired records from F2.