Presentation is loading. Please wait.

Presentation is loading. Please wait.

Classification : Internal DFSORT Utility. Classification : Internal Overview DFSORT is IBM's high-performance product for z/OS. Following operations can.

Similar presentations


Presentation on theme: "Classification : Internal DFSORT Utility. Classification : Internal Overview DFSORT is IBM's high-performance product for z/OS. Following operations can."— Presentation transcript:

1 Classification : Internal DFSORT Utility

2 Classification : Internal Overview DFSORT is IBM's high-performance product for z/OS. Following operations can be carried out using this utility Sort Merge Copy Analysis Reporting

3 Classification : Internal Sample SORT JCL //EXAMP JOB A492,PROGRAMMER //SORT EXEC PGM=SORT //SYSOUT DD SYSOUT=A //SORTIN DD DSN=A123456.SORT.SAMPIN, //DISP=SHR //SORTOUT DD DSN=A123456.SORT.SAMPOUT, //DISP=OLD //SYSIN DD * //* Sort by Department //SORT FIELDS=(110,10,CH,A) /*

4 Classification : Internal DFSORT Control Statements SORT Describes the fields for a sort application, or requests a copy application. MERGE Describes the fields for a merge application, or requests a copy application. OPTION Overrides installation defaults, or requests optional features or a copy application. INCLUDE Describes the criteria to be used to include records before they are sorted, copied or merged. OMIT Describes the criteria to be used to omit records before they are sorted, copied or merged. -Continued

5 Classification : Internal INREC Describes how records are to be reformatted before they are sorted, copied or merged. OUTREC Describes how records are to be reformatted after they are sorted, copied or merged. SUM Describes how fields are to be summed after sorting or merging. OUTFIL Describes various types of processing to be performed for one or more output data sets after sorting, copying or merging. Continued…

6 Classification : Internal SORT Control Card SORT FIELDS=(110,10,CH,A) 110 is the starting position of the key 10 is the length of the key CH is Data Format A is Sorting Order oA = Ascending oD = Descending

7 Classification : Internal Data Format EBCDIC (Character)CH Binary (Unsigned Numeric)BI Fixed-point (Signed Numeric)FI Zoned Decimal (Signed Numeric)ZD Packed Decimal (Signed Numeric)PD Floating Sign (Signed Numeric)FS Free Form (Unsigned Numeric)UFF Free Form (Signed Numeric)SFF

8 Classification : Internal Sorting by Multiple Fields SORT FIELDS=(110,10,CH,A,170,4,BI,D,145,17, CH,A,1,75,CH,A) Alternative way: FORMAT=CH,FIELDS=(110,10,A,170,4, BI,D,145,17,A,1,75,A)

9 Classification : Internal MERGE //EXAMP JOB A492,PROGRAMMER //MERGE EXEC PGM=SORT //SYSOUT DD SYSOUT=A //SORTIN01 DD DSN=A123456.MASTER,DISP=SHR //SORTIN02 DD DSN=A123456.NEW,DISP=SHR //SORTOUT DD DSN=A123456.SORT.SAMPOUT,DISP=OLD //SYSIN DD * MERGE FIELDS=(110,5,CH,A,1,75,CH,A) /* Input File DD Name: SORTINnn

10 Classification : Internal VB Data Set Considerations Starting Positions For FB data sets, the first data byte starts in position 1. However, for VB data sets, the Control Field is in positions 1-4, so the first data byte starts in position 5. Short Control Fields If you know you have VB records with short control fields, you can specify the VLSHRT option, if appropriate, to prevent DFSORT from terminating OPTION VLSHRT

11 Classification : Internal COPY 3 ways to copy dataset. SORT FIELDS=COPY MERGE FIELDS=COPY OPTION COPY

12 Classification : Internal INCLUDE INCLUDE COND=(166,4,GT,162,4),FORMAT=BI SORT FIELDS=(1,75,CH,A) INCLUDE COND=(166,4,BI,GT,162,4,BI,AND,106,4, CH,EQ,C'COR') SORT FIELDS=(1,75,CH,A)

13 Classification : Internal OMIT OMIT COND=(166,4,GT,162,4),FORMAT=BI SORT FIELDS=(1,75,CH,A) OMIT COND=(166,4,BI,GT,162,4,BI,AND,106,4, CH,EQ,C'COR') SORT FIELDS=(1,75,CH,A)

14 Classification : Internal SUM SORT FIELDS=(115,5,CH,A) SUM FIELDS=(170,4,BI) Removing Duplicate SORT FIELDS=(106,4,CH,A) SUM FIELDS=NONE DD Name – ‘SORTXSUM’ can be specified to capture all the duplicates removed.

15 Classification : Internal OUTFIL SORT FIELDS=(1,15,CH,A) OUTFIL FNAMES=OUT1,ENDREC=4 OUTFIL FNAMES=OUT2,STARTREC=2,ENDREC=6 OUTFIL FNAMES=OUT3,STARTREC=7,ENDREC=9 OUTFIL FNAMES=OUT4,STARTREC=10 Records in Out Files. OUT1: 1, 2, 3, 4 OUT2: 2, 3, 4, 5, 6 OUT3: 7, 8, 9 OUT4: 10, 11, 12

16 Classification : Internal REFORMATING OPTION COPY OUTFIL FNAMES=RAHUL, INCLUDE=(106,4,CH,EQ,C'WETH'), OUTREC=(C'Sold ',166,4,BI,C' copies of RAHUL, Inc. book for instructor ', 145,15) Outfile Contents Sold 26 copies of RAHUL, Inc. book for instructor CHATERJE Sold 9 copies of RAHUL, Inc. book for instructor GOODGOLD Sold 23 copies of RAHUL, Inc. book for instructor SMITH Sold 21 copies of RAHUL, Inc. Book for instructor BISCARDI

17 Classification : Internal REPEAT OPTION COPY INCLUDE COND=(110,5,CH,EQ,C'PSYCH') OUTFIL FNAMES=OUT1, REPEAT=2, BUILD=(120,25) OUTFIL FNAMES=OUT2, REPEAT=3, BUILD=(120,25,X,SEQNUM,4,ZD) The results produced for OUT1 are: PSYCHOLOGY I PSYCHOANALYSIS The results produced for OUT2 are: PSYCHOLOGY I 0001 PSYCHOLOGY I 0002 PSYCHOLOGY I 0003 PSYCHOANALYSIS 0004 PSYCHOANALYSIS 0005 PSYCHOANALYSIS 0006

18 Classification : Internal SPLIT OPTION COPY OUTFIL FNAMES=(OUTPUT1,OUTPUT2),SPLIT With 10 input records, the results produced for OUTPUT1 are: Record 01 Record 03 Record 05 Record 07 Record 09 The results produced for OUTPUT2 are: Record 02 Record 04 Record 06 Record 08 Record 10

19 Classification : Internal SPLITBY OPTION COPY OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=3 With 10 input records, the results produced for OUT1 are: Record 01 Record 02 Record 03 Record 10 The results produced for OUT2 are: Record 04 Record 05 Record 06 The results produced for OUT3 are: Record 07 Record 08 Record 09


Download ppt "Classification : Internal DFSORT Utility. Classification : Internal Overview DFSORT is IBM's high-performance product for z/OS. Following operations can."

Similar presentations


Ads by Google