DFSORT
DFSORT
DFSORT
SC23-6878-01
Note
Before using this information and the product it supports, be sure to read the general information under Notices on page
915.
Contents
Figures . . . . . . . . . . . . . . . ix
Tables . . . . . . . . . . . . . . . xi
About this document . . . . . . . . xiii
How to use this document . . . . . . .
Required product knowledge . . . . . .
Referenced documents. . . . . . . . .
z/OS information . . . . . . . . . .
Using LookAt to look up message explanations
Notational conventions . . . . . . . .
.
.
. xiii
. xiv
. . xv
. . xv
. . xvi
. . xvi
.
.
.
.
.
.
.
.
xix
.
.
. xix
. xix
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
4
4
4
5
5
5
7
7
11
12
12
12
13
13
.
.
.
.
.
.
.
.
.
.
.
.
16
16
17
24
25
26
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 27
. 29
29
29
30
32
60
61
63
63
63
65
iii
.
.
. 122
. 122
.
.
.
.
.
.
.
.
124
124
125
148
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
150
162
162
162
165
166
168
169
.
.
.
. 171
. 173
. 219
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 426
. 438
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
220
223
374
377
402
424
441
442
442
449
449
451
453
454
iv
457
458
459
460
462
467
468
471
473
473
475
477
479
482
487
488
490
490
492
492
492
492
492
493
493
493
493
493
494
494
495
495
496
496
498
498
499
499
503
503
504
507
508
510
510
510
512
517
517
517
518
518
518
519
519
520
521
521
523
. 523
529
. 529
. 535
. 535
. 536
. 537
.
.
.
.
541
541
541
542
. 542
543
. 543
. 543
. 550
. 550
. 550
553
. 553
. 553
. 554
. 559
. 560
. 561
. 561
. 561
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
563
563
564
565
566
567
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
567
567
568
571
573
574
574
575
575
577
578
579
580
585
585
587
588
590
Operand descriptions. . . . . . . . .
DEFAULTS example . . . . . . . . .
DISPLAY operator . . . . . . . . . . .
Simple report . . . . . . . . . . .
Tailored report . . . . . . . . . . .
Sectioned report . . . . . . . . . .
Operand descriptions. . . . . . . . .
MERGE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
MERGE examples . . . . . . . . . .
MODE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
MODE example . . . . . . . . . .
OCCUR operator . . . . . . . . . . .
Simple report . . . . . . . . . . .
Tailored report . . . . . . . . . . .
Operand descriptions. . . . . . . . .
OCCUR examples . . . . . . . . . .
RANGE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
RANGE example . . . . . . . . . .
RESIZE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
RESIZE examples . . . . . . . . . .
SELECT operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
SELECT examples . . . . . . . . . .
SORT operator . . . . . . . . . . . .
Operand descriptions. . . . . . . . .
Sort examples . . . . . . . . . . .
SORT operator with JOINKEYS example . .
SPLICE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
SPLICE examples . . . . . . . . . .
STATS operator. . . . . . . . . . . .
Operand descriptions. . . . . . . . .
STATS example. . . . . . . . . . .
SUBSET operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
SUBSET examples . . . . . . . . . .
UNIQUE operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
UNIQUE example . . . . . . . . . .
VERIFY operator . . . . . . . . . . .
Operand descriptions. . . . . . . . .
VERIFY example . . . . . . . . . .
Calling ICETOOL from a program . . . . .
TOOLIN interface . . . . . . . . . .
Parameter list interface . . . . . . . .
ICETOOL notes and restrictions . . . . . .
Notes on using JOINKEYS with COPY and SORT
ICETOOL return codes . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
591
592
594
595
596
597
598
642
643
644
644
645
645
646
647
648
649
659
662
662
664
664
666
666
668
670
673
677
678
679
681
681
688
691
708
709
710
710
712
716
718
718
719
720
720
721
722
722
722
727
728
. 728
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
731
732
733
734
734
734
Contents
Symbol statements . . . . . . . . .
Keyword statements . . . . . . . . .
Using SYMNOUT to check your SYMNAMES
statements . . . . . . . . . . . .
Using symbols in DFSORT statements . . . .
SORT and MERGE . . . . . . . . .
SUM . . . . . . . . . . . . . .
INCLUDE and OMIT. . . . . . . . .
INREC and OUTREC. . . . . . . . .
OUTFIL . . . . . . . . . . . . .
JOINKEYS . . . . . . . . . . . .
REFORMAT . . . . . . . . . . . .
OPTION . . . . . . . . . . . . .
Using symbols in ICETOOL operators . . . .
COUNT . . . . . . . . . . . . .
DATASORT . . . . . . . . . . . .
DISPLAY . . . . . . . . . . . . .
OCCUR . . . . . . . . . . . . .
RANGE . . . . . . . . . . . . .
SELECT . . . . . . . . . . . . .
SPLICE . . . . . . . . . . . . .
STATS, UNIQUE and VERIFY . . . . . .
SUBSET . . . . . . . . . . . . .
ICETOOL Example . . . . . . . . .
Using SET and PROC symbols in DFSORT and
ICETOOL statements . . . . . . . . . .
Using JPn parameters in EXEC PARM for
DFSORT . . . . . . . . . . . . .
Using JPn parameters in EXEC PARM for
ICETOOL . . . . . . . . . . . .
Description of JPn"string" . . . . . . .
Example 1 . . . . . . . . . . . .
Example 2 . . . . . . . . . . . .
Notes for symbols . . . . . . . . . . .
. 734
. 744
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
747
747
748
749
749
750
752
756
756
756
757
757
757
757
758
758
758
758
758
758
758
. 760
. 761
.
.
.
.
.
761
762
762
763
765
vi
767
768
768
768
769
773
774
774
776
776
776
776
776
779
779
779
781
783
783
784
785
785
785
785
786
786
788
788
789
789
790
792
793
793
795
796
796
798
799
799
799
800
800
801
802
802
802
802
805
806
807
810
811
812
813
813
816
817
817
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
OUTREC,
. . . .
.
.
.
.
.
.
819
819
820
821
821
821
. 822
824
825
826
827
828
829
831
833
835
836
837
838
839
844
844
845
846
847
847
848
849
850
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
853
853
854
854
854
855
855
856
858
858
859
860
860
861
Appendix B. Specification/override of
DFSORT options . . . . . . . . . . 863
Main features of sources of DFSORT options .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
864
865
865
865
865
865
866
874
.
.
. 874
. 882
.
.
. 882
. 890
891
. 891
. 897
. 900
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 901
. 903
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
911
911
911
911
913
913
914
Notices . . . . . . . . . . . . . . 915
Programming interface information .
Trademarks . . . . . . . . .
.
.
.
.
.
.
.
.
. 916
. 916
Index . . . . . . . . . . . . . . . 917
. 864
Contents
vii
viii
Figures
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
Control Fields . . . . . . . . . . . . 6
Record Processing Order . . . . . . . . 9
Using ICETOOL to List Installation Defaults
18
Control Statement Format . . . . . . . . 84
Continuation Line Format. . . . . . . . 86
Sample Records . . . . . . . . . . . 110
OUTFIL Processing Order . . . . . . . 230
Examples of Notation for Binary Fields
444
JOINKEYS Application Processing . . . . 458
Examples of DFSORT Input/User
Exit/Output Logic . . . . . . . . . . 489
E18 User Exit Example . . . . . . . . 507
E38 User Exit Example . . . . . . . . 517
E39 User Exit Example . . . . . . . . 518
E15 User Exit Example . . . . . . . . 519
E16 User Exit Example . . . . . . . . 519
E35 User Exit Example . . . . . . . . 520
E61 User Exit Example . . . . . . . . 521
E15 DFSORT Interface with COBOL . . . . 525
LINKAGE SECTION Code Example for E15
(Fixed-Length Records) . . . . . . . . 526
LINKAGE SECTION Code Example for E15
(Variable-Length Record). . . . . . . . 526
E35 Interface with COBOL . . . . . . . 531
LINKAGE SECTION Code Example for E35
(Fixed-Length Records) . . . . . . . . 532
LINKAGE SECTION Code Example for E35
(Variable-Length Records) . . . . . . . 532
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
536
537
545
551
555
560
561
567
722
726
727
768
769
770
775
778
787
789
791
794
795
804
ix
Tables
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
Related documents . . . . . . . . .
Referenced documents . . . . . . . .
Options That Can Ease Migration . . . .
FILSZ Variations Summary. . . . . . .
Aliases for MSGPRT/MSGCON Options
Aliases for PARM Options . . . . . .
DD Statement Parameters Used by DFSORT
DCB Subparameters Used by DFSORT . .
Compare Field Formats and Lengths
Permissable Field-to-Field Comparisons for
INCLUDE/OMIT (Group 1) . . . . .
Permissable Field-to-Field Comparisons for
INCLUDE/OMIT (Group 2) . . . . .
Permissible Field-to-Constant Comparisons
for INCLUDE/OMIT . . . . . . . .
Valid and Invalid Decimal Constants
Decimal Numbers for Current Date . . .
Decimal Numbers for Future Dates . . .
Decimal Numbers for Past Dates . . . .
Valid and Invalid Character String Constants
Valid and Invalid Strings with Double-Byte
Data . . . . . . . . . . . . .
Character Strings for Current Date . . .
Character Strings for Future Dates . . .
Character Strings for Past Dates . . . .
Valid and Invalid Hexadecimal Constants
Bit Comparison Example 2: Results for
Selected Field Values . . . . . . . .
Bit Comparison Example 3: Results for
Selected Field Values . . . . . . . .
Bit Comparison Example 2: Results for
Selected Field Values . . . . . . . .
Bit Comparison Example 3: Results for
Selected Field Values . . . . . . . .
Permissible Comparisons for Dates . . .
Logic Table for INCLUDE/OMIT. . . . .
Examples of Valid and Invalid Column
Alignment . . . . . . . . . . .
Examples of Valid and Invalid Blank
Separation . . . . . . . . . . .
Examples of Valid and Invalid Binary Zero
Separation . . . . . . . . . . .
Examples of Valid and Invalid Character
String Separation . . . . . . . . .
Examples of Valid and Invalid Hexadecimal
String Separation . . . . . . . . .
Example of DYNSPC Primary Space . . .
FILSZ Variations Summary . . . . . .
SIZE Variations Summary . . . . . .
SDB=LARGE Block Sizes for Tape Output
Data Sets . . . . . . . . . . . .
Aliases for OPTION Statement Options
Current date constants . . . . . . .
Future Date Constants . . . . . . .
Past Date Constants . . . . . . . .
Current time constants . . . . . . .
. xiv
. xv
. 24
. 42
47
. 60
61
. 62
100
. 101
. 101
. 102
103
. 103
. 104
. 104
104
.
.
.
.
105
105
106
107
107
. 114
. 115
. 116
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
. 117
. 119
. 124
74.
. 130
75.
. 131
76.
. 131
77.
. 131
78.
.
.
.
.
132
184
189
189
79.
80.
81.
82.
. 204
219
. 258
. 259
. 260
. 261
83.
84.
85.
86.
266
267
269
271
273
274
274
280
284
286
287
287
288
291
295
296
348
445
452
491
491
494
495
501
501
511
511
514
514
538
538
538
538
539
539
539
548
553
568
569
571
601
602
724
xi
xii
773
784
785
797
801
855
859
860
860
867
875
883
897
898
900
901
903
xiii
v Chapter 9, Using extended function support, on page 767, explains how to use
the Extended Function Support (EFS) interface to tailor control statements, to
handle user-defined data types and collating sequences, and to have DFSORT
issue customized informational messages during processing.
v Chapter 10, Improving efficiency, on page 799, recommends ways with which
you can maximize DFSORT processing efficiency. This chapter covers a wide
spectrum of improvements you can make, from designing individual
applications for efficient processing at your site to using DFSORT features such
as Hipersorting, dataspace sorting, and ICEGENER.
v Chapter 11, Examples of DFSORT job streams, on page 819, contains annotated
example job streams for sorting, merging, and copying records.
v Appendix A, Using work space, on page 853, explains main storage
considerations and how to estimate the amount of intermediate storage you
might require when sorting data.
v Appendix B, Specification/override of DFSORT options, on page 863, contains
a series of tables you can use to find the order of override for similar options
that are specified in different sources.
v Appendix C, Data format descriptions, on page 891, gives examples of the
assembled data formats.
v Appendix D, EBCDIC and ASCII collating sequences, on page 901, lists the
collating sequences from low to high order for EBCDIC and ASCII characters.
v Appendix E, DFSORT abend processing, on page 907, describes the ESTAE
recovery routine for processing abends, and the Checkpoint/Restart facility.
v Notices on page 915, includes the notices, Programming Interface information,
and the trademark list.
xiv
SC23-6879
SA23-1385
SA23-1386
SC23-6855
SC23-6858
Referenced documents
This document refers to the following documents:
Table 2. Referenced documents
Order number
z/OS DFSMSdfp Checkpoint/Restart
SC23-6862
SC23-6852
SC23-6855
SA23-1385
SA23-1386
SA23-1370
SA23-1368
SA23-2279
Order Number
SC23-6879
Tuning DFSORT
SC23-6882
z/OS information
This information explains how z/OS references information in other documents
and on the web.
When possible, this information uses cross document links that go directly to the
topic in reference using shortened versions of the document title. For complete
titles and order numbers of the documents for all products that are part of z/OS,
see z/OS Information Roadmap.
To find the complete z/OS library, go to IBM Knowledge Center
(http://www.ibm.com/support/knowledgecenter/SSLTBW/welcome).
xv
Notational conventions
The syntax diagrams in this document are designed to make coding DFSORT
program control statements simple and unambiguous. The lines and arrows
represent a path or flowchart that connects operators, parameters, and delimiters in
the order and syntax in which they must appear in your completed statement.
Construct a statement by tracing a path through the appropriate diagram that
includes all the parameters you need, and code them in the order that the diagram
requires you to follow. Any path through the diagram gives you a correctly coded
statement, if you observe these conventions:
v Read the syntax diagrams from left to right and from top to bottom.
v Begin coding your statement at the spot marked with the double arrowhead.
v A single arrowhead at the end of a line indicates that the diagram continues on
the next line or at an indicated spot.
xvi
Notational Conventions
A continuation line begins with a single arrowhead.
Optional
v Where you can make one choice between two or more parameters, the
alternatives are stacked vertically.
Operator
Required Choice 1
Required Choice 2
Required Choice 3
Optional Choice 1
Optional Choice 2
If one choice within the stack lies on the main path (as in this example, left), you
must specify one of the alternatives. If the stack is placed below the main path
(as in this example, right), then selections are optional, and you can choose
either one or none of them.
v The repeat symbol shows where you can return to an earlier position in the
syntax diagram to specify a parameter more than once (see the first example
later in this section), to specify more than one choice at a time from the same
stack (see the second example later in this section), or to nest parentheses (see
the third example later in this section).
a,b,c
Choice-1
Choice-2
Choice-3
Do not interpret a repeat symbol to mean that you can specify incompatible
parameters. For instance, do not specify both ABEND and NOABEND in the
same EXEC statement, or attempt to nest parentheses incorrectly.
Use any punctuation or delimiters that appear within the repeat symbol to
separate repeated items.
v A double arrowhead at the end of a line indicates the end of the syntax diagram.
xvii
Notational Conventions
xviii
xix
xx
Summary of changes
Summary of changes for SC23-6878-01 z/OS Version 2 Release 2
This document contains information that was previously presented in z/OS
DFSORT Application Programming Guide, SC28-6878-00, which supported z/OS
Version 2 Release 1.
The following sections summarize the changes to that information.
The message ICE099A is enhanced to list the failing member name in case of an
error. Any automated actions based on the presence of this message should be
evaluated.
The text for existing DFSORT messages ICE000I and ICE288I has been changed.
Any automated actions based on the presence of these messages should be
evaluated.
New information
This edition includes the following new enhancements:
Date functions
Two new date functions to calculate the week number of a given date and Age as
date duration are added.
WEEKNUM function converts a given Julian/Gregorian date to number of week.
There are 2 versions of this function, the standard USA format and the ISO format.
WEEKNUM=USA function returns an integer in the range of 1 to 54 that
represents the week of the year. The week starts with Sunday, and January 1 is
always in the first week.
WEEKNUM=ISO function returns an integer in the range of 1 to 53 that represents
the week of the year. The week starts with Monday and includes 7 days. Week 1 is
the first week of the year to contain a Thursday, which is equivalent to the first
week containing January 4.
AGE function returns a date duration that specifies the number of years, months,
and days between an input date and current date.
Age=YMD produces an 8-byte result which has duration in years (0-9999), months
(00-12), and days (00-31).
Age=YM produces a 6-byte result which has duration in years (0-9999), months
(00-12).
xxi
Age=YD produces a 7-byte result which has duration in years (0-9999), days
(00-366).
Message changes
The text for existing DFSORT messages has been changed. Any automated actions
based on the presence of these messages should be evaluated.
ICE000I
ICE099A
ICE121A
ICE288I
New information
This edition includes the following new enhancements:
64-bit support
Eligible user programs and exits can now be written to:
v Call DFSORT from a program in 64-bit addressing mode (AMODE 64) using a
new 64-bit parameter list and the entry name ICEMAN64 or SORT64
v Use DFSORT E15, E35 and E32 exits running in 64-bit addressing mode
(AMODE 64)
v Pass 64-bit addressed records to DFSORT using new 64-bit parameter lists for
E15, E32 and E35 exits.
xxii
A new TUNE installation default allows you to specify whether DFSORT should
allocate storage in increments with additional disk work space to minimize the risk
of failure, or to allocate all storage at initialization so disk work space allocation
can be reduced.
Blockset merge applications can now use storage above 16 MB virtual with more
functions (such as E61, INREC, OUTREC, INCLUDE, OMIT and SUM), providing
improved performance and virtual storage constraint relief.
You can use these new keywords in the following comparison operands: COND,
INCLUDE, OMIT, BEGIN, END, WHEN and TRLID.
Summary of changes
xxiii
Symbol enhancements
DFSORT Symbols can now be used for many more operands. The following
operands of the form KEYWORD=n can now be specified as KEYWORD=symbol
where symbol represents an equivalent number (for example, if you have
New_Length,25 in SYMNAMES, you can use LENGTH=New_Length wherever
you can use LENGTH=25): ABSPOS, ACCEPT, ADDPOS, AVGRLEN, DO,
ENDPOS, ENDREC, FIXLEN, ID, IFOUTLEN, INCR, LENGTH, LINES, MAXLEN,
RECORDS, REPEAT, SAMPLE, SEQ, SKIPREC, SPLIT1R, SPLITBY, START,
STARTPOS, STARTREC, STOPAFT and SUBPOS.
A symbol for a number can now be used for the length of the output field with the
CHANGE operand, and for the length of the sequence number with the SEQNUM
operand.
A symbol can be used for any of the new %000-%999 parsed fields.
A symbol can be used for string with the new VLTRAIL=string operand.
Improved diagnostics
DFSORT now provides specific reason codes and associated documentation to aid
in diagnosing and correcting errors associated with messages ICE083A and
ICE141A.
The text for message ICE118I has been changed to recommend the use of
FILSZ=En.
The ICE236I options-in-effect message now includes values for TUNE, EXPMAX,
EXPOLD and EXPRES.
The text for message ICE285A has been changed for clarification.
xxiv
Message changes
The text for existing DFSORT messages ICE000I, ICE083A, ICE118I, ICE141A,
ICE236I and ICE285A has been changed. Any automated actions based on the
presence of these messages should be evaluated.
Summary of changes
xxv
xxvi
DFSORT Overview
v
v
left-squeeze (remove leading blanks or all blanks and shift left), and right-justify
or right-squeeze (remove trailing blanks or all blanks and shift right).
Sophisticated editing capabilities, such as control of the way numeric fields are
presented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs, and
so on.
Twenty-seven pre-defined editing masks are available for commonly used
numeric editing patterns, encompassing many of the numeric notations used
throughout the world. In addition, a virtually unlimited number of numeric
editing patterns are available via user-defined editing masks.
Transformation of SMF, TOD, and ETOD date and time values to more usable
forms.
Conversion of input date fields of one type (CH, ZD, PD, 2-digit year, 4-digit
year, Julian, Gregorian) to corresponding output date fields of another type or to
a corresponding day of the week.
Various types of arithmetic operations for input date fields.
DFSORT Overview
null-terminated strings (and many other types), you define rules that allow
DFSORT to extract the relevant data into fixed parsed fields, and then use the
parsed fields as you would use fixed fields.
Insertion of blanks, zeros, strings, current date, future date, past date, current
time, sequence numbers, decimal constants, and the results of arithmetic
expressions before, between, and after the input fields in the reformatted
records.
Sophisticated conversion capabilities, such as find and replace, hexadecimal
display, bit display, translation of EBCDIC letters from lowercase to uppercase
or uppercase to lowercase, translation of characters from EBCDIC to ASCII or
from ASCII to EBCDIC, translation of characters using the ALTSEQ
translation table, conversion of numeric values from one format to another,
left-justify or left-squeeze (remove leading blanks or all blanks and shift left),
and right-justify or right-squeeze (remove trailing blanks or all blanks and
shift right).
Sophisticated editing capabilities, such as control of the way numeric fields
are presented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs,
and so on.
Twenty-seven pre-defined editing masks are available for commonly used
numeric editing patterns, encompassing many of the numeric notations used
throughout the world. In addition, a virtually unlimited number of numeric
editing patterns are available via user-defined editing masks.
Transformation of SMF, TOD, and ETOD date and time values to more usable
forms.
Conversion of input date fields of one type (CH, ZD, PD, 2-digit year, 4-digit
year, Julian, Gregorian) to corresponding output date fields of another type or
to a corresponding day of the week.
Various types of arithmetic operations for input date fields.
Selection of a character constant, hexadecimal constant, or input field from a
lookup table for output, based on a character, hexadecimal, or bit string as
input (that is, lookup and change).
v Creation of the reformatted records in one of the following ways:
By building the entire record one item at a time.
v
v
v
You can perform various "join" operations on two files by one or more keys. A
JOINKEYS application allows you to create joined records in a variety of ways
including inner join, full outer join, left outer join, right outer join and unpaired
Chapter 1. Introducing DFSORT
DFSORT Overview
combinations. The two input files can be of different types (fixed, variable, VSAM,
and so on) and have keys in different locations. The records from the two input
files can be processed in a variety of ways before and after they are joined.
You can control DFSORT functions with other control statements by specifying
alternate collating sequences, invoking user exit routines, overriding installation
defaults, and so on.
You can direct DFSORT to pass control during run time to routines you design
and write yourself. For example, you can write user exit routines to summarize,
insert, delete, shorten, or otherwise alter records during processing. However, keep
in mind that the extensive editing capabilities provided by the INCLUDE, OMIT,
INREC, OUTREC, SUM, and OUTFIL statements can eliminate the need to write
user exit routines. You can write your own routines to correct I/O errors that
DFSORT does not handle, or to perform any necessary abnormal end-of-task
operation before DFSORT terminates.
You can write an EFS (Extended Function Support) program to intercept DFSORT
control statements and PARM options for modification prior to use by DFSORT or
to provide alternate sequence support for user-defined data.
You can define and use a symbol for any field, constant, or output column that is
recognized in a DFSORT control statement or ICETOOL operator. This makes it
easy to create and reuse collections of symbols (that is, mappings) representing
information associated with various record layouts. You can use system symbols
(for example, &JOBNAME.) in your symbol constants. You can use SET and PROC
symbols in your symbol constants. See Chapter 8, Using symbols for fields and
constants, on page 731.
Invoking DFSORT
You can invoke DFSORT processing in the following ways:
v With an EXEC job control statement in the input stream using the name of the
program (for example, PGM=ICEMAN or PGM=SORT) or the name of a
cataloged procedure (for example, SORTD). See Chapter 2, Invoking DFSORT
with Job Control Language, on page 27.
TSO users can allocate the needed ddnames (for example, SYSOUT, SORTIN,
SORTOUT and SYSIN), and invoke DFSORT using a calling method equivalent
to PGM=ICEMAN. For example:
call *(iceman)
or any other alias for DFSORT (for example, SORT) in this form.
Invoking DFSORT
See Chapter 11, Examples of DFSORT job streams, on page 819 for examples of
invoking DFSORT from REXX and CLISTs.
v With a program written in basic assembler language using a system macro
instruction. See Chapter 6, Invoking DFSORT from a program, on page 541.
v With programs written in either COBOL or PL/I with a special facility of the
language. See the programmer's guide describing the compiler version available
at your location.
v With the ICETOOL utility. See Chapter 7, Using ICETOOL, on page 563.
In this document, the term directly invoked means that DFSORT is not initiated from
another program. The term program invoked means that DFSORT is initiated from
another program.
Operating systems
DFSORT runs under control of your z/OS operating system and must be initiated
according to the appropriate conventions.
Additionally, DFSORT runs under z/OS when it is running as a guest under
z/VM.
DFSORT is compatible with all of the IBM processors supported by z/OS. In
addition to any device supported by z/OS for program residence, DFSORT also
operates with any device QSAM or VSAM uses for input or output.
Control
field 3
Control
field 4
Control field 1
(major)
Control
field 2
Figure 1. Control Fields. Control fields may overlap, or be contained within other control fields.
DFSORT offers several standard collating sequences. You can choose to arrange your
records according to these standard collating sequences or according to a collating
sequence defined in the active locale. Conceptually, a collating sequence is a
specific arrangement of character priority used to determine which of two values
in the same control field of two different records should come first. DFSORT uses
EBCDIC, the standard IBM collating sequence, or the ASCII collating sequence
when sorting or merging records. If locale processing is in effect, DFSORT will use
the collating sequence defined in the active locale.
The collating sequence for character data and binary data is absolute; character and
binary fields are not interpreted as having signs. For packed decimal, zoned
decimal, fixed-point, normalized floating-point, and the signed numeric data
formats, collating is algebraic; each quantity is interpreted as having an algebraic
sign.
You can modify the standard EBCDIC sequence to collate differently if, for
example, you want to allow alphabetic collating of national characters. An alternate
collating sequence can be defined with the ALTSEQ installation option, or you can
define it yourself at run-time with the ALTSEQ program control statement. You can
also specify a modified collating sequence with an E61 user exit or with an EFS
program.
DFSORT processing
You must prepare job control language (JCL) statements and DFSORT program
control statements to invoke DFSORT processing. JCL statements (see Chapter 6,
Invoking DFSORT from a program, on page 541) are processed by your
operating system. They describe your data sets to the operating system and initiate
DFSORT processing. DFSORT program control statements (see Chapter 3, Using
DFSORT program control statements, on page 81) are processed by the DFSORT
program. They describe the functions you want to perform and invoke the
processing you request.
A sort application usually requires intermediate storage as working space during
the program run. This storage can be one of the following:
1. Hiperspace, using DFSORT's Hipersorting feature.
2. Work data setseither allocated dynamically by DFSORT's DYNALLOC facility
or specified by the user, using JCL DD statements. If specified by the user, the
intermediate storage devices and the amount of work space must be indicated.
Methods for determining the amount of work space to allocate are explained in
Appendix A, Using work space, on page 853.
Chapter 1. Introducing DFSORT
DFSORT Processing
3. A combination of Hiperspace and work data sets.
Merge and copy applications do not require intermediate storage.
Figure 2 on page 9 illustrates the processing order for record handling, exits,
statements, and options. Use this diagram with the text following it to understand
the order DFSORT uses to run your job.
DFSORT Processing
DFSORT Processing
1. DFSORT first checks whether you supplied a SORTIN data set for SORT and
COPY jobs or SORTINnn data sets for MERGE jobs. If so, DFSORT reads the
input records from them.
v If no SORTIN data set is present for a SORT or COPY job, you must use an
E15 user exit to insert all the records. (This is also true if you invoke
DFSORT from a program with the address of an E15 user exit in the
parameter list, because SORTIN will be ignored.) DFSORT can use a
COBOL E15 routine if you specified the E15 user exit in the MODS
statement.
v If no SORTINnn data sets are present for a MERGE job, you must use an
E32 user exit to insert all the records.
2. If input records for SORT or COPY jobs are read from a SORTIN data set,
DFSORT performs processing specified with the SKIPREC option. DFSORT
deletes records until the SKIPREC count is satisfied. Eliminating records
before a SORT or COPY gives better performance.
3. If the input records for a SORT or COPY job are read from a SORTIN data set,
DFSORT checks whether you specified an E15 user exit. If so, DFSORT
transfers control to the user exit routine. You can use a COBOL E15 routine if
the E15 user exit is specified in the MODS statement. The E15 routine can
insert, delete, or reformat records.
4. DFSORT performs processing specified on an INCLUDE or OMIT statement.
If you used an E15 user exit routine to reformat the records, the
INCLUDE/OMIT fields you specify must apply to the current format rather
than to the original format. If you use the INCLUDE or OMIT statements to
delete unnecessary records before SORT, MERGE, or COPY processing, your
jobs run more efficiently.
5. For SORT or COPY jobs, DFSORT performs processing specified with the
STOPAFT option. Record input stops after the maximum number of records
(n) you specify have been accepted. DFSORT accepts records for processing if
they are:
v Read from SORTIN or inserted by E15
v Not deleted by SKIPREC
v Not deleted by E15
v Not deleted by an INCLUDE or OMIT statement.
6. DFSORT performs processing specified in an INREC statement. Data records
are parsed, edited and reformatted according to the options specified. If you
reformatted the records before this step, the INREC fields you specify must
apply to the current format rather than to the original format.
7. DFSORT performs processing specified in the SORT, MERGE, or OPTION
COPY statement.
v For SORT, all input records are processed before any output record is
processed.
v For COPY or MERGE, an output record is processed after an input record is
processed.
v For SORT or MERGE, if a SUM statement is present, DFSORT processes it
during the SORT or MERGE processing. DFSORT summarizes the records
and deletes duplicates. If you reformatted the records before this step, the
SORT or MERGE and SUM fields you specify must apply to the current
format rather than to the original format.
8. DFSORT performs processing specified in an OUTREC statement. Data
records are parsed, edited and reformatted according to the options specified.
10
DFSORT Processing
If you reformatted the records before this step, the OUTREC fields you specify
must apply to the current format rather than to the original format.
9. If an E35 user exit is present, DFSORT transfers control to your user exit
routine after all statement processing (except OUTFIL) is completed. If you
reformatted the records, the E35 user exit receives the records in the current
format rather than in the original format. You can use a COBOL E35 routine if
you specify the E35 user exit in the MODS statement. You can use the E35 exit
routine to add, delete, or reformat records.
If SORTOUT and OUTFIL data sets are not present, the E35 exit must dispose
of all the records because DFSORT treats these records as deleted. (This is also
true if you do not specify OUTFIL data sets and DFSORT is invoked with the
address of an E35 user exit in the parameter list, because SORTOUT will be
ignored.)
10. DFSORT writes your records to the SORTOUT data set, if present.
11. DFSORT performs processing specified in one or more OUTFIL statements, if
present:
v DFSORT performs processing specified with the STARTREC, SAMPLE, and
ENDREC options. Record input for the OUTFIL data sets starts with the
record indicated by STARTREC, ends with the record indicated by
ENDREC, and is sampled according to the records indicated by SAMPLE.
v DFSORT performs processing specified with the INCLUDE, OMIT, or SAVE
option. Records are included or omitted from the OUTFIL data sets
according to the criteria specified.
v DFSORT performs processing specified with the ACCEPT option. Record
processing ends when the ACCEPT limit is reached.
v DFSORT performs processing specified with the PARSE, OUTREC (or
BUILD), OVERLAY, FINDREP, IFTHEN, FTOV, VTOF (or CONVERT),
VLFILL, VLTRIM, VLTRAIL and REPEAT options. Data records are parsed,
edited, reformatted, converted and repeated according to the options
specified.
v DFSORT performs processing specified with the LINES, HEADER1,
TRAILER1, HEADER2, TRAILER2, SECTIONS, NODETAIL, BLKCCH1,
BLKCCH2, BLKCCT1 and REMOVECC options. Data records are
reformatted and report records are generated for the OUTFIL data sets.
v DFSORT performs SPLIT, SPLITBY, or SPLIT1R processing. Records are
distributed among the OUTFIL data sets as evenly as possible.
v DFSORT writes your OUTFIL records to the appropriate OUTFIL data sets.
11
12
Merging records
Input to a merge application can be up to 100 blocked or unblocked QSAM or
VSAM data sets containing fixed- or variable-length records. The input data sets
can be either QSAM or VSAM, but not both. The records in all input data sets
must already be sorted in the same order as that required for output.
Output from a merge application can be blocked or unblocked QSAM or VSAM
data sets, regardless of whether the input is QSAM or VSAM. Unless OUTFIL is
used to convert variable input to fixed output, or fixed output to variable output,
an output data set must be the same type (fixed or variable) as the input data set.
Files in a z/OS file system are supported as input and output for merge
applications.
General considerations
Variable-length records are processed with a record descriptor word (RDW) in
positions 1-4, so the data starts in position 5. Fixed-length records are processed
without an RDW, so the data starts in position 1. Control statement positions
should be specified accordingly.
Your records can be EBCDIC, ASCII, Japanese, and data types you define yourself.
To process Japanese data types with DFSORT, you can use the IBM Double Byte
Character Set Ordering Support Program (DBCS Ordering), Licensed Program
5665-360, Release 2.0, or you can use locale processing with the appropriate locale.
Input and output data sets must be on devices that can be used with QSAM or
VSAM.
Standard system data management rules apply to all data set processing. In
particular:
v Be aware that when using fixed standard record format for input data sets, the
first short block is treated like an End of Volume. See z/OS DFSMS Using Data
Sets for more details.
v Be aware that, in some cases, if a DD statement specifies a data set for output
that is extended to a second or subsequent volume, and another DD statement
within the same step requests the same data set, only the records on the first
volume will be read, and incorrect output will result.
Specifically, when a new output data set is allocated with a unit count and
volume count greater than one, but specifies no volume serial numbers, one
volume is allocated. If a second or succeeding DD statement within the same
step requests the same data set, the same volume is allocated to it. If this job
step extends the output data set to more volumes, this new volume information
is not available to the second or succeeding DD statement.
13
14
QSAM considerations
v If you use DSN=NULLFILE on your DD statement for an input data set, a
system restriction prevents DFSORT from using the EXCP access method.
v Empty input data sets can be used.
v If any of the input data sets are on tape without standard labels, DCB
parameters must be specified on their DD statements.
v ISO/ANSI Version 1 tape files can only be used as inputnever as output.
v DFSORT sets appropriate BUFNO values for the input and output data sets;
specifying BUFNO in the DD statements for these data sets has no effect.
See SORTIN DD statement on page 67 for additional considerations.
VSAM considerations
v You can have DFSORT process VSAM records as fixed-length (F) or
variable-length (V). When you use VSAM input, DFSORT selects fixed-length
processing if you specify RECORD TYPE=F or variable-length processing if you
specify RECORD TYPE=V. If you do not specify RECORD TYPE=x, DFSORT
selects the record type to use according to the "rules" described in the discussion
of the TYPE operand in RECORD control statement on page 438. The record
type selected affects how the records are treated, and how control statement
positions should be specified, as follows:
Variable-length processing: An RRDS, KSDS, ESDS or VRRDS can always be
processed as variable-length. For VSAM input, DFSORT reads each record
and prepends a record descriptor word (RDW) to it. For VSAM output,
DFSORT removes the RDW before writing each record. Since DFSORT uses
an RDW in positions 1-4 to process variable-length records, the data starts in
position 5. Control statement positions should be specified accordingly.
Fixed-length processing: An RRDS can always be processed as fixed-length.
A KSDS, ESDS or VRRDS used for input should only be processed as
fixed-length if all of its records have a length equal to the maximum record
size defined for the cluster. Otherwise, input records which are shorter than
the maximum record size are padded with bytes that may or may not be
zeros (that is, "garbage" bytes). DFSORT does not use an RDW to process
fixed-length records, so the data starts in position 1. Control statement
positions should be specified accordingly.
v If a data set is password protected, passwords can be entered at the console or
(with some restrictions) through routines at user exits E18, E38, and E39.
Chapter 1. Introducing DFSORT
15
v
v
v
v
v
v
Note: Passwords cannot be handled in this way for OUTFIL data sets.
If VSAMIO and RESET are in effect, a data set defined with REUSE can be used
for both input and output for a sort; that is, the data set can be sorted in-place.
A data set used for input or output must have been previously defined.
If VSAMEMT is in effect, an empty input data set is processed as having zero
records.
VSAM data sets must not be concatenated (system restriction).
VSAM and non-VSAM input data sets must not be specified together for a sort,
merge or copy application.
If output is a VSAM key-sequenced data set (KSDS), the key must be the first
control field (or the key fields must be in the same order as the first control
field). VSAM does not allow you to store records with duplicate primary keys.
Any VSAM exit function available for input data sets can be used except
EODAD. See the description of E18 use with VSAM in Chapter 5, Using your
own user exit routines, on page 487.
You must build the VSAM exit list with the VSAM EXLST macro instruction
giving the addresses of your routines that handle VSAM exit functions.
v
v When processing variable-length records with VSAM input and non-VSAM
output, the output LRECL must be at least 4 bytes greater than the maximum
record size defined for the cluster. Non-VSAM variable-length records have a
record descriptor word (RDW) field 4 bytes long at the beginning of each record,
but VSAM records do not. The record size defined for the VSAM cluster is
therefore 4 bytes less than the non-VSAM LRECL.
v An output data set defined without REUSE is processed as MOD.
v If RESET is in effect, an output data set defined with REUSE is processed as
NEW. If NORESET is in effect, an output data set defined with REUSE is
processed as MOD.
v DFSORT cannot access VSAM data sets in RLS mode, that is, RLS=CR and
RLS=NRI are not supported for VSAM input and output data sets.
16
Installation defaults
When your system programmers installed DFSORT, they selected separate sets of
installation defaults for the following eight installation environments:
ICEAM1 (JCL)
is the batch direct invocation environment. This set of installation defaults
is used at run time when DFSORT is invoked directly (that is, not through
programs) by batch jobs, provided that an enabled time-of-day installation
environment (ICETDx) is not activated.
ICEAM2 (INV)
is the batch program invocation environment. This set of installation
defaults is used at run time when DFSORT is invoked through batch
programs, provided that an enabled time-of-day installation environment
(ICETDx) is not activated.
ICEAM3 (TSO)
is the TSO direct invocation environment. This set of installation defaults is
used at run time when DFSORT is invoked directly (that is, not through
programs) by foreground TSO users, provided that an enabled time-of-day
installation environment (ICETDx) is not activated.
ICEAM4 (TSOINV)
is the TSO program invocation environment. This set of installation
defaults is used at run time when DFSORT is invoked through programs
by foreground TSO users, provided that an enabled time-of-day installation
environment (ICETDx) is not activated.
ICETD1 (TD1)
is the first time-of-day installation environment. This set of installation
defaults is used at run time when it is activated for the time-of-day of the
run, provided it is enabled by the installation environment (ICEAMx) in
effect.
ICETD2 (TD2)
is the second time-of-day installation environment. This set of installation
defaults is used at run time when it is activated for the time-of-day of the
run, provided it is enabled by the installation environment (ICEAMx) in
effect.
ICETD3 (TD3)
is the third time-of-day installation environment. This set of installation
defaults is used at run time when it is activated for the time-of-day of the
run, provided it is enabled by the installation environment (ICEAMx) in
effect.
ICETD4 (TD4)
is the fourth time-of-day installation environment. This set of installation
defaults is used at run time when it is activated for the time-of-day of the
run, provided it is enabled by the installation environment (ICEAMx) in
effect.
The selected installation defaults can affect the way your applications run, and in
many cases can be overridden by specifying the appropriate run-time parameters
(see Appendix B, Specification/override of DFSORT options, on page 863 for full
17
Installation Defaults
override details). This document assumes that DFSORT is running with the
installation defaults it was delivered with (that is, with the IBM-supplied
installation defaults).
You can use an ICETOOL job similar to the following one to display a report of the
installation defaults to be used at run-time.
//DFRUN JOB A402,PROGRAMMER
//LISTDEF EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=A
//DFSMSG DD SYSOUT=A
//SHOWDEF DD SYSOUT=A
//TOOLIN DD *
DEFAULTS LIST(SHOWDEF)
/*
Figure 3. Using ICETOOL to List Installation Defaults
See Chapter 7, Using ICETOOL, on page 563 and DEFAULTS operator on page
590 for more information on using ICETOOL and the DEFAULTS operator.
The functions of the available installation options are summarized later in this
section. z/OS DFSORT Installation and Customization contains complete descriptions
of the available installation options, as well as planning considerations and general
information about installing DFSORT. Step-by-step installation procedures are
listed in the z/OS Install/Migration page (http://www.ibm.com/systems/z/os/
zos/installation/).
Parameter
Function
INV|JCL|TSO|TSOINV|TD1|TD2|TD3|TD4
Specifies the invocation installation environment (ICEAMx) or time-of-day
installation environment (ICETDx) for which this set of installation defaults
is to be used.
ENABLE
Specifies whether ICETDx installation defaults are to be used if activated
for this ICEAMx installation environment.
day
Specifies the time ranges for each day of the week when this ICETDx
installation environment is to be activated.
ABCODE
Specifies the ABEND code used when DFSORT abends for a critical error.
ALTSEQ
Specifies changes to the ALTSEQ translation table.
ARESALL
Specifies the number of bytes reserved above 16MB virtual for system use.
ARESINV
Specifies the number of bytes reserved above 16MB virtual for the
invoking program when DFSORT is program invoked.
CFW
Specifies whether DFSORT can use cache fast write when processing work
data sets.
18
Installation Defaults
CHALT
Translates format CH as well as format AQ, or translates format AQ only.
CHECK
Specifies whether record count checking is suppressed for applications that
use an E35 user exit routine without an output data set.
CINV
Specifies whether DFSORT can use control interval access for VSAM data
sets.
COBEXIT
Specifies the library for COBOL E15 and E35 routines.
DIAGSIM
Specifies whether a SORTDIAG DD statement is to be simulated for
DFSORT applications.
DSA
Specifies the maximum amount of storage available to DFSORT for
dynamic storage adjustment of Blockset sort applications.
DSPSIZE
Specifies the maximum amount of data space to use for dataspace sorting.
DYNALOC
Specifies the default values for device name and number of work data sets
to be dynamically allocated. These default values are used in conjunction
with the DYNAUTO installation option and the DYNALLOC run-time
option.
DYNAPCT
Specifies additional work data sets to be dynamically allocated and only
used when needed.
DYNAUTO
Specifies whether work data sets are dynamically allocated automatically.
DYNSPC
Specifies the total default primary space allocation for all of the
dynamically allocated work data sets when the file size is unknown.
EFS
Specifies the name of a user-written Extended Function Support program
to be called by DFSORT.
EQUALS
Specifies whether the order of records that collate identically is preserved
from input to output.
ERET
Specifies the action taken if DFSORT encounters a critical error.
ESTAE
19
Installation Defaults
Specifies whether DFSORT deletes its ESTAE recovery routine early or uses
it for the entire run.
EXITCK
Specifies whether DFSORT terminates or continues when it receives certain
invalid return codes from E15 or E35 user exit routines.
EXPMAX
Specifies the maximum total amount of available storage to be used at any
one time by all Hipersorting, memory object sorting and dataspace sorting
applications.
EXPOLD
Specifies the maximum total amount of old storage to be used at any one
time by all Hipersorting, memory object sorting and dataspace sorting
applications.
EXPRES
Specifies the minimum amount of available storage to be reserved for use
by non-Hipersorting, non-memory object sorting and non-dataspace sorting
applications.
FSZEST
Specifies whether DFSORT treats run-time options FILSZ=n and SIZE=n as
exact or estimated file sizes.
GENER
Specifies the name that ICEGENER is to use to transfer control to the
IEBGENER system utility. (ICEGENER is DFSORT's facility for IEBGENER
jobs.)
GNPAD
Specifies the action to be taken by ICEGENER for LRECL padding.
GNTRUNC
Specifies the action to be taken by ICEGENER for LRECL truncation.
HIPRMAX
Specifies the maximum amount of Hiperspace to use for Hipersorting.
IDRCPCT
Specifies a percentage which represents the approximate amount of data
compaction achieved by using the Improved Data Recording Capability
feature of IBM tape devices that support compaction.
IEXIT
Specifies whether DFSORT passes control to your site's ICEIEXIT routine.
IGNCKPT
Specifies whether the checkpoint/restart facility is ignored if it is requested
at run-time and the Blockset technique (which does not support the
checkpoint/restart facility) can be used.
IOMAXBF
Specifies an upper limit to the amount of buffer space to be used for
SORTIN, SORTINnn and SORTOUT data sets.
20
Installation Defaults
LIST
Specifies whether DFSORT prints control statements.
LISTX
Specifies whether DFSORT prints control statements returned by an
Extended Function Support program.
LOCALE
Specifies whether locale processing is to be used and, if so, designates the
active locale.
MAXLIM
Specifies an upper limit to the amount of main storage available to
DFSORT below 16MB virtual.
MINLIM
Specifies a lower limit to the amount of main storage available to DFSORT.
MOSIZE
Specifies the maximum amount of memory object storage to use for
memory object sorting.
MOWRK
Specifies whether DFSORT can use memory object storage as intermediate
work space.
MSGCON
Specifies the class of program messages DFSORT writes to the master
console.
MSGDDN
Specifies an alternate name for the message data set.
MSGPRT
Specifies the class of program messages DFSORT writes to the message
data set.
NOMSGDD
Specifies whether DFSORT terminates or continues when the message data
set is required but is not available.
NULLOFL
Specifies the action to be taken by DFSORT when there are no data records
for an OUTFIL data set.
NULLOUT
Specifies the action to be taken by DFSORT when there are no records for
the SORTOUT data set.
ODMAXBF
Specifies an upper limit to the amount of buffer space to be used for each
OUTFIL data set.
OUTREL
Specifies whether unused temporary output data set space is released.
Chapter 1. Introducing DFSORT
21
Installation Defaults
OUTSEC
Specifies whether DFSORT uses automatic secondary allocation for output
data sets that are temporary or new.
OVERRGN
Specifies the amount of main storage above the REGION value available to
Blockset.
OVFLO
Specifies the action to be taken by DFSORT when BI, FI, PD or ZD
summary fields overflow.
PAD
Specifies the action to be taken by DFSORT for LRECL padding.
PARMDDN
Specifies an alternate ddname for the DFSORT DFSPARM data set.
RESALL
Reserves storage for system and application use when
SIZE/MAINSIZE=MAX is in effect.
RESET
Specifies whether DFSORT processes a VSAM output data set defined with
REUSE as a NEW or MOD data set.
RESINV
Reserves storage for programs invoking DFSORT when
SIZE/MAINSIZE=MAX is in effect.
SDB
Specifies whether DFSORT should use the system-determined optimum
block size for output data sets when the block size is zero.
SDBMSG
Specifies whether DFSORT and ICETOOL should use the
system-determined optimum block size for message and list data sets
when the block size is zero.
SIZE
Specifies the maximum amount of main storage available to DFSORT.
SMF
Specifies whether DFSORT produces SMF type-16 records.
SOLRF
Specifies whether DFSORT uses the reformatted record length for the
SORTOUT LRECL.
SORTLIB
Specifies whether DFSORT searches a system or private library for the
modules used with a tape work data set sort or Conventional merge.
SPANINC
22
Installation Defaults
Specifies the action to be taken by DFSORT when incomplete spanned
records are detected.
SVC
Specifies a user SVC number for DFSORT.
SZERO
Specifies whether DFSORT treats numeric -0 and +0 values as signed (that
is, different) or unsigned (that is, the same).
TEXIT
Specifies whether DFSORT passes control to your site's ICETEXIT routine.
TMAXLIM
Specifies an upper limit to the total amount of main storage above and
below 16MB virtual available to DFSORT when SIZE/MAINSIZE=MAX is
in effect.
TUNE
Specifies whether DFSORT should favor optimization of central storage or
disk work space for sort applications.
TRUNC
Specifies the action to be taken by DFSORT for LRECL truncation.
VERIFY
Specifies whether the sequence of output records is verified.
VIO
Specifies whether virtual allocation of work data sets is accepted.
VLLONG
Specifies whether DFSORT truncates long variable-length output records.
VLSCMP
Specifies whether DFSORT pads short variable-length compare fields.
VLSHRT
Specifies whether DFSORT continues processing if a short variable-length
control field, compare field or summary field is found.
VSAMBSP
Specifies the number of VSAM buffers DFSORT can use.
VSAMEMT
Specifies whether DFSORT accepts an empty VSAM input data set.
VSAMIO
Specifies whether DFSORT allows a VSAM data set defined with REUSE to
be sorted in-place.
WRKREL
Specifies whether unused temporary work data set space is released.
WRKSEC
23
Installation Defaults
Specifies whether DFSORT uses automatic secondary allocation for
temporary work data sets.
Y2PAST
Specifies the sliding or fixed century window.
ZDPRINT
Specifies whether DFSORT produces printable numbers from positive ZD
fields that result from summarization.
Tables showing all the possible sources of specification and order of override for
each option are shown in Appendix B, Specification/override of DFSORT
options, on page 863.
DYNALLOC=(d,n)
DYNAPCT=x/OLD
DYNAPCT=x/OLD
DYNAUTO=YES/IGNWKDD/NO
DYNALLOC=(d,n)
DYNSPC=n
DYNSPC=n
EQUALS=YES/NO/VBLKSET
EQUALS/NOEQUALS
EXITCK=STRONG/WEAK
EXITCK=STRONG/WEAK
FSZEST=YES/NO
FILSZ=n/En/Un
NOMSGDD=QUIT/ALL/CRITICAL/NONE
PARMDDN=ddname
RESET=YES/NO
RESET/NORESET
SORTLIB=SYSTEM/PRIVATE
24
SZERO=YES/NO
SZERO/NOSZERO
VLLONG=YES/NO
VLLONG/NOVLLONG
VLSCMP=YES/NO
VLSCMP/NOVLSCMP
VSAMEMT=YES/NO
VSAMEMT/NVSAMEMT
VSAMIO=YES/NO
VSAMIO/NOVSAMIO
ZDPRINT=YES/NO
ZDPRINT/NZDPRINT
16
20
24
25
Wrong entry name. DFSORT detected one of the following errors related to
the program entry name that prevented it from completing successfully:
v DFSORT was invoked directly with PGM=ICEMAN64 or PGM=SORT64
(instead of with PGM=ICEMAN or PGM=SORT).
v DFSORT was invoked from a program using entry name ICEMAN64 or
SORT64, and an extended invocation parameter list, or a 24-bit
invocation parameter list (instead of a 64-bit invocation parameter list).
v DFSORT was invoked from a program using an entry name other than
ICEMAN64 or SORT64 (for example, ICEMAN or SORT) and a 64-bit
invocation parameter list.
If possible and appropriate, remove the obstacle that is causing Blockset not to be
selected.
26
//JOBLIB DD
Defines your program link library if it is not already known to the system
//STEPLIB DD
Same as //JOBLIB DD
//SORTLIB DD
Defines the data set that contains special load modules if it is not already
known to the system
//SYSOUT DD1
Defines the message data set
//SYMNAMES DD
Defines the SYMNAMES data set containing statements to be used for
symbol processing
//SYMNOUT DD
27
28
These are the default ddnames with which DFSORT was delivered.
SYSOUT and DFSPARM may have been changed during DFSORT
installation. You can change all of the indicated ddnames at run time. For
override information, see Appendix B, Specification/override of DFSORT
options, on page 863.
PGM= SORT
ICEMAN
PROC= SORT
SORTD
SORT
SORTD
,
, PARM =
options
, other parameters
29
30
EXEC
DD
DD
DD
DD
DD
DD
DD
PGM=ICEMAN
DSNAME=yyy,DISP=SHR
DSNAME=xxx,DISP=SHR
SYSOUT=A
DUMMY
DSNAME=&GOSET,UNIT=SYSDA,SPACE=(3600,(20,20,1))
DSNAME=&LOADSET,UNIT=SYSDA,SPACE=(80,(10,10))
DSNAME=&SYSUT1,SPACE=(1024,(60,20)),
UNIT=(SYSDA,SEP=(SORTLIB,SYSLMOD,SYSLIN))
00
10
20
30
40
50
60
70
80
Line
Explanation
00
The stepname of the procedure is SORT. This EXEC statement initiates the
program, which is named ICEMAN.
10
The STEPLIB DD statement defines the data set containing the DFSORT
program modules. If DFSORT was installed as part of the normal system
link libraries, the STEPLIB DD statement is unnecessary. It is needed only
if DFSORT resides in a separate link library which is not part of the link
list. (Your installation's system programmers can give you this
information.) The STEPLIB DD statement shown assumes that the data set
name represented by yyy is cataloged.
20
40
50
Defines a data set for linkage editor output. Any system disk device is
acceptable for the output. Space for 20 records with an average length of
3600 bytes is requested; this is the primary allocation. Space for 20 more
records is requested if the primary space allocation is not sufficient; this is
the secondary allocation, which is requested each time primary space is
exhausted. The last value is space for a directory, which is required
because SYSLMOD is a new partitioned data set.
60
The SYSLIN data set is used by the program for linkage editor control
statements. It is created on any system disk device, and it has space for 10
records with an average length of 80 bytes. If the primary space allocation
is exhausted, additional space is requested in blocks large enough to
contain 10 records. No directory space is necessary.
70/80
The SYSUT1 DD statement defines a work data set for the linkage editor.
00
10
20
30
Line
Explanation
00
10
The STEPLIB DD statement defines the data set containing the DFSORT
program modules. If DFSORT was installed as part of the normal system
link libraries, the STEPLIB DD statement is unnecessary. It is needed only
if DFSORT resides in a separate link library which is not part of the link
list. (Your installation's system programmers can give you this
information.) The STEPLIB DD statement shown assumes that the data set
name represented by yyy is cataloged.
20
The SORTLIB DD statement defines a private data set that contains the
modules needed for a sort using tape work files or a merge that uses the
Conventional technique. The data set name of the program subroutine
library, represented by xxx, is specified at installation time; it can be
SYS1.SORTLIB.
31
32
ABEND
NOABEND
ARESALL=
n
nK
nM
AVGRLEN=n
BSAM
CINV
NOCINV
COBEXIT=
COB1
COB2
DSA=n
DSPSIZE=
MAX
n
DYNALLOC
=
d
(,n)
(d,n)
OFF
DYNAPCT=
x
OLD
DYNSPC=n
EFS=
name
NONE
EQUALS
NOEQUALS
E15=COB
E35=COB
FILSZ=
x
Ex
Ux
HIPRMAX=
OPTIMAL
n
p%
LIST
NOLIST
LISTX
NOLISTX
LOCALE=
name
CURRENT
NONE
MSGDDN=ddname
MOSIZE=
MAX
n
%p
MOWRK
NOMOWRK
MSGPRT=
ALL
CRITICAL
NONE
NULLOUT=
RC0
RC4
RC16
ODMAXBF=
n
nK
nM
Additional
33
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
Y2PAST=
s
f
ZDPRINT
NZDPRINT
ABEND or NOABEND
34
ABEND
NOABEND
n
nK
nM
Specifies the average input record length in bytes for variable-length record
sort applications. For more information, see the discussion of the AVGRLEN
option in OPTION control statement on page 173.
Chapter 2. Invoking DFSORT with Job Control Language
35
specifies the average input record length. The value for n must be between
4 and 32767 and must include the 4 byte record descriptor word (RDW).
Temporarily bypasses the EXCP access method normally used for input and
output data sets. BSAM is ignored for VSAM input and output data sets. Note
that if Blockset is not selected and BSAM processing is used with concatenated
SORTIN input and both null and non-null data sets are specified, all null data
sets must precede all non-null data sets; otherwise, the results are
unpredictable.
Attention: This option can degrade performance.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
CINV or NOCINV
CINV
NOCINV
COB1
COB2
36
MAX
n
37
=
d
(,n)
(d,n)
Specifies that DFSORT dynamically allocates needed work space. You do not
need to calculate and use JCL to specify the amount of work space needed by
the program.
For more information, see the discussion of the DYNALLOC option in
OPTION control statement on page 173 and Appendix A, Using work
space, on page 853
d
specifies the device name. You can specify any IBM disk or tape device
supported by your operating system in the same way you would specify it
in the JCL UNIT parameter. You can also specify a group name, such as
DISK or SYSDA.
specifies the maximum number of requested work data sets. If you specify
more than 255, a maximum of 255 data sets is used. If you specify 1 and
the Blockset technique is selected, a maximum of 2 data sets is used. If you
specify more than 32 and the Blockset technique is not selected, a
maximum of 32 data sets is used.
Note: For optimum allocation of resources such as virtual storage, avoid
specifying a large number of work data sets unnecessarily.
38
x
OLD
specifies additional work data sets to be dynamically allocated with zero space.
DFSORT only extends these data sets when necessary to complete a sort
application. The availability of additional work data sets can help avoid out of
space ABENDs.
x
specifies the number of additional work data sets (y) as a percentage of the
maximum number of dynamically allocated work data sets
(DYNALLOC/DYNALOC n value) in effect. y will be set to n * x%. The
total number of dynamically allocated work data sets will be n + y. For
example, if DYNALLOC=(SYSDA,20) and DYNAPCT=20 are in effect, 4
additional work data sets will be allocated for a total of 24.
The value x must be between 0 and 254. The minimum value for y is 1 and
the maximum value for y is 254. The maximum value for n + y is 255; if x
results in a value for n + y greater than 255, y will be set to 255-n.
OLD
specifies additional work data sets should only be allocated when DFSORT
cannot determine the file size. When DFSORT is able to determine the file
size, additional work data sets will not be allocated (y=0), and the total
number of work data sets will be n.
Note: When message ICE118I is issued indicating that DFSORT cannot
determine the file size, y is set as follows:
v For DYNAPCT=OLD, y is set to n * 50%
v For DYNAPCT=x with x <= 50, y is set to n * 50%
v For DYNAPCT=x with x > 50, y is set to n * x%
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
DYNSPC
DYNSPC=n
39
name
NONE
EQUALS
NOEQUALS
Specifies that your E15 routine is written in COBOL and temporarily overrides
the MODS statement for E15. If you specify E15=COB but do not identify an
E15 module with a MODS statement, the E15=COB is ignored.
Default: None; optional. See Appendix B, Specification/override of DFSORT
40
Specifies that your E35 routine is written in COBOL and temporarily overrides
the MODS statement for E35. If you specify E35=COB but do not identify an
E35 module with a MODS statement, the E35=COB is ignored.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
FILSZ
FILSZ=
x
Ex
Ux
41
FILSZ=n
FILSZ=Un
FILSZ=En
Number of records
Exact
Estimate
Estimate
Applications
Sort, merge
Sort
Sort
Terminate if wrong?
Yes
No
No
Yes
Yes
When DFSORT
cannot compute
file size
n includes records:
42
FILSZ=n
FILSZ=Un
FILSZ=En
Yes
Yes
Yes
Inserted/deleted by E15
Yes
Yes
Yes
Inserted by E32
Yes
No
No
Yes
Yes
Yes
Deleted by SKIPREC
Yes
Yes
Yes
Deleted by STOPAFT
Yes
Yes
Yes
In any way
Significantly
Significantly
Effects of n=0
Deleted by INCLUDE/OMIT
statement
OPTIMAL
n
p%
43
LIST
NOLIST
LISTX
NOLISTX
44
name
CURRENT
NONE
CURRENT
specifies that locale processing is to be used, and the current locale
active when DFSORT is entered will remain the active locale during
DFSORT processing.
NONE
specifies that locale processing is not to be used. DFSORT will use the
binary encoding of the code page defined for your data for collating
and comparing.
Default: Usually the installation default. See Appendix B, Specification/
override of DFSORT options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
MOSIZE
MOSIZE=
MAX
n
%p
45
MOWRK
NOMOWRK
46
ALL
CRITICAL
NONE
MSGPRT
MSGCON
NO
NONE
NONE
NOF
NONE
NONE
AB
ALL
ALL
AP
ALL
CRITICAL
AC
NONE
ALL
CB
CRITICAL
CRITICAL
CC
NONE
CRITICAL
CP
CRITICAL
CRITICAL
PC
ALL
ALL
SC
ALL
CRITICAL
SP
CRITICAL
ALL
NOFLAG
NONE
CRITICAL
FLAG(I)
ALL
CRITICAL
FLAG(U)
CRITICAL
CRITICAL
RC0
RC4
RC16
47
n
nK
nM
48
OUTREL
NOOUTREL
RC0
RC4
RC16
RC0
RC4
RC16
Temporarily overrides the PAD installation option, which specifies the action to
be taken by DFSORT when the SORTOUT LRECL is larger than the
SORTIN/SORTINnn LRECL, for the cases where DFSORT allows LRECL
padding. For more information, see the discussion of the PAD option in
OPTION control statement on page 173.
49
n
nK
nM
specifies that n bytes of storage are to be reserved. If you specify less than
4096, 4096 is used.
Limit: 8 digits.
RESET
NORESET
50
LARGE
YES
INPUT
NO
51
n
nK
nM
MAX
MAX-m
MAX-mK
MAX-mM
Temporarily overrides the SIZE installation option, which specifies the amount
of main storage available to DFSORT. For more information, see the discussion
of the MAINSIZE option in OPTION control statement on page 173.
n
52
Specifies the number of records (z) you want to skip (delete) before starting to
sort or copy the input data set. SKIPREC is typically used to bypass records
not processed from the previous DFSORT job. For more information, see the
discussion of the SKIPREC option in OPTION control statement on page 173.
z
SOLRF
NOSOLRF
RC0
RC4
RC16
53
Specifies the maximum number of records you want accepted for sorting or
copying (that is, read from SORTIN or inserted by E15 and not deleted by
SKIPREC, E15, or an INCLUDE/OMIT statement). For more information, see
the discussion of the STOPAFT option in OPTION control statement on page
173.
n
Note: If you specify (1) FILSZ=x in the EXEC PARM, or (2) SIZE=x or FILSZ=x
on the OPTION or SORT statement, and the number of records accepted for
processing does not equal x, DFSORT issues an error message and terminates
unless installation option FSZEST=YES was specified.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
SZERO or NOSZERO
SZERO
NOSZERO
54
RC0
RC4
RC16
VERIFY
NOVERIFY
55
VLLONG
NOVLLONG
VLSCMP
NOVLSCMP
VLSHRT
NOVLSHRT
56
VSAMEMT
NVSAMEMT
VSAMIO
NOVSAMIO
57
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
58
s
f
specifies the number of years DFSORT is to subtract from the current year
to set the beginning of the sliding century window. Since the Y2PAST
value is subtracted from the current year, the century window slides as the
current year changes. For example, Y2PAST=81 would set a century
window of 1925-2024 in 2006 and 1926-2025 in 2007. s must be a value
between 0 and 100.
ZDPRINT
NZDPRINT
59
60
CENTWIN=value
Y2PAST=value
CORE=value
SIZE=value
FLAG(I)
MSGPRT=ALL
FLAG(U)
MSGPRT=CRITICAL
L5=value
AVGRLEN=value
MSG=value
MSGPRT=value
MSGDD=value
MSGDDN=value
NOFLAG
MSGPRT=NONE
NORC16
NOABEND
NORLSOUT
NOOUTREL
NOSDB
SDB=NO
RC16=ABE
ABEND
RELEASE=ON
WRKREL
RELEASE=OFF
NOWRKREL
RESERVE=value
RESALL=value
RESERVEX=value
ARESALL=value
RLS=n
WRKREL
RLS=0
NOWRKREL
RLSOUT
OUTREL
SDB
SDB=YES
SDB=ON
SDB=YES
SDB=OFF
SDB=NO
SDB=SMALL
SDB=YES
SEC=n
WRKSEC
SEC=0
NOWRKSEC
SECOND=ON
WRKSEC
SECOND=OFF
NOWRKSEC
SEQ=YES
VERIFY
SEQ=NO
NOVERIFY
VSAMEMT=YES
VSAMEMT
VSAMEMT=NO
NVSAMEMT
ZDPRINT=YES
ZDPRINT
ZDPRINT=NO
NZDPRINT
Using DD Statements
Using DD statements
A DFSORT job always requires DD statements after the EXEC statement. DD:
statements fall into two categories
v System DD statements (discussed in detail in System DD statements on page
63)
v Program DD statements (discussed in detail in Program DD statements on
page 65).
System DD statements, and some program DD statements, are usually supplied
automatically when you use a cataloged procedure. Others you must always
supply yourself.
The DD statement parameters, the conditions under which they are required, and
the default values, are summarized in Table 7. The subparameters of the DCB
parameter (a DD statement parameter) are described similarly in Table 8 on page
62.
Note:
1. Performance is enhanced if the LRECL subparameter of the DCB is accurately
specified for variable-length records. The maximum input record length you
can specify for your particular configuration is given in Data set notes and
limitations on page 13.
2. When using DFSORT applications, FREE=CLOSE cannot be used on any DD
statements except DFSPARM.
Table 7. DD Statement Parameters Used by DFSORT
Parameter
When Required
Parameter Values
Default Value
{AMP | BUFSP}
When password-protected
VSAM data sets are used
and the password is
supplied through E18, E38,
or E39.
DCB
DISP
DSNAME or DSN
LABEL
SPACE
61
Using DD Statements
Table 7. DD Statement Parameters Used by DFSORT (continued)
Parameter
When Required
Parameter Values
Default Value
UNIT
Specifies (symbolically or
actually) the type and
quantity of I/O units
required by the data set.
VOLUME or VOL
Default Value
Subparameter Values
BUFOFF
DEN
OPTCD
TRTCH
BLKSIZE 1, 2
LRECL 2, 3
RECFM
800 bpi
Unless SDB=NO is in
effect, Blockset uses the
system-determined
optimum block size
when the output data set
block size is zero.
Applications which
require a specific output
data set block size
should be changed to
specify that block size
EXPLICITY.
v No default if input on
unlabeled tape or BLP or
NSL specified.
62
Using DD Statements
Duplicate ddnames
If you specify a particular ddname (such as SORTIN) more than once within the
same step, DFSORT uses the first ddname and ignores subsequent duplicates.
Processing continues normally.
In addition, SORTIN0, SORTIN1...SORTIN9 can be specified instead of SORTIN00,
SORTIN01...SORTIN09, respectively. If you specify both SORTINn and SORTIN0n
in the same job step, DFSORT treats them as duplicates, and ignores each usage
after the first. For example, SORTIN2 and SORTIN02 are treated as duplicates and
only SORTIN2 is used.
Note: For a Conventional merge, SORTINn will not be recognized because of the
existing restriction which allows only SORTIN01, SORTIN02...SORTIN16.
Duplicates of these accepted ddnames will be ignored.
Duplicate OUTFIL ddnames are ignored at the OUTFIL statement level as
explained in OUTFIL statements notes on page 374.
System DD statements
If you choose not to use the SORT or SORTD cataloged procedures to invoke
DFSORT, you might need to supply system DD statements in your input job
stream (See also the following section for DD statements dedicated to DFSORT,
such as SORTIN). The DD statements contained in the cataloged procedure (or
provided by you) are:
//JOBLIB DD
63
Using DD Statements
Defines your program link library if it is not already known to the system.
//STEPLIB DD
Same as //JOBLIB DD.
//SYSIN DD
Contains DFSORT control statements, comment statements, blank
statements and remarks when DFSORT is invoked with JCL rather than by
another program. It can also contain user exit routines, in object deck
format, to be bound or link-edited by DFSORT.
v If you use DFSPARM, then SYSIN is not necessary unless your job
requires binding or link-editing.
v The SYSIN data set usually resides in the input stream; however, it can
be defined as a sequential data set or as a member of a partitioned data
set.
v The data set must be defined with a RECFM of F or FB. The LRECL can
be 80, or more (when valid). If the LRECL is greater than 80, DFSORT
will use the first 80 bytes of each record.
If user exit routines are in SYSIN, the LRECL must be 80.
v DFSORT supports concatenated SYSIN data sets to the extent that the
system supports like concatenated data sets for BSAM. Refer to z/OS
DFSMS Using Data Sets for further information about like
concatenated data sets.
Note: The OPTION statement keywords EFS, LIST, NOLIST, LISTX,
NOLISTX, LOCALE, MSGPRT, MSGDDN, SMF, SORTDD, SORTIN, and
SORTOUT are used only when they are passed by an extended parameter
list or when in the DFSPARM data set. If they are specified on an OPTION
statement read from the SYSIN or SORTCNTL data set, the keyword is
recognized, but the parameters are ignored.
If you use the DFSPARM DD statement instead, you can specify both
EXEC PARM options and DFSORT control statements in a single source
data set that overrides all other sources. See DFSPARM DD statement on
page 76.
If user exit routines are in SYSIN, make sure that:
v The LRECL of SYSIN is 80.
v The END statement is the last control statement.
v The user exit routines are arranged in numeric order (for example, E11
before E15).
v The user exit routines are supplied immediately after the END control
statement.
v Nothing follows the last object deck in SYSIN.
v A SORTMODS DD statement is included.
If DFSORT is program invoked, and you supply the DFSORT control
statements through the 24-bit or extended parameter list, SORTCNTL, or
DFSPARM, SYSIN remains the source of user exit routines placed in the
system input stream.
//SYSOUT DD
Identifies the DFSORT message data set. The default ddname is SYSOUT,
but you can specify an alternate ddname for the message data set using
the MSGDDN installation or run-time option. Always supply a DD
statement for the message data set if a catalogued procedure is not used.
64
Using DD Statements
(If you are invoking DFSORT from a COBOL program and are using the
ddname SYSOUT for the message data set, the use of DISPLAY in your
COBOL program can produce uncertain printing results.)
DFSORT uses RECFM=FBA, LRECL=121, and the specified BLKSIZE for
the message data set. If the BLKSIZE you specify is not a multiple of 121,
DFSORT uses BLKSIZE=121. If you do not specify the BLKSIZE, DFSORT
selects the block size as directed by the SDBMSG installation option (see
z/OS DFSORT Installation and Customization).
If you use a temporary or permanent message data set, it is best to specify
a disposition of MOD to ensure you see all messages and control
statements in the message data set.
//SYSUDUMP DD
Defines the data set for output from a system ABEND dump routine.
//SYSMDUMP DD
Same as //SYSUDUMP DD.
//SYSABEND DD
Same as //SYSUDUMP DD.
If you are using the supplied SORT cataloged procedure, the DD statements that
follow are automatically supplied. If you are not using the SORT cataloged
procedure and you are using the linkage editor, you must supply the following:
DD statements
//SYSPRINT DD
Contains messages from the binder or linkage editor.
//SYSUT1 DD
Defines the intermediate storage data set for the linkage editor. The binder
does not use this data set.
//SYSLIN DD
Defines a data set for control information for the binder or linkage editor.
//SYSLMOD DD
Defines a data set for output from the binder or linkage editor.
Note: If you do not include user routines, or if you include user routines that do
not require binding or link-editing, you can use the supplied SORTD cataloged
procedure. If you include user routines that require binding or link-editing, you
can use the SORT cataloged procedure.
Program DD statements
Even if you use the SORT or SORTD cataloged procedure to invoke DFSORT, you
might need to supply additional dedicated DD statements. The following list
summarizes each of these statements, and a more detailed explanation of each one
follows.
//SORTLIB DD
Defines the data set that contains special load modules for DFSORT. Can
usually be omitted.
//SYMNAMES DD
65
Using DD Statements
Defines the SYMNAMES data set containing statements to be used for
symbol processing. Required only if symbol processing is to be performed.
//SYMNOUT DD
Defines the data set in which SYMNAMES statements and the symbol
table are to be listed. Optional if SYMNAMES DD is specified. Otherwise
ignored.
//SORTIN DD
Defines the input data set for a sorting or copying application. Will not be
used for a merging application.
//SORTINnn DD
Defines the input data sets for a merging application. Will not be used for
a sorting or copying application.
//SORTWKdd DD
Defines intermediate storage data sets. Usually needed for a sorting
application unless dynamic allocation is requested. Will not be used for a
copying or merging application.
//SORTOUT DD
Defines the SORTOUT output data set for a sorting, merging, or copying
application.
//outfil DD
Defines an OUTFIL output data set for a sorting, merging, or copying
application.
//SORTCKPT DD
Defines the data set used to store the information that the system needs to
restart the sort from the last checkpoint. This is only needed if you are
using the checkpoint facility.
//SORTCNTL DD
Defines the data set from which additional or changed DFSORT control
statements can be read when DFSORT is program-invoked.
//DFSPARM DD
Defines the data set from which both additional or changed DFSORT
program control statements and EXEC statement PARM options can be
read when DFSORT is directly invoked or program invoked.
//SORTDKdd DD
Defines the data set used for a VIO SORTWKdd allocation by DFSORT if it
is dynamically reallocated; SORTDKdd must never be specified in the job
stream.
//SORTDIAG DD
Specifies that all messages and control statements are printed. Used
primarily for diagnostics and debugging.
//SORTSNAP DD
Defines the snap dump data set dynamically allocated by DFSORT.
SORTSNAP must never be specified in the job stream.
66
Using DD Statements
//SORTMODS DD
Defines a temporary partitioned data set. This temporary data set must be
large enough to contain all your user exit routines that appear in SYSIN for
a given application. If none of your routines appear in SYSIN, this
statement is not required. If your routines are in libraries, you must
include DD statements defining the libraries.
DFSORT temporarily transfers the user exit routines in SYSIN to the data
set defined by this DD statement. Then DFSORT calls the binder or linkage
editor for processing.
SORTLIB DD statement
The SORTLIB DD statement can usually be omitted. This statement describes the
data set that contains special DFSORT load modules.
When Required: If installation option SORTLIB=PRIVATE is in effect or dynamic
link edit of user exits is specified
v For sort applications using tape work data sets
v For merge applications for which Blockset cannot be used (see message ICE800I).
The SORTLIB installation option determines whether DFSORT searches a system
library or private library for the load modules required by tape work data set sorts
and Conventional merges.
Example 1 SORTLIB DD Statement:
//SORTLIB DD DSNAME=USORTLIB,DISP=SHR
SORTIN DD statement
The SORTIN DD statement describes the characteristics of the data set in which the
records to be sorted or copied reside and also indicates its location.
When Required: If installation option SORTLIB=PRIVATE is in effect or dynamic
link edit of user exits is specified
Chapter 2. Invoking DFSORT with Job Control Language
67
Using DD Statements
v For sort applications using tape work data sets
v For merge applications for which Blockset cannot be used (see message ICE800I).
The SORTLIB installation option determines whether DFSORT searches a system
library or private library for the load modules required by tape work data set sorts
and Conventional merges.
Data set characteristics: DFSORT accepts empty and null non-VSAM data sets,
and DUMMY data sets, for sorting and copying (be sure to supply RECFM, LRECL
and BLKSIZE). DFSORT also accepts empty VSAM data sets for sorting and
copying provided VSAMEMT is in effect. For non-VSAM data sets, DFSORT
examines the DS1LSTAR field in the format-1 DSCB to determine whether the data
set is empty or null. If DS1LSTAR is zero, DFSORT treats the data set as empty or
null. If the data set is a null multivolume data set and the DS1IND80 flag is off in
the format-1 DSCB of the first volume of the multivolume data set, DFSORT opens
the data set for output to force an end of file (EOF) mark before using the data set
for input.
Note that a null data set is one that has been newly created, but never successfully
closed. Null data sets cannot be processed successfully for a tape work data set
sort. The System Code field in the data set label in the disk Volume Table of
Contents (DSCB in the VTOC) indicates a data set created by the VSE operating
system if it contains the letters DOS or VSE within it. Such data sets are never
treated as null; however, they may be empty. DFSORT cannot process VSE disk
data sets that do not have DOS or VSE within the System Code field.
DFSORT may set what it considers to be appropriate values for missing attributes
(RECFM, LRECL, BLKSIZE) of input data sets based on other attributes, or may
terminate due to a missing attribute. If a missing attribute results in termination, or
you don't want to use a missing attribute set by DFSORT, specify that attribute
explicitly (for example, specify RECFM=VB).
See Data set considerations on page 12 for additional considerations.
The following rules apply to concatenated data sets:
v RECFM must be either all fixed-length or all variable-length for the data sets in
the concatenation.
v BLKSIZE can vary. However, if a tape data set has the largest block size and is
not first in the concatenation, you must specify BLKSIZE explicitly on its DD
statement in the following two situations:
Blockset is selected and the tape data set has a block size greater than 32760
bytes, but the block size is not available from DFSMSrmm or ICETPEX.
Blockset is not selected.
v With fixed-length records, LRECL must be the same for all data sets. With
variable-length records, LRECL can vary. However:
If Blockset is selected: If a tape data set has the largest LRECL and is not first
in the concatenation, you must specify LRECL explicitly on its DD statement
if the LRECL is not available from DFSMSrmm or ICETPEX.
If Blockset is not selected, the first data set in the concatenation must have the
largest LRECL (LRECL can be specified explicitly on its DD statement).
v If the data sets are on unlike devices, you cannot use the EXLST parameter at
user exit E18.
v If Blockset is not selected and BSAM is used, all null data sets must precede all
non-null data sets; otherwise, the results are unpredictable.
68
Using DD Statements
v DFSORT forces an EOF mark on all null data sets whose format-1 DSCB
DS1IND80 flag is off before using BSAM to process the null data sets.
v If you define a data set using the DUMMY parameter, do not concatenate other
data sets to it; the system ignores data sets concatenated to a DUMMY data set.
v VSAM data sets must not be concatenated (system restriction).
v Input cannot consist of both VSAM and non-VSAM data sets.
General coding notes:
v For a copy application, the SORTIN data set should not be the same as the
SORTOUT data set or any OUTFIL data set because this can cause lost or
incorrect data or unpredictable results.
v For a sort application, the SORTIN data set should not be the same as any
SORTWKdd data set because this can cause lost or incorrect data or
unpredictable results. The SORTIN data set can be the same as the SORTOUT
data set or an OUTFIL data set, but this situation can lead to the loss of the data
set if the sort application does not end successfully.
v FREE=CLOSE cannot be specified. User labels are not copied.
Example 2 SORTIN DD statement:
//SORTIN DD DSNAME=INPUT,DISP=SHR
DD
DSN=SORTIN,DISP=(OLD,KEEP),UNIT=3490,
VOL=SER=(75836,79661,72945)
If the input data set is contained on more than one reel of magnetic tape, the
VOLUME parameter must be included on the SORTIN DD statement to indicate
the serial numbers of the tape reels. In this example, the input data set is on three
reels that have serial numbers 75836, 79661, and 72945.
If a data set is not on a disk or on a standard-labeled tape, you must specify DCB
parameters in its DD statement.
SORTINnn DD statement
The SORTINnn DD statements describe the characteristics of the data sets in which
records to be merged reside and indicate the locations of these data sets.
When required: SORTINnn DD statements are always needed for a merge, unless
the merge is invoked from another program and all input is supplied through a
routine at user exit E32.
Chapter 2. Invoking DFSORT with Job Control Language
69
Using DD Statements
Data set characteristics: Input data sets can be either non-VSAM or VSAM, but
not both. DFSORT accepts empty and null non-VSAM data sets, and DUMMY data
sets, for merging (be sure to supply RECFM, LRECL and BLKSIZE). DFSORT also
accepts empty VSAM data sets for merging provided VSAMEMT is in effect. For
non-VSAM data sets, DFSORT examines the DS1LSTAR field in the format-1 DSCB
to determine whether the data set is null or empty. If DS1LSTAR is zero, DFSORT
treats the data set as null or empty. A null data set is one that has been newly
created but never successfully closed. Null data sets cannot be processed
successfully by the Conventional merge technique.
RECFM must be the same for all input data sets.
BLKSIZE can vary, but for a Conventional merge, SORTIN01 must specify the
largest block size.
With fixed-length records, LRECL must be the same for all data sets. With
variable-length records, LRECL can vary.
Data sets can be multivolume but not concatenated. If a SORTINnn data set is
multivolume and null, DFSORT forces an EOF mark on the data set before use.
DFSORT may set what it considers to be appropriate values for missing attributes
(RECFM, LRECL, BLKSIZE) of input data sets based on other attributes, or may
terminate due to a missing attribute. If a missing attribute results in termination, or
you don't want to use a missing attribute set by DFSORT, specify that attribute
explicitly (for example, specify RECFM=VB).
See Data set notes and limitations on page 13 for additional considerations.
General coding notes:
v A SORTINnn data set should not be the same as the SORTOUT data set or any
OUTFIL data set because this can cause lost or incorrect data or unpredictable
results.
v You can merge up to 100 data sets with Blockset merge or up to 16 data sets
with Conventional merge. If Conventional merge is selected, check message
ICE800I for the reason Blockset could not be used and correct the indicated
condition, if possible.
With Blockset merge, nn can be any integer from 00 (the initial zero is
optional) to 99, in any order. Blockset merge treats ddnames of the form
SORTINn and SORTIN0n as duplicates, and ignores any occurrences after: the
first. For example, if you have
//SORTIN4 DD . . .
//SORTIN04 DD . . .
70
Using DD Statements
//SORTIN02 DD DSNAME=MERGE2,VOLUME=SER=000121,DISP=OLD,
//
LABEL=(,NL),UNIT=3590,
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)
//SORTIN03 DD DSNAME=MERGE3,VOLUME=SER=000131,DISP=OLD,
//
LABEL=(,NL),UNIT=3590,
//
DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)
*
*DCB PARAMETERS
*SUPPLIED FROM
*LABELS
SORTWKdd DD statement
The SORTWKdd DD statements describe the characteristics of the data sets used as
intermediate storage areas for records to be sorted; they also indicate the location
of these data sets.
Up to 255 SORTWKdd DD statements can be specified. However, if you specify
more than 32 and the Blockset technique is not selected, only the first 32 are used.
When required: One or more SORTWKdd statements are required for each sort
application (but not a merge or copy), unless:
v Input can be contained in main storage
v Dynamic work space allocation has been requested (DYNALLOC)
v dataspace sorting, Hipersorting, or memory object sorting is used.
For information on using work data sets, see Appendix A, Using work space, on
page 853.
Diagnostic message ICE803I gives information on intermediate storage allocation
and use.
Devices: SORTWKdd data sets can be on disk or on tape, but not both. Disk
types can be mixed.
Tape must be nine-track unless input is on seven-track tape, in which case work
tapes can (but need not) be seven-track.
General coding notes:
v Unless the input file is very large, two or three SORTWKdd data sets are usually
sufficient. Two or three large SORTWKdd data sets are preferable to several
small data sets. Placing each SORTWKdd data set on a separate device can
improve performance.
For optimum allocation of resources such as virtual storage, avoid specifying a
large number of work data sets unnecessarily.
v A SORTWKdd data set should not be the same as the SORTIN data set, the
SORTOUT data set, any OUTFIL data set, or any other SORTWKdd data set
because this can cause lost or incorrect data or unpredictable results.
v Cylinder allocation is preferable for performance reasons. Temporary
SORTWKdd data sets allocated in tracks or blocks (without ROUND) are
readjusted to cylinders by DFSORT.
v For disk work data sets, any valid ddname of the form SORTWKdd or
SORTWKd can be used (for example, SORTWK01, SORTWKC3, SORTWK2,
SORTWK#5, SORTWKA, SORTWKXY and so on). The ddnames can be in any
order. SORTWKd and SORTWK0d are not treated as duplicate ddnames (for
Chapter 2. Invoking DFSORT with Job Control Language
71
Using DD Statements
v
v
v
72
Using DD Statements
The following is an example of a SORTWKdd DD statement using a disk work:
data set
Example 6 SORTWK01 DD statement, disk work data set:
//SORTWK01
DD
SPACE=(CYL,(15,5)),UNIT=3390
If you use the checkpoint/restart facility and need to make a deferred restart, you
must make the following additions to the previous statement so that the sort work
data set is not lost:
DSNAME=name1,DISP=(NEW,DELETE,CATLG)
Thus the same SORTWKdd DD statement for a deferred restart would be:
//SORTWK01
//
DD
DSNAME=name1,UNIT=3390,SPACE=(CYL,(15,5)),
DISP=(NEW,DELETE,CATLG)
DD
DD
DD
UNIT=3480,LABEL=(,NL)
UNIT=3480,LABEL=(,NL)
UNIT=3480,LABEL=(,NL)
73
74
DISP
specifies the data set unknown to the operating system (NEW) and catalogs
(CATLG) it under the name C905460.OUTPT.
DSNAME
specifies that the data set is called C905460.OUTPT.
SPACE
requests five cylinders of storage for the data set.
UNIT
Indicates that the data set is on a 3390.
SORTCKPT DD statement
The SORTCKPT data set can be allocated on any device that operates with the
Basic Sequential Access Method (BSAM). Processing must be restarted only from
the last checkpoint taken.
Example 9 SORTCKPT DD statement:
//SORTCKPT DD DSNAME=CHECK,VOLUME=SER=000123,
//
DSP=(NEW,KEEP),UNIT=3480
When you allocate the SORTCKPT data set, you must include at least one work
data set.
If the CKPT operand is specified on the OPTION or SORT control statement, more
intermediate storage could be required.
If you want to use the Checkpoint/Restart Facility, refer to Checkpoint/restart
on page 907.
SORTCNTL DD statement
The SORTCNTL data set can be used to supply DFSORT control statements,
comment statements, blank statements, and remarks when DFSORT is invoked
from another program (written, for example, in COBOL or PL/I).
v The SORTCNTL data set usually resides in the input stream, but can be defined
as a sequential data set or as a member of a partitioned data set.
v The data set must be defined with RECFM of F or FB. The LRECL can be 80, or
more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80
bytes of each record.
v DFSORT supports concatenated SORTCNTL data sets to the extent that the
system supports like concatenated data sets for BSAM. Refer to z/OS DFSMS
Using Data Sets for further information about like concatenated data sets.
v When DFSORT is invoked from a PL/I program, the SORTCNTL or DFSPARM
data set must not be used to supply a new RECORD control statement.
Example 10 SORTCNTL DD statement:
//SORTCNTL DD *
OPTION MAINSIZE=8M
75
SORTCNTL DD Statement
Note:
1. The OPTION statement keywords EFS, LIST, NOLIST, LISTX, NOLISTX,
LOCALE, MSGPRT, MSGDDN, SMF, SORTDD, SORTIN, and SORTOUT are
used only when they are passed by an extended parameter list or when in the
DFSPARM data set. If they are specified on an OPTION statement read from
the SYSIN or SORTCNTL data set, the keyword is recognized, but the
parameters are ignored.
If your program invokes DFSORT more than once, you can direct DFSORT to
read different versions of the SORTCNTL data set at each call. See the
explanation of the SORTDD parameter in OPTION control statement on page
173.
2. If you use the DFSPARM DD statement instead of the SORTCNTL DD
statement, you can specify both EXEC PARM options and DFSORT control
statements in a single source data set that overrides all other sources. See
DFSPARM DD statement. For override rules, see Appendix B,
Specification/override of DFSORT options, on page 863.
DFSPARM DD statement
The DFSPARM DD statement can be used to supply DFSORT program control
statements and EXEC statement PARM options from a single DD source. Because
statements in the DFSPARM data set are read whether DFSORT is program
invoked or directly invoked, you can specify EXEC PARM options when invoking
DFSORT from another program (unlike SORTCNTL). DFSPARM accepts all
DFSORT program control statements and all EXEC statement PARM options
(including those ignored by SYSIN and SORTCNTL) and any equivalent options
specified on a DFSORT OPTION statement.
DFSPARM also accepts comment statements, blank statements, and remarks.
For examples of using DFSPARM when you call DFSORT from a program, see
Overriding DFSORT control statements from programs on page 542.
Full override and applicability details are listed as follows and in Appendix B,
Specification/override of DFSORT options, on page 863.
v If you use DFSPARM, SYSIN is not necessary unless your job requires
link-editing.
v The DFSPARM data set usually resides in the input stream, but it can be defined
as a sequential data set or as a member of a partitioned data set.
v The data set must be defined with RECFM of F or FB. The LRECL can be 80, or
more (when valid). If the LRECL is greater than 80, DFSORT will use the first 80
bytes of each record.
v DFSORT supports concatenated DFSPARM data sets to the extent that the
system supports like concatenated data sets for BSAM. Refer to z/OS DFSMS
Using Data Sets for further information about like concatenated data sets.
v When DFSORT is invoked from a PL/I program, the SORTCNTL or DFSPARM
data set must not be used to supply a new RECORD control statement.
Note: The ddname DFSPARM is used throughout this document to refer to this
data set source for EXEC PARM options and DFSORT program control statements.
When your system programmers installed DFSORT, they might have changed this
name to one more appropriate for your site with the PARMDDN installation
option. However, DFSORT will always use a DFSPARM data set of present, unless
a DD statement with the PARMDDN name is also present.
76
DFSPARM DD Statement
General coding notes: Coding of parameters in the DFSPARM DD statement
follows the same rules used for the JCL EXEC statement PARM options and the
program control statements specified in SYSIN or SORTCNTL. The following
exceptions apply:
v Labels are not allowed.
v PARM options and program control statements cannot be mixed on the same
line, but can be specified in any order on different lines.
v PARM options must be specified without the PARM= keyword and without
quote marks.
v Commas (or semicolons) are accepted, but not required, to continue PARM
options to another line.
v Leading blanks are not required for PARM options, but at least one leading
blank is required for program control statements.
FREE=CLOSE can be used for applicable DFSPARM data sets (for example, with
temporary and permanent sequential data sets, but not with DD * data sets).
When DFSORT is called from another program, FREE=CLOSE causes the
DFSPARM data set to be released when DFSORT returns to the caller. This allows
another DFSPARM data set to be used for a subsequent call.
For example, if a COBOL program contains three SORT verbs, the following would
cause the control statements in DP1 to be used for the first SORT verb, the control
statements in DP2 to be used for the second SORT verb, and the: control
statements in DP3 to be used for the third SORT verb
//DFSPARM DD DSN=DP1,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP2,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP3,DISP=SHR,FREE=CLOSE
Without FREE=CLOSE, DP1 would be used for all three SORT verbs.
Example 11 DFSPARM DD statement:
//DFSPARM DD *
SORT FIELDS=(1,2,CH,A),STOPAFT=300
ABEND
OPTION SORTIN=DATAIN
STOPAFT=500
In this example, the DFSPARM DD data set passes a DFSORT SORT statement, the
ABEND and STOPAFT parameters equivalent to specifying
PARM=ABEND,STOPAFT=500 in a JCL EXEC statement, and a DFSORT OPTION
statement.
Note:
1. SORT and OPTION are control statements. ABEND and STOPAFT=500 are
PARM options.
2. The PARM option STOPAFT=500 overrides the SORT control statement option
STOPAFT=300.
3. When PARMDDN=DFSPARM is specified or defaulted
v if a //DFSPARM DD data set is available at run-time, DFSORT will use it
v if a //DFSPARM DD data set is not available at run-time, DFSORT will use
a //$ORTPARM DD data set if available.
77
DFSPARM DD Statement
Thus with PARMDDN=DFSPARM, you can choose to specify either a
//DFSPARM DD data set or a //$ORTPARM DD data set for a particular
DFSORT application.
4. When PARMDDN=ddname is specified
v if a //ddname DD data set is available at run-time, DFSORT will use it
v if a //ddname DD data set is not available at run-time, DFSORT will use a
//DFSPARM DD data set if available.
Thus with PARMDDN=ddname, you can choose to specify either a //ddname
DD data set or a //DFSPARM DD data set for a particular DFSORT
application.
Example 12 DFSPARM DD statement:
//DFSPARM DD *
SORT FIELDS=(5,2,CH,D),SKIPREC=10
STOPAFT=100,BSAM,SKIPREC=5
OPTION SORTIN=DATAIN,SKIPREC=20
In this example, the DFSPARM DD data set contains a SORT program control
statement, three PARM options on one line, and an OPTION program control
statement.
Note: Because PARM options override program control statements, DFSORT uses
SKIPREC=5 and ignores the other SKIPREC specifications.
For information on the parameters used in the DFSPARM DD statement, the
conditions under which they are required, and any default values assumed if a
parameter is omitted, see Specifying EXEC/DFSPARM PARM options on page 32
and Chapter 3, Using DFSORT program control statements, on page 81.
SORTDKdd DD statement
SORTWKdd data sets can be assigned to VIO. If the VIO installation option is
specified or defaults to NO, SORTWKdd data sets are deallocated and reallocated
by DFSORT using SORTDKdd ddnames. SORTDKdd ddnames are reserved for use
by DFSORT.
SORTDIAG DD statement
The SORTDIAG DD statement specifies that all messages, including diagnostic
messages (ICE800I through ICE999I), and control statements are to be written to
the message data set. The statement can be used for all DFSORT techniques and
provides information on EXCP counts, intermediate storage allocation and use, and
so on. The SORTDIAG DD statement has no effect on console messages. The
statement is intended as a diagnostic tool.
When SORTDIAG is used, a SYSOUT DD statement or a ddname DD statement
(where ddname is the alternate message data set ddname specified during
installation or run-time) should be provided. If installation option
NOMSGDD=QUIT is in effect and neither an alternate message data set ddname
statement nor a SYSOUT ddname statement is provided, DFSORT terminates with
a return code of 20.
Example 13 SORTDIAG DD statement:
//SORTDIAG DD
DUMMY
SORTSNAP DD statement
The SORTSNAP DD statement defines the data set where the snap dumps
requested by the ESTAE recovery routine, or the snap dumps requested before or
78
SORTSNAP DD Statement
after a call to an EFS program are printed. SORTSNAP is dynamically allocated by
DFSORT whenever it is required. The ddname, SORTSNAP, is reserved for
DFSORT.
79
80
81
REFORMAT
Describes the fields from the two files to be included in the joined records,
and optionally an indicator of where the key was found ('B' for both files,
'1' for file1 only or '2' for file2 only.
82
Using symbols
You can define and use a symbol for any field or constant in the following
DFSORT control statements: INCLUDE, INREC, JOINKEYS, MERGE, OMIT,
OUTFIL, OUTREC, REFORMAT, SORT and SUM. You can use a symbol for a
number associated with various keywords in the following DFSORT control
statements: INREC, JOINKEYS, MERGE, OPTION, OUTFIL, OUTREC and SORT.
You can also use a symbol for an output column in the following DFSORT control
statements: INREC, OUTFIL and OUTREC. This makes it easy to create and reuse
collections of symbols (that is, mappings) representing information associated with
various record layouts. You can use system symbols (for example, &JOBNAME.) in
your symbol constants. You can use SET and PROC symbols in your symbol
constants. See Chapter 8, Using symbols for fields and constants, on page 731 for
complete details.
83
Operation
Operand
(Remarks)
80
(Sequence or
Identification)
(Continuation column)
Figure 4. Control Statement Format
The control statements are free-form; that is, the operation definer, operands, and
comment field can appear anywhere in a statement, provided they appear in the
proper order and are separated by one or more blank characters. Column 1 of each
control statement must be blank, unless the first field is a label or a comment
statement (see Inserting comment statements on page 87).
v Label Field
A label can be specified on any control statement in SYSIN or SORTCNTL. A
label is never required. If present, a label must begin in column 1 with any
character other than a blank or asterisk (*). A label can be 1 to 70 characters and
ends when a blank character is found. Any character can be used in a label. A
label followed only by blanks is printed but otherwise not processed.
Labels cannot be specified in the parameter list, in DFSPARM or in continuation
lines.
To skip the label, specify one or more blanks starting in column 1.
The following illustrates the use of control statements with and without labels:
OPTION EQUALS
MYSORT SORT FIELDS=(5,4,CH,A)
OUTREC FIELDS=(1,20,51,30)
OUT_1 OUTFIL FNAMES=OUT1,INCLUDE=(5,1,CH,EQ,CA)
OUT_2 OUTFIL FNAMES=OUT2,INCLUDE=(5,1,CH,EQ,CB)
v Operation Field
This field can appear anywhere between column 2 and column 71 of the first
line. It contains a word (for example, SORT or MERGE) that identifies the
statement type to the program. In the example shown later in this section, the
operation definer, SORT, is in the operation field of the sample control statement.
v Operand Field
The operand field is composed of one or more operands separated by commas
or semicolons. This field must follow the operation field, and be separated from
it by at least one blank. No blanks are allowed within the parameters, but a
blank is required at the end of all parameters. If the statement occupies more
than one line, the operand must begin on the first line. Each operand has an
operand definer, or parameter (a group of characters that identifies the operand
type to DFSORT). A value or a list of values can be associated with a parameter.
The five possible operand forms shown in this chapter are:
parameter. Examples: CHALT, NOCHALT, REMOVECC
parameter(c). Examples: DATE1(/), TIME2(:), Y2W(-)
parameter=value. An operand shown in the form parameter=value can also
be specified in the equivalent form parameter(value) or parameter=(value).
84
Continuation lines
The format of the DFSORT continuation line is shown in Figure 5 on page 86.
85
16
72 73
80
Optional use
(Continuation column)
Figure 5. Continuation Line Format
86
With the 'D' in column 16 of line 2, we get 'ZD' in the SORT statement. But with
the 'D' in column 17 of line 2, we get 'Z D' in the SUM statement instead of 'ZD',
resulting in a syntax error.
v Explicit continuation in 2-15: If line 1 breaks at column 71 with a nonblank in
column 72, and columns 2-15 of line 2 are nonblank, DFSORT continues on line
2 with the first nonblank character it finds in columns 2-15. For example:
*
1
2
3
4
5
6
7
*23456789012345678901234567890123456789012345678901234567890123456789012
INCLUDE COND=(5,4,CH,EQ,CAB*
CD)
SORT FIELDS=(9,3,*
ZD,A)
OUTREC FIELDS=(5,4,2X*
,9,3,ZD,M26,80:X)
87
Coding restrictions
The following rules apply to control statement preparation:
v Operation definers and operands must be in uppercase EBCDIC.
v Column 1 of each control statement can be used only for a label or for a
comment statement that begins with an asterisk in column 1.
v If present, a label must begin in column 1. Labels are allowed only in the SYSIN
and SORTCNTL data sets.
v The entire operation definer must be contained on the first line of a control
statement.
v The first operand must begin on the first line of a control statement. The last
operand in a statement must be followed by at least one blank.
v Blanks are not allowed in operands. Anything following a blank is considered
part of the remark field.
v Remarks are allowed only in the DFSPARM, SYSIN, and SORTCNTL data sets.
v Commas, semicolons, and blanks can be used only as delimiters. They can be
used in values only if the values are constants.
v Each type of program control statement can appear only once within a single
source (for example, the SYSIN data set).
The ALTSEQ control statement can be used to change the alternate translation table
(ALTSEQ table). Any modifications you specify are applied to the standard
EBCDIC translation table. The modified ALTSEQ table overrides the installation
default ALTSEQ table (the shipped default is the EBCDIC translation table).
The ALTSEQ table can be used in two ways as follows:
88
CODE
,
CODE=( fftt
tt
The character $ (X'5B') is to collate at position X' EA', that is, after uppercase Z
(X'E9').
89
Example 2
MERGE FIELDS=(25,7,A,1,10,D),FORMAT=CH
OPTION CHALT
ALTSEQ CODE=(F0B0,F1B1,F2B2,F3B3,F4B4,F5B5,F6B6,
F7B7,F8B8,F9B9)
The numerals 0 through 9 are to collate before uppercase letters (but after
lowercase letters).
Example 3
SORT FIELDS=(55,8,AQ,A)
ALTSEQ CODE=(C1F1,C2F2)
The uppercase A (X'C1') is to collate at the same position as the numeral 1 (X'F1')
and the uppercase B (X'C2') is to collate at the same position as the numeral 2
(X'F2').
Note that this ALTSEQ statement does NOT cause collating of A before or after 1,
or of B before or after 2.
Example 4
SORT FIELDS=(55,8,AQ,A)
ALTSEQ
CODE=(81C1,82C2,83C3,84C4,85C5,86C6,87C7,
88C8,89C9,91D1,92D2,93D3,94D4,95D5,96D6,
97D7,98D8,99D9,A2E2,A3E3,A4E4,A5E5,A6E6,
A7E7,A8E8,A9E9)
Example 5
OPTION COPY
ALTSEQ CODE=(0040)
OUTREC FIELDS=(1,80,TRAN=ALTSEQ)
90
ABEND
NOABEND
ABSTP
BSAM
CFW
NOCFW
CTRx=n
,
EFSDPAFT=( n
,
EFSDPBFR=( n
EQUCOUNT
ESTAE
NOESTAE
NOASSIST
The DEBUG control statement is not intended for regular use; only ABEND,
NOABEND, and BSAM are of general interest. For a tape work sort or a
Conventional merge, only the ABEND or NOABEND parameters of the DEBUG
statement are used. For more information about problem diagnosis, see z/OS
DFSORT Messages, Codes and Diagnosis Guide.
ABEND or NOABEND
ABEND
NOABEND
91
Temporarily bypasses the EXCP access method for input and output data sets.
BSAM is ignored for VSAM input and output data sets.
Attention: If Blockset is not selected and BSAM processing is used with
concatenated SORTIN input, and both null and non-null data sets are specified,
all null data sets must precede all non-null data sets; otherwise, the results are
unpredictable.
Attention: This option can degrade performance.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
CFW or NOCFW
CFW
NOCFW
Keeps a count of the input and output records, and abends with code 0C1
when the count reaches n. The numbers that can be assigned to x are:
2
92
Counts the input records being moved from the input buffer (not used
for a copy).
Counts the output records being moved to the output buffer (not used
for a copy or merge).
Counts the input records inserted by E15 (not used for Blockset).
Counts the output records deleted by E35 (not used for Blockset).
Initiates a SNAP dump after a Major Call to an EFS program. Any combination
of the numbers can be specified.
The numbers have the following meanings:
2
Takes the SNAP dump after Major Call 2 to the EFS program.
Takes the SNAP dump after Major Call 3 to the EFS program.
Takes the SNAP dump after Major Call 4 to the EFS program.
Takes the SNAP dump after Major Call 5 to the EFS program.
Takes the SNAP dump before Major Call 2 to the EFS program.
Takes the SNAP dump before Major Call 3 to the EFS program.
Takes the SNAP dump before Major Call 4 to the EFS program.
Takes the SNAP dump before Major Call 5 to the EFS program.
Determines the number of records having equal keys (that is, duplicate keys)
Chapter 3. Using DFSORT program control statements
93
ESTAE
NOESTAE
94
DFSORT uses Sorting Instructions when possible. If you do not want to use
these instructions, you can temporarily bypass them by specifying this
parameter.
Attention: This option can degrade performance.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
Example 2
SORT FIELDS=(12,2,BI,D)
DEBUG BSAM,ABEND
Directs DFSORT to use the BSAM access method for the SORTIN and SORTOUT
data sets and to abend if the sort application is unsuccessful.
95
Example 2
//SYSIN DD *
SORT FIELDS=(5,8,CH,A)
MODS E15=(E15,1024,SYSIN,T)
END
object deck for E15 user exit here
The END statement precedes the E15 user exit routine object deck in SYSIN.
(logical expression)
FORMAT=f
ALL
NONE
Use an INCLUDE statement if you want only certain records to appear in the
output data set. The INCLUDE statement selects the records you want to include.
You can specify either an INCLUDE statement or an OMIT statement in the same
DFSORT run, but not both.
The way in which DFSORT processes short INCLUDE/OMIT compare fields
depends on the settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. A
short field is one where the variable-length record is too short to contain the entire
field, that is, the field extends beyond the record. For details about including or
omitting short records, see the discussion of the VLSCMP and NOVLSCMP options
in OPTION control statement on page 173.
A logical expression is one or more relational conditions logically combined, based
on fields in the input record, and can be represented at a high level as follows:
relational condition1
.
,
AND
OR
,relational condition2
If the logical expression is true for a given record, the record is included in the
output data set.
Five types of relational conditions can be used as follows:
1. Comparisons:
Compare two compare fields or a compare field and a decimal, hexadecimal,
character, or current, future, or past date constant.
For example, you can compare the first 6 bytes of each record with its last 6
bytes, and include only those records in which those fields are identical. Or you
can compare a date field with today's date, yesterday's date, or tomorrow's
date, and include records accordingly.
See Comparisons on page 99 for information about comparisons.
2. Substring Comparison Tests:
96
97
v D2 format can be specified with the INCLUDE statement but not with the
INCLUDE parameter.
See OUTFIL control statements on page 223 for more details on the OUTFIL
INCLUDE parameter.
COND
COND=
(logical expression)
ALL
NONE
logical expression
specifies one or more relational conditions logically combined, based
on fields in the input record. If the logical expression is true for a
given record, the record is included in the output data sets.
ALL
specifies that all of the input records are to be included in the output
data sets.
NONE
specifies that none of the input records are to be included in the output
data sets.
Default: ALL. See Appendix B, Specification/override of DFSORT options, on
page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
FORMAT
FORMAT=f
FORMAT=f can be used to specify a particular format for one or more compare
fields. f from FORMAT=f is used for p,m fields. f from FORMAT=f is ignored
for p,m,f fields. For example, the following are all equivalent:
INCLUDE COND=(5,5,ZD,EQ,12,3,PD,OR,21,3,PD,NE,35,5,ZD)
INCLUDE FORMAT=ZD,COND=(5,5,EQ,12,3,PD,OR,21,3,PD,NE,35,5)
INCLUDE COND=(5,5,ZD,EQ,12,3,OR,21,3,NE,35,5,ZD),FORMAT=PD
The permissible field formats for comparisons are shown in Table 9 on page
100. SS (substring) is the only permissible field format for substring
comparison tests. BI (unsigned binary) is the only permissible field format for
bit logic tests. The Y2x formats are the only permissible field formats for date
98
Relational condition
A relational condition specifies a comparison, substring comparison test, bit logic
test, date comparison, numeric test or alphanumeric test to be performed.
Relational conditions can be logically combined, with AND or OR, to form a
logical expression. If they are combined, the following rules apply:
v AND statements are evaluated before OR statements unless parentheses are used
to change the order of evaluation; expressions inside parentheses are always
evaluated first. (Nesting of parentheses is limited only by the amount of storage
available.)
v The symbols & (AND) and | (OR) can be used instead of the words.
Comparisons
Relational condition format
Two formats for the relational condition can be used:
(p1,m1,BI,
EQ
NE
GT
GE
LT
LE
p2,m2,f2
constant
EQ
NE
GT
GE
LT
LE
p2,m2
,f2
constant
Equal to
NE
Not equal to
GT
Greater than
GE
LT
Less than
Chapter 3. Using DFSORT program control statements
99
Fields:
p1,m1,f1: These variables specify a field in the input record to be compared either
to another field in the input record or to a constant.
v p1 specifies the first byte of the compare field relative to the beginning of the
input record.4 The first data byte of a fixed-length record (FLR) has relative
position 1. The first data byte of a variable-length (VLR) record has relative
position 5 (because the first 4 bytes contain the record descriptor word). All
compare fields must start on a byte boundary, and no compare field can extend
beyond byte 32752.
v m1 specifies the length of the compare field. Acceptable lengths for different
formats are in Table 9.
v f1 specifies the format of the data in the compare field. Permissible formats are
given in Table 9.
You can use p1,m1 rather than p1,m1,f1 if you use FORMAT=f to supply the
format for the field.
Table 9. Compare Field Formats and Lengths
Format Code
Length
Description
CH
1 to 256 bytes
Character
AQ
1 to 256 bytes
ZD
1 to 256 bytes
PD
1 to 255 bytes
PD0
2 to 8 bytes
FI
1 to 256 bytes
Signed fixed-point
BI
1 to 256 bytes
Unsigned binary
AC
1 to 256 bytes
ASCII character
CSF or FS
1 to 32 bytes
UFF
1 to 44 bytes
SFF
1 to 44 bytes
CSL or LS
2 to 256 bytes
CST or TS
2 to 256 bytes
CLO or OL
1 to 256 bytes
CTO or OT
1 to 256 bytes
ASL
2 to 256 bytes
AST
2 to 256 bytes
4. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
100
Length
Description
D2
1 to 256 bytes
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
p2,m2,f2: These variables specify another field in the input record with which the
p1,m1,f1 field will be compared. Permissible comparisons between compare fields
with different formats are shown in Table 10 and Table 11.
AC, ASL, and AST formats sequence EBCDIC data using the ASCII collating
sequence.
You can use p2,m2 rather than p2,m2,f2 if you use FORMAT=f to supply the
format for the field.
Table 10. Permissable Field-to-Field Comparisons for INCLUDE/OMIT (Group 1)
Field Format
BI
CH
ZD
PD
BI
CH
ZD
PD
CSF or
FS
UFF
SFF
CSL or
LS
CST or
TS
CSF or FS
UFF
SFF
CSL or LS
CST or TS
FI
FI
PD0
PD0
ASL
AST
CLO or
OL
CTO or
OT
ASL
AST
CLO or OL
CTO or OT
AC
AC
AQ
D2
AQ
D2
X
X
101
CH
ZD
PD
Character String
Hexadecimal String
PD0
FI
AC
ASL
AST
CSF or FS
UFF
SFF
CSL or LS
CST or TS
CLO or OL
CTO or OT
AQ
D2
Decimal number format: The format for coding a decimal constant is:
102
[]n
Invalid
Explanation
15
++15
+15
15+
-15
1.5
18000000
1,500
Example of Constant
DATE1P
+yyyymmdd
+20050621
DATE2P
+yyyymm
+200506
DATE3P
+yyyyddd
+2005172
Note: You can precede each of the operands in the table with an & with identical
results.
Future date as decimal number: DATE1P+d, &DATE1P+d, DATE2P+m,
&DATE2P+m, DATE3P+d, or &DATE3P+d can be used to generate a decimal
number for a future date relative to the current date of the run. d is days in the
future and m is months in the future. d and m can be 0 to 9999.
Table 15 on page 104 shows the form of the decimal number constant generated for
each future date operand along with an example of the actual decimal number
generated when the date of the run is June 21, 2005. yyyy represents the year, mm
represents the month (01-12) , dd represents the day (01-31) and ddd represents the
day of the year (001-366).
103
DATE1P+d
+yyyymmdd
DATE1P+11
+20050702
DATE2P+m
+yyyymm
DATE2P+2
+200508
DATE3P+d
+yyyyddd
DATE3P+200
+2006007
Note: You can precede each of the operands in the table with an & with identical
results.
Past date as decimal number: DATE1P-d, &DATE1P-d, DATE2P-m, &DATE2P-m,
DATE3P-d, or &DATE3P-d can be used to generate a decimal number for a past
date relative to the current date of the run. d is days in the past and m is months
in the past. d and m can be 0 to 9999.
Table 16 shows the form of the decimal number constant generated for each past
date operand along with an example of the actual decimal number generated when
the date of the run is June 21, 2005. yyyy represents the year, mm represents the
month (01-12), dd represents the day (01-31) and ddd represents the day of the
year (001-366).
Table 16. Decimal Numbers for Past Dates
Format of Constant
DATE1P-d
+yyyymmdd
DATE1P-30
+20050522
DATE2P-m
+yyyymm
DATE2P-12
+200406
DATE3P-d
+yyyyddd
DATE3P-172
+2004366
Note: You can precede each of the operands in the table with an & with identical
results.
Character string format: The format for coding a character string constant is:
C'xx...x'
The value x may be any EBCDIC character (the EBCDIC character string is
translated appropriately for comparison to an AC or AQ field). You can specify up
to 256 characters.
If you want to include a single apostrophe in the character string, you must specify
it as two single apostrophes. Thus:
Required:
ONEILL
Specify: CONEILL
Examples of valid and invalid character string constants are shown in Table 17:
Table 17. Valid and Invalid Character String Constants
104
Valid
Invalid
Explanation
C'JDCO'
C'''''
C'$@#'
'ABCDEF'
C identifier missing
C'+0.193'
C'ABCDEF
Apostrophe missing
C'Frank''s'
C'Frank's'
Explanation
C'Q<D1D2>T'
C'Q<R>S'
C'<D1D2D3>'
C'D1D2D3'
C'Q<D1>R<D2>'
C'Q<D1<D2>>'
Nested SO/SI
Tip: X'0E', X'0F', and X'7D' are treated as the special characters shift-out, shift-in,
and single apostrophe in a character string. If you don't want to treat one or more
of these characters as special in a particular value, use a hexadecimal string instead
of a character string. For example, if you want to treat the binary value 000E0E7D
as its decimal equivalent of 921213, use X'000E0E7D'; 0E will not be treated as
shift-out and 7D will not be treated as a single apostrophe.
Current date as character string: DATE1, &DATE1, DATE1(c), &DATE1(c),
DATE2, &DATE2, DATE2(c), &DATE2(c), DATE3, &DATE3, DATE3(c), &DATE3(c),
DATE4, &DATE4, DATE5 or &DATE5 can be used to generate a character string
for the current date of the run.
Table 19 shows the form of the character string constant generated for each current
date operand along with an example of the actual character string generated when
the date of the run is June 21, 2005 at 04:42:45 PM, using (/) for (c) where relevant.
yyyy represents the year, mm (for date) represents the month (01-12), dd represents
the day (01-31), ddd represents the day of the year (001-366), hh represents the
hour (00-23), mm (for time) represents the minutes (00-59), ss represents the
seconds (00-59), nnnnnn represents the microseconds (000000-999999) and c can be
any character except a blank.
Table 19. Character Strings for Current Date
Format of Constant
Example of Constant
DATE1
C'yyyymmdd'
C'20050621'
DATE1(c)
C'yyyycmmcdd'
C'2005/06/21'
DATE2
C'yyyymm'
C'200506'
DATE2(c)
C'yyyycmm'
C'2005/06'
DATE3
C'yyyyddd'
C'2005172'
105
Example of Constant
DATE3(c)
C'yyyycddd'
C'2005/172'
DATE4
C'yyyy-mm-dd-hh.mm.ss'
C'2005-06-21-16.52.45'
DATE4
C'yyyy-mm-dd-hh.mm.ss'
C'2005-06-21-16.52.45'
DATE5
C'yyyy-mm-dd-hh.mm.ss.nnnnnn'
C'2005-06-21-16.52.45.582013'
Note: You can precede each of the operands in the table with an & with identical
results.
Tip: When a field is shorter than the character string it's compared to, DFSORT
truncates the string on the right. You can take advantage of this to compare a field
to only part of the DATE4 timestamp when appropriate. For example:
INCLUDE COND=(1,13,CH,GT,DATE4)
would compare the field in positions 1-13 to the truncated DATE4 constant
C'yyyy-mm-dd-hh'.
Future date as character string: DATE1+d, &DATE1+d, DATE1(c)+d,
&DATE1(c)+d, DATE2+m, &DATE2+m, DATE2(c)+m, &DATE2(c)+m, DATE3+d,
&DATE3+d, DATE3(c)+d or &DATE3(c)+d can be used to generate a character
string for a future date relative to the current date of the run. d is days in the
future and m is months in the future. d and m can be 0 to 9999.
Table 20 shows the form of the character string constant generated for each future
date operand along with an example of the actual character string generated when
the date of the run is June 21, 2005. yyyy represents the year, mm represents the
month (01-12), dd represents the day (01-31), ddd represents the day of the year
(001-366), and c can be any character except a blank.
Table 20. Character Strings for Future Dates
Format of Constant
DATE1+d
C'yyyymmdd'
DATE1+11
C'20050702'
DATE1(c)+d
C'yyyycmmcdd'
DATE1(/)+90
C'2005/09/19'
DATE2+m
C'yyyymm'
DATE2+2
C'200508'
DATE2(c)+m
C'yyyycmm'
DATE2(.)+25
C'2007.07'
DATE3+d
C'yyyyddd'
DATE3+200
C'2006007'
DATE3(c)+d
C'yyyycddd'
DATE3(-)+1
C'2005-171'
Note: You can precede each of the operands in the table with an & with identical
results.
Past date as character string: DATE1-d, &DATE1-d, DATE1(c)-d, &DATE1(c)-d,
DATE2-m, &DATE2-m, DATE2(c)-m, &DATE2(c)-m, DATE3-d, &DATE3-d,
DATE3(c)-d or &DATE3(c)-d can be used to generate a character string for a past
date relative to the current date of the run. d is days in the past and m is months
in the past. d and m can be 0 to 9999.
Table 21 on page 107 shows the form of the character string constant generated for
each past date operand along with an example of the actual character string
generated when the date of the run is June 21, 2005. yyyy represents the year, mm
106
DATE1-d
C'yyyymmdd'
DATE1-1
C'20050620'
DATE1(c)-d
C'yyyycmmcdd'
DATE1(-)-60
C'2005-04-22'
DATE2-m
C'yyyymm'
DATE2-6
C'200412'
DATE2(c)-m
C'yyyycmm'
DATE2(/)-1
C'2005/05'
DATE3-d
C'yyyyddd'
DATE3-300
C'2004238'
DATE3(c)-d
C'yyyycddd'
DATE3(.)-21
C'2005.151'
Note: You can precede each of the operands in the table with an & with identical
results.
Hexadecimal string format: The format for coding a hexadecimal string constant
is:
X'yy...yy'
The value yy represents any pair of hexadecimal digits. You can specify up to 256
pairs of hexadecimal digits.
Because the first digit and sign are ignored in a PD0 field, you should not include
the first digit or sign in a hexadecimal constant to be compared to a PD0 field. For
example, 3-byte PD0 values like X'01234C' and X'01234D' would be equal to a
hexadecimal constant of X'1234'.
Examples of valid and invalid hexadecimal constants are shown in the following
table.
Table 22. Valid and Invalid Hexadecimal Constants
Valid
Invalid
Explanation
X'ABCD'
X'ABGD'
X'BF3C'
X'BF3'
X'AF050505'
'AF050505'
Missing X identifier
X'BF3C'
'BF3C'X
107
COND=(5,8,GT,13,8,|,105,4,LE,1000),FORMAT=CSF
Example 2
INCLUDE
COND=(1,10,CH,EQ,CSTOCKHOLM,
AND,21,8,ZD,GT,+50000,
OR,31,4,CH,NE,CHERR)
108
Example 3
INCLUDE FORMAT=CH,
COND=((5,1,EQ,8,1),&,
((20,1,EQ,CA,&,30,1,FI,GT,10),|,
(20,1,EQ,CB,&,30,1,FI,LT,100),|,
(20,1,NE,CA,&,20,1,NE,CB)))
Example 4
INCLUDE COND=(7,2,CH,EQ,CT1,OR,
(1,2,BI,GE,X001A,AND,20,2,CH,EQ,25,2,CH))
109
RDW
compare
field A
compare
field B
T1
10
compare
field C
RDW
compare
field D
T2
7
20
25
Example 5
INCLUDE COND=(21,8,ZD,GT,DATE1P)
Example 6
INCLUDE COND=(15,7,CH,GE,DATE3-7,AND,15,7,CH,LE,DATE3+7)
This example illustrates how to include records in which a character date of the
form C'yyyyddd' in bytes 15-21 is between 7 days in the past and 7 days in the
future, relative to the current date. DATE3-7 generates a character constant in the
form C'yyyyddd' where yyyyddd is the current date minus 7 days. DATE3+7
generates a character constant in the form C'yyyyddd' where yyyyddd is the
current date plus 7 days.
Example 7
INCLUDE COND=(21,10,CH,GE,DATE1(-)-365)
This example illustrates how to include records in which a character date of the
form C'yyyy-mm-dd' in bytes 21-30 is within 365 days of the current date.
DATE1(-)-365 generates a character constant in the form C'yyyy-mm-dd' where
yyyymmdd is the current date minus 365 days.
110
EQ
NE
, constant )
EQ
NE
, constant )
Equal to
NE
Not equal to
Fields:
p1,m1: These variables specify the character field in the input record for the
substring test.
v p1 specifies the first byte of the character input field for the substring test,
relative to the beginning of the input record.6 The first data byte of a
fixed-length record (FLR) has relative position 1. The first data byte of a
variable-length (VLR) record has relative position 5 (because the first 4 bytes
contain the record descriptor word). All fields to be tested must start on a byte
boundary and must not extend beyond byte 32752.
v m1 specifies the length of the field to be tested. The length can be 1 to 32752
bytes.
Constant: The constant can be a character string or a hexadecimal string. See
Character string format on page 104 and Hexadecimal string format on page
107 for details.
If m1 is greater than the length of the constant, the field value will be searched for
the constant and the condition will be true if a match is found when the EQ
comparison operator is specified or if a match is not found when the NE
comparison operator is specified.
If m1 is smaller than the length of the constant, the constant will be searched for
the field value and the condition will be true if a match is found when the EQ
comparison operator is specified or if a match is not found when the NE
comparison operator is specified.
6. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
Chapter 3. Using DFSORT program control statements
111
ALL
SOME
NONE
NOTALL
NOTSOME
NOTNONE
BO
BM
BZ
BNO
BNM
BNZ
, mask )
112
ALL
SOME
NONE
NOTALL
NOTSOME
NOTNONE
BO
BM
BZ
BNO
BNM
BNZ
, mask )
Bit operators describe the input field to mask relationship to be tested as follows:
ALL or BO
All mask bits are on in the input field
SOME or BM
Some, but not all mask bits are on in the input field
NONE or BZ
No mask bits are on in the input field
NOTALL or BNO
Some or no mask bits are on in the input field
NOTSOME or BNM
All or no mask bits are on in the input field
NOTNONE or BNZ
All or some mask bits are on in the input field
The first set of operators (ALL, SOME, and so on) are intended for those who like
meaningful mnemonics. The second set of operators (BO, BM, and so on) are
intended for those familiar with the conditions associated with the Test Under
Mask (TM) instruction.
Fields
p1,m1: These variables specify the binary field in the input record to be tested
against the mask.
v p1 specifies the first byte of the binary input field to be tested against the mask,
relative to the beginning of the input record.7 The first data byte of a
fixed-length record (FLR) has relative position 1. The first data byte of a
variable-length (VLR) record has relative position 5 (because the first 4 bytes
contain the record descriptor word). All fields to be tested must start on a byte
boundary and must not extend beyond byte 32752.
v m1 specifies the length of the field to be tested. The length can be 1 to 256 bytes.
Mask
A hexadecimal string or bit string that indicates the bits in the field selected for
testing. If a mask bit is on (1), the corresponding bit in the field is tested. If a mask
bit is off (0), the corresponding bit in the field is ignored.
7. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
Chapter 3. Using DFSORT program control statements
113
The value yy represents any pair of hexadecimal digits that constitute a byte (8
bits). Each bit must be 1 (test bit) or 0 (ignore bit). You can specify up to 256 pairs
of hexadecimal digits.
Bit string format: The format for coding a bit string mask is:
B'bbbbbbbb...bbbbbbbb'
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1
(test bit) or 0 (ignore bit). You can specify up to 256 groups of 8 bits. The total
number of bits in the mask must be a multiple of 8. A bit mask string can only be
used with a bit operator.
COND=(27,1,CH,EQ,CD,AND,18,1,BI,ALL,B10000000)
Example 2
INCLUDE
COND=(11,1,BI,BM,X85)
This example illustrates how to only include records in which byte 11 has some,
but not all of bits 0, 5 and 7 on. Results for selected field values are shown as
follows:
Table 23. Bit Comparison Example 2: Results for Selected Field Values
11,1,BI Result
Action
X'85'
False
Omit Record
X'C1'
True
Include Record
X'84'
True
Include Record
X'00'
False
Omit Record
Example 3
INCLUDE
114
COND=(11,2,ALL,B0001001000110100,
OR,21,1,NONE,B01001100),FORMAT=BI
21,1,BI Value
21,1,BI Result
Action
X'1234'
True
X'4C'
False
Include Record
X'02C4'
False
X'81'
True
Include Record
X'0204'
False
X'40'
False
Omit Record
X'F334'
True
X'00'
True
Include Record
X'1238'
False
X'4F'
False
Omit Record
EQ
NE
, constant )
EQ
NE
, constant )
Equal to
NE
Not equal to
Fields
p1,m1: These variables specify the binary field in the input record to be compared
to the bit constant.
v p1 specifies the first byte of the binary input field to be compared to the bit
constant, relative to the beginning of the input record.8 The first data byte of a
fixed-length record (FLR) has relative position 1. The first data byte of a
variable-length (VLR) record has relative position 5 (because the first 4 bytes
contain the record descriptor word). All fields to be tested must start on a byte
boundary and must not extend beyond byte 32752.
8. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
Chapter 3. Using DFSORT program control statements
115
Bit constant
A bit string constant that specifies the pattern to which the binary field is
compared. If a bit in the constant is 1 or 0, the corresponding bit in the field is
compared to 1 or 0, respectively. If a bit in the constant is . (period), the
corresponding bit in the field is ignored.
Bit string format: The format for coding a bit string constant is:
B'bbbbbbbb...bbbbbbbb'
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1
(test bit for 1), 0 (test bit for 0) or . (ignore bit). You can specify up to 256 groups of
8 bits. The total number of bits in the mask must be a multiple of 8. A bit constant
can only be used for bit comparison tests (BI format and EQ or NE operator).
COND=(27,1,CH,EQ,CD,AND,18,1,BI,EQ,B1.......)
Example 2
INCLUDE
COND=(11,1,BI,NE,B10...1.1)
This example illustrates how to only include records in which byte 11 is not equal
to the specified pattern of bit 0 on, bit 1 off, bit 5 on and bit 7 on. Results for
selected field values are shown :
Table 25. Bit Comparison Example 2: Results for Selected Field Values
116
11,1,BI Result
Action
X'85'
False
Omit Record
X'C1'
True
Include Record
X'84'
True
Include Record
X'97'
False
Omit Record
Example 3
INCLUDE
COND=(11,2,EQ,B..01....0......1,
OR,21,1,EQ,B01......),FORMAT=BI
21,1,BI Value
21,1,BI Result
Action
X'1221'
True
X'C0'
False
Include Record
X'02C4'
False
X'41'
True
Include Record
X'1234'
False
X'00'
False
Omit Record
X'5F7F'
True
X'7F'
True
Include Record
X'FFFF'
False
X'2F'
False
Omit Record
Date comparisons
You can use DFSORT's Y2 formats in conjunction with the century window in
effect, as follows:
v Use the full date formats (Y2T, Y2U, Y2V, Y2W, Y2X and Y2Y) to compare a
two-digit year date field to a two-digit year date constant, a current, future or
past two-digit year date (Y constant), or to another two-digit year date field.
v Use the year formats (Y2C, Y2Z, Y2S, Y2P, Y2D and Y2B) to compare a two-digit
year field to a two-digit year constant (Y constant) or to another two-digit year
field.
For example, you can include only those records for which a Z'yymm' date field is
between January 1996 and March 2005. Or you can include only those records for
which a P'dddyy' field is less than another P'dddyy' field. Or you can include only
those records for which a C'yyddd' field is between today's date and 5 days earlier
than today's date.
The ordering of dates and special indicators used for comparisons with Y2 fields
and Y constants is the same as the ascending orders for sorting and merging Y2
fields (see SORT control statement on page 442 for details).
EQ
NE
GT
GE
LT
LE
p2,m2,Y2x
constant
117
EQ
NE
GT
GE
LT
LE
p2,m2
,Y2x
constant
Equal to
NE
Not equal to
GT
Greater than
GE
LT
Less than
LE
Fields:
p1,m1,Y2x: These variables specify a two-digit year date field in the input record
to be compared either to another two-digit year date field in the input record or to
a two-digit year date constant.
v p1 specifies the first byte of the date field relative to the beginning of the input
record.9 The first data byte of a fixed-length record (FLR) has relative position 1.
The first data byte of a variable-length (VLR) record has relative position 5
(because the first 4 bytes contain the record descriptor word). All date fields
must start on a byte boundary, and no date field can extend beyond byte 32752.
v m1 specifies the length of the date field. Appendix C, Data format
descriptions, on page 891 describes the length and format for each type of date
field.
v Y2x specifies the Y2 format. Appendix C, Data format descriptions, on page
891 describes the length (m) and format (Y2x) for each type of date field.
You can use p1,m1 rather than p1,m1,Y2x if you use FORMAT=Y2x to supply the
format for the date field.
p2,m2,Y2x: These variables specify another two-digit year date field in the input
record with which the p1,m1,Y2x field will be compared.
You can use p2,m2 rather than p2,m2,Y2x if you use FORMAT=Y2x to supply the
format for the date field.
Constant: A two-digit year date constant in the form Y'string', Y'DATE1',
Y'DATE1'+d, Y'DATE1'-d, Y'DATE2', Y'DATE2'+m, Y'DATE2'-m, Y'DATE3',
Y'DATE3'+d, or Y'DATE3'-d, with which the p1,m1,Y2x field will be compared.
Comparisons: A date field can be compared to a date constant or another date
field with the same number of non-year (x) digits. Table 27 on page 119 shows the
type of field-to-field and field-to-constant comparisons you can use. The fields
shown for any type of date (for example, yyx and xyy) can be compared to any
other fields shown for that type of date or to the Y constant shown for that type of
date.
9. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
118
Fields (m,f)
Y Constant
3,Y2T
3,Y2W
2,Y2U
2,Y2X
Y'yyx'
4,Y2T
4,Y2W
3,Y2V
3,Y2Y
Y'yyxx'
Y'DATE2'
Y'DATE2'+m
Y'DATE2'-m
5,Y2T
5,Y2W
3,Y2U
3,Y2X
Y'yyxxx'
Y'DATE3'
Y'DATE3'+d
Y'DATE3'-d
6,Y2T
6,Y2W
4,Y2V
4,Y2Y
Y'yyxxxx'
Y'DATE1'
Y'DATE1'+d
Y'DATE1'-d
yy
2,Y2C
2,Y2S
1,Y2D
2,Y2Z
2,Y2P
1,Y2B
Y'yy'
Y constants for current, future, and past two-digit year dates are as follows. d can
be 0 to 9999 days and m can be 0 to 9999 months.
v Y'DATE1' generates a Y constant for the current date in the form Y'yymmdd'
v Y'DATE1'+d generates a Y constant for the current date plus d days in the form
Y'yymmdd'
v Y'DATE1'-d generates a Y constant for the current date minus d days in the form
Y'yymmdd'
v Y'DATE2' generates a Y constant for the current date in the form Y'yymm'
v Y'DATE2'+m generates a Y constant for the current date plus m months in the
form Y'yymm'
v Y'DATE2'-m generates a Y constant for the current date minus m months in the
form Y'yymm'
v Y'DATE3' generates a Y constant for the current date in the form Y'yyddd'
v Y'DATE3'+d generates a Y constant for the current date plus d days in the form
Y'yyddd'
v Y'DATE3'-d generates a Y constant for the current date minus d days in the form
Y'yyddd'.
You must use the same number of digits in a Y constant as the type of date;
leading zeros must be specified (for example, for Y'yymm', use Y'0001' for January
2000 and Y'0501' for January 2005).
You can also use Y constants for special indicators as follows:
v Y'0...0' (CH/ZD/PD zeros) and Y'9...9' (CH/ZD/PD nines) can be used with
Y2T, Y2U, Y2V, Y2W, Y2X and Y2Y dates. You must use the same number of
digits as the type of date (for example, Y'000' for yyq or qyy, Y'0000' for yymm
or mmyy, and so forth).
v
Y'LOW' (BI zeros), Y'BLANKS' (blanks) and Y'HIGH' (BI ones) can be used with
Y2T, Y2W and Y2S dates.
119
Example 2
INCLUDE COND=(2,3,Y2X,LT,36,5,Y2T)
This example illustrates how to only include records in which a P'dddyy' date field
in bytes 2 through 4 is less than a Z'yyddd' date field in bytes 36 through 40.
Note that the century window in effect will be used to interpret real dates in the
P'dddyy' and Z'yyddd' date fields. However, the century window will not be used
to interpret special indicators in the P'dddyy' and Z'yyddd' date fields.
Numeric tests
You can test a field for numerics or non-numerics in character, zoned decimal or
packed decimal format.
For example, you can include only those records in which a 5-byte field contains
only '0'-'9' characters (that is, character numerics). Or you can include only those
records in which a 9-byte field contains invalid zoned decimal data (that is, zoned
decimal non-numerics). Or you can include only those records in which a 12-byte
field contains valid packed decimal data (that is, packed decimal numerics).
A field to be tested for numerics in character format looks like this in hexadecimal:
FdFd...Fd
120
EQ
NE
,NUM)
EQ
NE
,NUM)
Equal to numerics
NE
Fields:
p1,m1,f1: These variables specify the field in the input record for the numeric test.
v p1 specifies the first byte of the field relative to the beginning of the input
record 10. The first data byte of a fixed-length record (FLR) has relative position
1. The first data byte of a variable-length (VLR) record has relative position 5
(because the first 4 bytes contain the record descriptor word). All fields must
start on a byte boundary, and no field can extend beyond byte 32752.
v m1 specifies the length of the field. The length can be 1 to 256 bytes.
v f1 specifies the type of numerics the field is to be tested for as follows:
FS
ZD
PD
test for numerics in packed decimal format (0-9 for all digits; F, D or C
for the sign).
10. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
Chapter 3. Using DFSORT program control statements
121
This example illustrates how to only include records in which the field in bytes 1
through 20 contains valid character numeric data (that is, '0'-'9' in all bytes).
Example 2
INCLUDE COND=(21,8,ZD,NE,NUM,OR,31,5,PD,NE,NUM)
This example illustrates how to only include records in which the field in bytes 21
through 28 contains invalid zoned decimal data, or the field in bytes 31 through 35
contains invalid packed decimal data (that is, one of the fields is non-numeric).
Alphanumeric tests
You can test a field for alphanumerics or non-alphanumerics in character format.
Various combinations of uppercase characters (A-Z), lowercase characters (a-z) and
numeric characters (0-9) can be used.
For example, you can include only those records in which a 10-byte field contains
only 'A'-'Z' characters (that is, uppercase characters) or '0'-'9' characters (that is,
numeric characters). Or you can include only those records in which a 20-byte field
contains characters other than 'a'-'z' (that is, lowercase characters).
The following combinations of alphanumeric characters can be used:
v Uppercase characters (A-Z)
v Lowercase characters (a-z)
v Mixed case characters (A-Z, a-z)
v Uppercase and numeric characters (A-Z, 0-9)
v Lowercase and numeric characters (a-z, 0-9)
v Mixed case and numeric characters (A-Z, a-z, 0-9)
EQ
NE
UC
LC
MC
UN
LN
MN
122
EQ
NE
UC
LC
MC
UN
LN
MN
NE
Fields:
p1,m1
These variables specify the field in the input record for the alphanumeric
test.
v p1 specifies the first byte of the field relative to the beginning of the
input record11. The first data byte of a fixed-length record (FLR) has
relative position 1. The first data byte of a variable-length (VLR) record
has relative position 5 (because the first 4 bytes contain the record
descriptor word). All fields must start on a byte boundary, and no field
can extend beyond byte 32752.
v m1 specifies the length of the field. The length can be 1 to 256 bytes.
UC
Specifies a test for the set of uppercase characters (A-Z). The condition will
be true if the field is all uppercase characters when the EQ operator is
specified or if the field is not all uppercase characters when the NE
operator is specified.
LC
Specifies a test for the set of lowercase characters (a-z). The condition will
be true if the field is all lowercase characters when the EQ operator is
specified or if the field is not all lowercase characters when the NE
operator is specified.
MC
Specifies a test for the set of mixed case characters (A-Z and a-z). The
condition will be true if the field is all mixed case characters when the EQ
operator is specified or if the field is not all mixed case characters when
the NE operator is specified.
UN
Specifies a test for the set of uppercase and numeric characters (A-Z and
0-9). The condition will be true if the field is all uppercase or numeric
characters when the EQ operator is specified or if the field is not all
uppercase or numeric characters when the NE operator is specified.
LN
Specifies a test for the set of lowercase and numeric characters (a-z and
0-9). The condition will be true if the field is all lowercase or numeric
characters when the EQ operator is specified or if the field is not all
lowercase or numeric characters when the NE operator is specified.
MN
Specifies a test for the set of mixed case and numeric characters (A-Z, a-z
or 0-9). The condition will be true if the field is all mixed case or numeric
characters when the EQ operator is specified or if the field is not all mixed
case or numeric characters when the NE operator is specified.
11. If your E15 user exit routine formats the record, p1 must refer to the record as reformatted by the exit.
Chapter 3. Using DFSORT program control statements
123
This example illustrates how to only include records in which the field in bytes 11
through 20 contains only mixed case characters (that is, 'A'-'Z' or 'a'-'z' in all bytes).
A record with 'AaBbZRStuv' in 11-20 would be included, whereas a record with
'Aa7BtuvZQR' would not be included.
Example 2
INCLUDE COND=(21,4,BI,NE,LN)
This example illustrates how to only include records in which the field in bytes 21
through 24 does not contain all lowercase or numeric characters (that is, one of the
bytes is not 'a'-'z' or '0'-'9'). A record with 'a,23' would be included, whereas a
record with 'a2b9' would not be included.
124
Statement
Compare
AND
OR
OMIT
True
OMIT record
OMIT
False
INCLUDE record
Compare
AND
OR
INCLUDE
True
INCLUDE record
INCLUDE
False
OMIT record
Check compare, or if
last compare, OMIT
record.
PARSE=( definition
,
FIELDS=
BUILD=
( item
,
OVERLAY=( item
,
FINDREP=( item
,
IFTHEN=(clause)
IFOUTLEN=n
The INREC control statement allows you to reformat the input records before they
are sorted, merged, or copied.
The INREC control statement supports a wide variety of parsing, editing, and
reformatting tasks, including:
v The use of fixed position/length fields or variable position/length fields. For
fixed fields, you specify the starting position and length of the field directly. For
variable fields, such as delimited fields, comma separated values (CSV), tab
separated values, blank separated values, keyword separated fields,
null-terminated strings (and many other types), you define rules that allow
DFSORT to extract the relevant data into fixed parsed fields, and then use the
parsed fields as you would use fixed fields.
v Insertion of blanks, zeros, strings, current date, future date, past date, current
time, sequence numbers, decimal constants, and the results of arithmetic
expressions before, between, and after the input fields in the reformatted
records.
v
v Sophisticated conversion capabilities, such as find and replace, hexadecimal
display, bit display, translation of EBCDIC letters from lowercase to uppercase or
uppercase to lowercase, translation of characters from EBCDIC to ASCII and
from ASCII to EBCDIC, translation of characters using the ALTSEQ translation
table, conversion of numeric values from one format to another, left-justify or
Chapter 3. Using DFSORT program control statements
125
v
v
left-squeeze (remove leading blanks or all blanks and shift left), and right-justify
or right-squeeze (remove trailing blanks or all blanks and shift right).
Sophisticated editing capabilities, such as control of the way numeric fields are
presented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs, and
so on.
Twenty-seven pre-defined editing masks are available for commonly used
numeric editing patterns, encompassing many of the numeric notations used
throughout the world. In addition, a virtually unlimited number of numeric
editing patterns are available via user-defined editing masks.
Transformation of SMF, TOD, and ETOD date and time values to more usable
forms.
Conversion of input date fields of one type (CH, ZD, PD, 2-digit year, 4-digit
year, Julian, Gregorian) to corresponding output date fields of another type or to
a corresponding day of the week.
Various types of arithmetic operations for input date fields.
v OVERLAY: Reformat each record by specifying just the items that overlay
specific columns. Overlay lets you change specific existing columns without
affecting the entire record. Example:
INREC OVERLAY=(45:45,8,TRAN=LTOU)
v FINDREP: Reformat each record by doing various types of find and replace
operations. Example:
INREC FINDREP=(IN=CMr.,OUT=CMister)
You can choose to include any or all of the following items in your reformatted
INREC records:
v Fixed position/length fields or variable position/length fields. For fixed fields,
you specify the starting position and length of the field directly. For variable
fields, such as delimited fields, comma separated values (CSV), tab separated
values, blank separated values, keyword separated fields, null-terminated strings
126
PARSE
127
%n=
%nn=
%nnn=
%=
FIXLEN=m
ABSPOS=p
ADDPOS=x
SUBPOS=y
,
STARTAFT=string
STARTAFT=an
STARTAFT=BLANKS
STARTAT=string
STARTAT=an
STARTAT=BLANKS
STARTAT=NONBLANK
,
ENDBEFR=string
ENDBEFR=an
ENDBEFR=BLANKS
ENDAT=string
ENDAT=an
ENDAT=BLANKS
PAIR=APOST
PAIR=QUOTE
REPEAT=v
This operand allows you to extract variable position/length fields into fixed
parsed fields. Parsed fields (%n, %nn or %nnn) can be used where fixed
position/length fields (p,m) can be used in the BUILD (or FIELDS) or
OVERLAY operands as described later in this section.
Note: Although you can use %n (%0-%9), %nn (%00-%99) or %nnn
(%000-%999) for a parsed field, for convenience in this book %nn will be used
in general when referring to a parsed field. %n, %0n or %00n can be used
interchangeably for parsed field n (for example, %1, %01 or %001 for parsed
field 1). %nn or %0nn can be used interchangeably for parsed field nn (for
example, %12 or %012 for parsed field 12).
PARSE can be used for many different types of variable fields including
delimited fields, comma separated values (CSV), tab separated values, blank
separated values, keyword separated fields, null-terminated strings, and so on.
You can assign up to 1000 parsed fields (%0-%999) to the variable fields you
want to extract.
Note that if all of the fields in your records have fixed positions and lengths,
you don't need to use PARSE. But if any of the fields in your records have
variable positions or lengths, you can use PARSE to treat them as fixed parsed
fields in BUILD or OVERLAY. You can mix p,m fields (fixed fields) and %nn
fields (parsed fields) in BUILD and OVERLAY.
See PARSE under "OUTFIL Control Statements" for complete details.
Sample Syntax
INREC PARSE=(%00=(ENDBEFR=C*,FIXLEN=3),
%01=(ENDBEFR=BLANKS,FIXLEN=6),
%02=(STARTAT=CMAX,FIXLEN=8),
%03=(STARTAFT=C(,ENDBEFR=C),FIXLEN=6),
128
FIELDS=
BUILD=
c:
s
p,m
,a
%nn
p
p,m
%nn
p
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
Specifies all of the items in the reformatted INREC record in the order in
which they are to be included. The reformatted INREC record consists of the
separation fields, edited and unedited input fields (p,m for fixed fields, or %nn
for parsed fields - see PARSE),, edited decimal constants, edited results of
arithmetic expressions, and sequence numbers you select, in the order in which
you select them, aligned on the boundaries or in the columns you indicate.
Chapter 3. Using DFSORT program control statements
129
unedited RDW
display RDW length in decimal
| separator
display input positions 5 to end
For fixed-length records, the first input and output data byte starts at position
1. For variable-length records, the first input and output data byte starts at
position 5, after the RDW in positions 1-4.
c: Specifies the position (column) for a separation field, input field, decimal
constant, arithmetic expression, or sequence number, relative to the start of
the reformatted input record. Unused space preceding the specified column
is padded with EBCDIC blanks. The following rules apply:
v c must be a number between 1 and 32752.
v c: must be followed by a separation field, input field, decimal constant,
or arithmetic expression.
v c must not overlap the previous input field or separation field in the
reformatted input record.
v for variable-length records, c: must not be specified before the first input
field (the record descriptor word) nor after the variable part of the input
record.
v The colon (:) is treated like the comma (,) or semicolon (;) for
continuation to another line.
Both valid and invalid examples are shown in Table 29.
Table 29. Examples of Valid and Invalid Column Alignment. Examples of Valid and Invalid
Column Alignment
Validity
Specified
Result
Valid
33:C'State '
Valid
20:5,4,30:10,8
Columns
Columns
Columns
Columns
Invalid
0:5,4
Invalid
:25Z
Invalid
32753:21,8
Invalid
5:10:2,5
Invalid
20,10,6:C'AB'
130
1-19 blank
20-23 input field (5,4)
24-29 blank
30-37 input field (10,8)
Result
Valid
X or 1X
1 blank
Valid
4095X
4095 blanks
Invalid
5000X
Invalid
0X
0 is not allowed.
nZ
Binary zero separation. n bytes of binary zeros (X'00') are to appear
in the reformatted input records. n can range from 1 to 4095. If n is
omitted, 1 is used.
Examples of valid and invalid binary zero separation are shown in
Table 31.
Table 31. Examples of Valid and Invalid Binary Zero Separation
Specified
Result
Valid
Z or 1Z
1 binary zero
Valid
4095Z
Invalid
4450Z
Invalid
0Z
0 is not allowed.
nC'xx...x'
Character string separation. n repetitions of the character string
constant (C'xx...x') are to appear in the reformatted input records. n
can range from 1 to 4095. If n is omitted, 1 is used. x can be any
EBCDIC character. You can specify from 1 to 256 characters.
If you want to include a single apostrophe in the character string,
you must specify it as two single apostrophes:
Required:
ONEILL
Specify:
CONEILL
Result
Length
Valid
C'John Doe'
John Doe
Valid
C'JOHN DOE'
JOHN DOE
Valid
C'$@#'
$@#
131
Result
Length
Valid
C'+0.193'
+0.193
Valid
4000C'
8000 blanks
8000
Valid
20C'**FILLER**'
200
Valid
C'Frank''s'
Frank's
Invalid
C'''''
n/a
Invalid
'ABCDEF'
C identifier missing
n/a
Invalid
C'ABCDE
Apostrophe missing
n/a
Invalid
4450C'1'
n/a
Invalid
0C'ABC'
0 is not allowed
n/a
Invalid
C''
No characters specified
n/a
Invalid
C'Frank's'
n/a
'
nX'yy...yy'
Hexadecimal string separation. n repetitions of the hexadecimal
string constant (X'yy...yy') are to appear in the reformatted input
records. n can range from 1 to 4095. If n is omitted, 1 is used.
The value yy represents any pair of hexadecimal digits. You can
specify from 1 to 256 pairs of hexadecimal digits. Examples of
valid and invalid hexadecimal string separation are shown in
Table 33.
Table 33. Examples of Valid and Invalid Hexadecimal String Separation
Specified
Result
Length
Valid
X'FF'
FF
Valid
X'BF3C'
BF3C
Valid
3X'00000F'
00000F00000F00000F
Valid
4000X'FFFF'
8000
Invalid
X'ABGD'
n/a
Invalid
X'F1F'
n/a
Invalid
'BF3C'
X identifier missing
n/a
Invalid
'F2F1'X
X in wrong place
n/a
Invalid
8000X'01'
n/a
Invalid
0X'23AB'
0 is not allowed
n/a
Invalid
X''
n/a
132
133
Specifies the first byte of the input field relative to the beginning of
the input record.12 The first data byte of a fixed-length record has
relative position 1. The first data byte of a variable-length record
has relative position 5 (because the first 4 bytes contain the RDW).
All fields must start on a byte boundary, and no field can extend
beyond byte 32752. For special rules concerning variable-length
records, see INREC statement notes on page 148.
Specifies the length of the input field. It must include the sign if
the data is signed, and must be an integer number of bytes. See
INREC statement notes on page 148 for more information.
12. If your E15 user exit reformats the record, p must refer to the record as reformatted by the exit.
134
specifies that the unedited variable part of the input record (that part
beyond the minimum record length), is to appear in the reformatted input
record, as the last field. p without m can only be used for variable-length
records; not for fixed-length records.
Attention: If 1,4,p is specified (only RDW and variable part of record),
"null" records containing only an RDW will result if the record length is
less than p.
A value must be specified for p that is less than or equal to the minimum
record length (RECORD statement L4 value) plus 1 byte.
p,m,TRAN=keyword
Specifies that an input field is to be translated as indicated by the
keyword. See p,m,TRAN=keyword under OUTFIL OUTREC for details.
%nn,TRAN=keyword
Specifies that a parsed input field is to be translated as indicated by the
keyword. See %nn,TRAN=keyword under OUTFIL OUTREC for details.
p,TRAN=keyword
Specifies that the variable part of the input record is to be translated as
indicated by the keyword. See p,TRAN=keyword under OUTFIL OUTREC
for details.
p,m,HEX
Can be used instead of p,m,TRAN=HEX. See p,m,HEX under OUTFIL
OUTREC for details.
%nn,HEX
Can be used instead of %nn,TRAN=HEX. See %nn,HEX under OUTFIL
OUTREC for details.
p,HEX
Can be used instead of p,TRAN=HEX. See p,HEX under OUTFIL OUTREC
for details.
p,m,f,edit or (p,m,f),edit
specifies that an edited numeric input field is to appear in the reformatted
input record. You can edit BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, SFF, DC1,
DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4, TE1, TE2,
TE3, TE4, TM1, TM2, TM3 or TM4 fields using either pre-defined edit
masks (M0-M26) or specific edit patterns you define. You can control the
way the edited fields look with respect to length, leading or suppressed
zeros, thousands separators, decimal points, leading and trailing positive
and negative signs, and so on.
See p,m,f,edit under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(5:21,8,ZD,M19,X,46,5,ZD,M13,
31:(35,6,FS),SIGNS=(,,+,-),LENGTH=10,
51:8,4,PD,EDIT=(**II,IIT.TTXS),SIGNS=(,,+,-))
135
%nn,f,to or (%nn,f),to
specifies that a converted numeric parsed input field is to appear in the
reformatted input record. See PARSE for details of parsed fields. See
p,m,f,to or (p,m,f),to for further details.
deccon,edit or (deccon),edit
specifies that an edited decimal constant is to appear in the reformatted
input record. The decimal constant must be in the form +n or -n where n is
1 to 31 decimal digits. The sign (+ or -) must be specified. A decimal
constant produces a signed, 31-digit zoned decimal (ZD) result to be edited
as specified.
See deccon,edit under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(5:+5000,EDIT=(T,TTT),X,
(-25500),M18,LENGTH=8)
deccon,to or (deccon),to
specifies that a converted decimal constant is to appear in the reformatted
input record. The decimal constant must be in the form +n or -n where n is
1 to 31 decimal digits. The sign (+ or -) must be specified. A decimal
constant produces a signed, 31-digit zoned decimal (ZD) result to be
converted as specified.
See deccon,to under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(+0,TO=PD,LENGTH=6,3Z,(-512000),FI)
arexp,edit or (arexp),edit
specifies that the edited result of an arithmetic expression is to appear in
the reformatted input record. The arithmetic expression can consist of
input fields, decimal constants, operators and parentheses. An arithmetic
expression produces a signed, 31-digit zoned decimal (ZD) result to be
edited as specified.
See arexp,edit under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(C**,27,2,FI,MIN,
83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
15:(((15,5,ZD,ADD,+1),MUL,+100),DIV,62,2,PD),M25,LENGTH=10)
136
p,m,Y2x or p,m,Y4x
Specifies that an input date field is to be edited. Real Y2x dates are edited
using the century window established by the Y2PAST option in effect. Y2x
and Y4x dates with special indicators are expanded appropriately (for
example, p,6,Y2T transforms C'000000' to C'00000000').
See "p,m,Y2x or p,m,Y4x" under OUTFIL OUTREC for details.
Sample Syntax:
INREC BUILD=(21,3,Y2U,X,3,8,Y4W)
%nn,Y2x or %nn,Y4x
Specifies that a parsed input date field is to be edited. See PARSE for
details of parsed fields. See "p,m,Y2x or p,m,Y4x" for further details.
p,m,Y2x,edit or p,m,Y4x,edit
Specifies that the output for a p,m,Yxx input date field is to be edited
according to the edit parameters you specify. For example, if you specify:
INREC BUILD=(28,5,Y4V,EDIT=(TTTT-TT-TT)
137
%nn,Y2x,todate or %nn,Y4x,todate
Specifies that an input date field of one type is to be converted to a
corresponding output date field of another type. See PARSE for details of
parsed fields. See "p,m,Y2x,todate or p,m,Y4x,todate" for further details.
p,m,Y2x,dateop or p,m,Y4x,dateop
Specifies an arithmetic operation for an input date field. See
"p,m,Y2x,dateop or p,m,Y4x,dateop" under OUTFIL OUTREC for details.
%nn,Y2x,dateop or %nn,Y4x,dateop
Specifies an arithmetic operation for a parsed input date field. See
"%nn,Y2x,dateop or %nn,Y4x,dateop" under OUTFIL OUTREC for details.
p,m,Y2x(s) or p,m,Y4x(s)
Specifies that an input date field is to be edited with separators. s can be
any character except a blank. Real Y2x dates are edited using the century
window established by the Y2PAST option in effect. Y2x and Y4x dates
with special indicators are expanded appropriately (for example, p,8,Y4T(/)
transforms C'00000000' to C'0000/00/00').
See "p,m,Y2x(s) or p,m,Y4x(s)" under OUTFIL OUTREC for details.
Sample Syntax:
* Convert a Zdddccyy date to a Cddd/ccyy date.
INREC BUILD=(19,7,Y4W(/),X,
* Convert a Pccyymmdd date to a Cccyy-mm-dd date.
43,5,Y4V(-))
%nn,Y2x(s) or %nn,Y4x(s)
Specifies that a parsed input date field is to be edited with separators. See
PARSE for details of parsed fields. See "p,m,Y2x(s) or p,m,Y4x(s)" for
further details.
p,m,Y2xP
Specifies that an input date field is to be converted to a packed decimal
output date field. Real Y2x dates are edited using the century window
established by the Y2PAST option in effect. Y2x and Y4x dates with special
indicators are expanded appropriately (for example, p,6,Y2TP transforms
C'000000' to P'00000000').
See "p,m,Y2xP" under OUTFIL OUTREC for details.
Sample Syntax:
INREC BUILD=(11,3,Y2XP,X,21,4,Y2WP)
%nn,Y2xP
Specifies that a parsed input date field is to be converted to a packed
decimal output date field. See PARSE for details of parsed fields. See
"p,m,Y2xP" for further details.
138
p,m,justify
specifies that a left-justified or right-justified input field is to appear in the
reformatted input record. For a left-justified field, leading blanks are
removed and the characters from the first nonblank to the last nonblank
are shifted left, with blanks inserted on the right if needed. For a
right-justified field, trailing blanks are removed and the characters from the
last nonblank to the first nonblank are shifted right, with blanks inserted
on the left if needed. Optionally:
v specific leading and trailing characters can be changed to blanks before
justification begins
v a leading string can be inserted
v a trailing string can be inserted
v the output length can be changed (it's equal to the input length by
default)
See p,m,justify under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(1,10,
21,20,JFY=(SHIFT=RIGHT),5X,
52,12,JFY=(SHIFT=LEFT,PREBLANK=C(),LEAD=CVOL=SER=,
LENGTH=16))
%nn,justify
specifies that a left-justified or right-justified parsed input field is to appear
in the reformatted input record. See PARSE for details of parsed fields. See
p,m,justify for further details.
p,m,squeeze
specifies that a left-squeezed or right-squeezed input field is to appear in
the reformatted input record. For a left-squeezed field, all blanks are
removed and the characters from the first nonblank to the last nonblank
are shifted left, with blanks inserted on the right if needed. For a
139
%nn,squeeze
specifies that a left-squeezed or right-squeezed parsed input field is to
appear in the reformatted input record. See PARSE for details of parsed
fields. See p,m,squeeze for further details.
seqnum
specifies that a sequence number is to appear in the reformatted input
record. The sequence numbers are assigned in the order in which the
records are received for INREC processing. You can create BI, PD, ZD, CSF,
or FS sequence numbers and control their lengths, starting values and
increment values. You can restart the sequence number at the start value
each time a specified input field (p,m) or parsed input field (%nn) changes.
See seqnum under OUTFIL OUTREC for details.
Sample Syntax:
INREC FIELDS=(1,80,SEQNUM,8,ZD)
140
s
p,m
,a
%nn
p,m
%nn
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
141
and input position 5 has 'A'. The second item (UTOL) would change 'A' to 'a'
and the third item (CHANGE) would change 'a' again to 'X'.
If you specify an OVERLAY item that extends the overlay record beyond the
end of the input record, the reformatted record length is automatically
increased to that length, and blanks are filled in on the left as needed. For
variable-length records, the RDW length is also increased to correspond to the
larger reformatted record length after all of the OVERLAY items are processed.
For example, if your input record has a length of 40 and you specify:
INREC OVERLAY=(16:CABC,51:5C*,35:15,2)
the output record is given a length of 55. Blanks are filled in from columns
41-50. For variable-length records, the length in the RDW is changed from 40
to 55 after all of the OVERLAY items are processed.
Missing bytes in specified input fields are replaced with blanks so the padded
fields can be processed.
See INREC FIELDS for details of the items listed in the OVERLAY syntax
diagram previously. You can specify all of the items for OVERLAY in the same
way that you can specify them for BUILD or FIELDS with the following
exceptions:
v You cannot specify p or p,HEX or p,TRAN=keyword for OVERLAY.
v For p,m,H or p,m,F or p,m,D fields specified for OVERLAY, fields are
aligned as necessary without changing the preceding bytes.
v For variable-length records, you must not overlay positions 1-4 (the RDW)
for OVERLAY, so be sure to specify the first column (c:) as 5 or greater. If
you do not specify the first column, it will default to 1: which is invalid for
variable-length records with OVERLAY. Whereas FIELDS=(1,m,...) is
required, OVERLAY=(1,m) is not allowed, since it would overlay the RDW.
Sample Syntax:
Fixed input records:
INREC OVERLAY=(21:21,4,ZD,TO=PD,LENGTH=4,
2:5,8,HEX,45:C*,32,4,C*,81:SEQNUM,5,ZD)
142
IN=incon,OUT=outcon
,
IN=( incon
,
,OUT=outcon
INOUT=( incon,outcon
)
,
STARTPOS=p
ENDPOS=q
DO=n
MAXLEN=n
OVERRUN=ERROR
OVERRUN=TRUNC
SHIFT=YES
SHIFT=NO
You can use FINDREP to find constants anywhere in a record and replace
them with other constants of the same or different lengths. You can find
character or hexadecimal input constants anywhere in your records and replace
them with character, hexadecimal or null output constants. As appropriate,
bytes can be shifted left or right, blank padding can be added for fixed-length
records, and the length can be changed for variable-length records.
Various options of FINDREP allow you to define one or more input constants
and a corresponding output constant, define one or more pairs of input and
output constants, start and end the find scan at specified positions, stop after a
specified number of constants are replaced, increase or decrease the length of
the output record, define the action to be taken if nonblank characters overrun
the end of the record, and specify whether output constants are to replace or
overlay input constants.
See FINDREP under "OUTFIL Control Statements" for complete details.
Sample syntax
INREC FINDREP=(IN=CGoodbye,OUT=CBye)
143
IFTHEN=(
WHEN=INIT
,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
WHEN=GROUP ,BEGIN=(logexp) ,PUSH=(items)
,KEYBEGIN=(p,m)
,END=(logexp)
,RECORDS=n
WHEN=(logexp) ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=ANY ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=NONE ,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
144
145
The WHEN=INIT clause adds 1 to the ZD value and stores it in the IFTHEN
record. The WHEN=(8,4,ZD,EQ,+27) clause tests the incremented ZD value in
the IFTHEN record rather than the original ZD value in the input record.
The IFTHEN record is adjusted as needed for the records created or changed
by the IFTHEN clauses. For fixed-length records, blanks are filled in on the left
as needed. For variable-length records, the RDW length is adjusted as needed
each time the IFTHEN record is changed.
Missing bytes in specified input fields are replaced with blanks so the padded
fields can be processed.
DFSORT sets an appropriate LRECL (or reformatted record length if the
INREC record is further modified) for the output records based on the build,
overlay, find/replace and group operation items specified by the IFTHEN
clauses. However, DFSORT does not analyze the possible results of
WHEN=(logexp) conditions when determining an appropriate LRECL. When
you use INREC IFTHEN clauses, you can override the INREC LRECL
determined by DFSORT with the INREC IFOUTLEN parameter.
If SEQNUM is used in multiple IFTHEN clauses, the sequence number will be
incremented for each record that satisfies the IFTHEN clause, that is, a separate
SEQNUM counter will be kept for each IFTHEN clause. For example, if your
input is:
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
0001
0001
0002
0001
0002
0002
0003
0003
Separate SEQNUM counters are kept for the 'A' record, for the 'B' record, and
for the NONE records.
WHEN=INIT clause
See "WHEN=INIT clause" under OUTFIL IFTHEN for details. Note that /
cannot be used to create blank records or new records.
Sample Syntax:
146
WHEN=GROUP clause
See "WHEN=GROUP clause" under OUTFIL IFTHEN for details.
Sample Syntax:
INREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,40,SS,EQ,CJ82,OR,1,40,SS,EQ,CM72),
PUSH=(41:ID=5))
WHEN=(logexp) clause
See "WHEN=(logexp) clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with OUTFIL,
it cannot be used with INREC.
Sample Syntax:
INREC IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,LE,+2000),OVERLAY=(42:CType1 <= 2000),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X03),
BUILD=(1,21,42,13)),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,GT,+2000),OVERLAY=(42:CType1 > 2000 ),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X01),
BUILD=(1,25,42,13))
WHEN=ANY clause
See "WHEN=ANY clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with OUTFIL,
it cannot be used with INREC.
Sample Syntax:
INREC IFTHEN=(WHEN=(1,3,SS,EQ,CT01,T02,T03),
BUILD=(CGroup A,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=(1,3,SS,EQ,CT04,T05,T06),
BUILD=(CGroup B,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=(1,3,SS,EQ,CT07,T08,T09,T10),
BUILD=(CGroup C,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=ANY,OVERLAY=(16:CGroup Found))
WHEN=NONE clause
See "WHEN=NONE clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with OUTFIL,
it cannot be used with INREC.
Sample Syntax:
INREC IFTHEN=(WHEN=INIT,BUILD=(1,20,21:CDepartment,31:3X,21,60)),
IFTHEN=(WHEN=(5,2,CH,EQ,CD1),OVERLAY=(31:8,3)),
IFTHEN=(WHEN=(5,2,CH,EQ,CD2),OVERLAY=(31:12,3)),
IFTHEN=(WHEN=NONE,OVERLAY=(31:C***))
147
Overrides the INREC LRECL (or reformatted record length if the INREC record
is further modified) determined by DFSORT from your INREC IFTHEN
clauses. DFSORT sets an appropriate LRECL for the output records based on
the build, overlay, find/replace and group operation items specified by the
IFTHEN clauses. However, DFSORT does not analyze the possible results of
WHEN=(logexp) conditions when determining an appropriate INREC LRECL.
When you use INREC IFTHEN clauses, you can override the INREC LRECL
determined by DFSORT with the INREC IFOUTLEN parameter.
Fixed-length records longer than the IFOUTLEN length are truncated to the
IFOUTLEN length. Fixed-length records shorter than the IFOUTLEN are
padded with blanks to the IFOUTLEN length. Variable-length records longer
than the IFOUTLEN length are truncated to the IFOUTLEN length.
n
specifies the length to use for the INREC LRECL (or for the reformatted
record length if the INREC record is further modified) . The value for n
must be between 1 and 32767, but must not be larger than the maximum
LRECL allowed for the RECFM, and must not conflict with the specified or
retrieved LRECL for the fixed-length output data set.
Sample Syntax:
INREC IFOUTLEN=70,
IFTHEN=(WHEN=(5,1,CH,EQ,C1,AND,8,3,ZD,EQ,+10),
BUILD=(1,40,CT01-GROUP-A,65)),
IFTHEN=(WHEN=(5,1,CH,EQ,C2,AND,8,3,ZD,EQ,+12),
BUILD=(1,40,CT02-GROUP-B,65))
Default for IFOUTLEN: The LRECL determined from the IFTHEN clauses.
148
With OVERLAY, the variable part of the input record must not be included in
the reformatted record.
v If INREC with FIELDS or BUILD and OUTREC with FIELDS and BUILD are
specified, either both must specify position-only for the last part, or neither must
specify position-only for the last part. For example:
INREC BUILD=(1,8,20C*,9)
OUTREC BUILD=(1,4,3Z,5)
or:
INREC FIELDS=(1,40,45,5)
OUTREC FIELDS=(1,45,C****)
or:
INREC FIELDS=(1,18,8C*,23)
OUTREC OVERLAY=(24:CA)
v If the reformatted record includes only the RDW and the variable part of the
input record, null records containing only an RDW could result.
v
v The input records are reformatted before processing, as specified by INREC. The
output records are in the format specified by INREC, unless OUTREC is also
specified.
149
Case 2:
//SYSIN DD *
OPTION COPY,NOSZERO
INREC IFTHEN=(WHEN=(1,2,FS,EQ,+0),OVERLAY=(28:CA)),
IFTHEN=(WHEN=NONE,OVERLAY=(28:CB))
/*
Example 1
INREC method:
INCLUDE COND=(5,1,GE,CM),FORMAT=CH
INREC FIELDS=(10,3,20,8,33,11,5,1)
SORT FIELDS=(4,8,CH,A,1,3,FI,A)
SUM FIELDS=(17,4,BI)
150
These examples illustrate how a fixed-length input data set is sorted and
reformatted for output. Unnecessary fields are eliminated from the output records
using INREC or OUTREC. The SORTIN LRECL is 80.
Records are also included or excluded by means of the INCLUDE statement, and
summed by means of the SUM statement.
The reformatted input records are fixed length with a record size of 23 bytes.
SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is
specified or available, it will automatically be set to the reformatted record length
of 23. The reformatted records look as follows after INREC or OUTREC processing:
Position
Contents
1-3
4-11
12-22
23
Input position 5
Identical results are achieved with INREC or OUTREC. However, use of OUTREC
makes it easier to code the SORT and SUM statements. In either case, the
INCLUDE COND parameters must refer to the fields of the original input records.
However, with INREC, the SUM and SORT FIELDS parameters must refer to the
fields of the reformatted input records, while with OUTREC, the SUM and SORT
FIELDS parameters must refer to the fields of the original input records.
Example 2
INREC FIELDS=(1,35,2Z,36,45)
MERGE FIELDS=(20,4,CH,D,10,3,CH,D),FILES=3
SUM FIELDS=(36,4,BI,40,8,PD)
RECORD TYPE=F,LENGTH=(80,,82)
This example illustrates how overflow of a summary field can be prevented when
three fixed-length data sets are merged and reformatted for output. The input
record size is 80 bytes. To illustrate the use of the RECORD statement, assume that
SORTIN and SORTOUT are not present (that is, all input/output is handled by
user exits).
The reformatted input records are fixed-length with a record size of 82 bytes (an
insignificant increase from the original size of 80 bytes). They look as follows:
Position
Contents
1-35
36-37
38-82
151
Example 3
INREC BUILD=(20,4,12,3)
SORT FIELDS=(1,4,D,5,3,D),FORMAT=CH
OUTREC BUILD=(5X,1,4,H,19:1,2,5,3,DATE1(-),80XFF)
This example illustrates how a fixed-length input data set can be sorted and
reformatted for output. A more efficient sort is achieved by using INREC before
sorting to reduce the input records as much as possible, and using OUTREC after
sorting to add padding, the current date and repeated fields. The SORTIN LRECL
is 80 bytes.
The reformatted input records are fixed-length, and have a record size of seven
bytes (a significant reduction from the original size of 80 bytes). They look as
follows:
Position
Contents
1-4
5-7
The SORT and OUTREC statements must refer to the fields of the reformatted
input records.
The reformatted output records are fixed length with a record size of 113 bytes.
SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is
specified or available, it will automatically be set to the reformatted record length
of 113. The reformatted output records look as follows:
Position
Contents
152
1-5
EBCDIC blanks
7-10
11-18
EBCDIC blanks
19-20
21-23
24-33
Example 4
OPTION COPY,Y2PAST=1985
INREC FIELDS=(SEQNUM,4,BI,
8,5,ZD,TO=PD,
31,2,PD,TO=FI,LENGTH=2,
15,6,Y2TP,
25,3,CHANGE=(1,CL92,X01,CM72,X02,CJ42,X03),
NOMATCH=(XFF))
This example illustrates how a sequence number can be generated, how values in
one numeric or date format can be converted to another format, and how a lookup
table can be used.
The reformatted input records will look as follows:
Position
Contents
1-4
57
89
1014
A P'yyyymmdd' date field containing the C'yymmdd' date field from input
positions 15-20 transformed according to the specified century window of
1985-2084.
15
The SORT statement can now refer to the sort field in the reformatted input
records. The OUTREC statement is used to restore the records to their original
format.
Example 5
INREC OVERLAY=(61:21,11,SFF,ADD,41,11,SFF,TO=PD,LENGTH=5)
SORT FIELDS=(61,5,PD,A)
OUTREC OVERLAY=(61:61,5,PD,EDIT=(SIII,IIT.TT),SIGNS=(+,-))
This example illustrates how you can use the OVERLAY parameter with INREC
and OUTREC to change certain columns in your records without affecting other
columns.
Positions 61-65 of the reformatted input records are overlaid with a 5-byte PD
value derived from adding the sddd,ddd.dd field at positions 21-31 to the
sddd,ddd.dd field at positions 41-51. The records are then sorted by this 5-byte PD
field. Positions 61-71 of the reformatted output records are overlaid with an
sddd,ddd.dd field derived from the 5-byte PD value. The data before positions
61-71 and after positions 61-71 are not affected
153
Example 6
OPTION COPY
INREC IFTHEN=(WHEN=(5,2,CH,EQ,CGP,AND,2,1,BI,EQ,+1),
BUILD=(1,6,16,20,CT1,X0003,1,7,20C1)),
IFTHEN=(WHEN=(5,2,CH,EQ,CGP,AND,2,1,BI,EQ,+2),
BUILD=(1,6,45,20,CT2,X0008,16,7,20C2)),
IFTHEN=(WHEN=(5,2,CH,EQ,CGP,AND,2,1,BI,EQ,+3),
BUILD=(1,6,31,20,CT3,X0005,25,7,20C3)),
IFTHEN=(WHEN=NONE,OVERLAY=(27:C00,XFFFF)),
IFOUTLEN=57
This example illustrates how you can use IFTHEN clauses with INREC to reformat
different records in different ways. IFOUTLEN=57 is used to set the reformatted
record length to 57.
Records with 'GP' in positions 5-6 and X'01' in position 2 are reformatted as
follows:
Position
Contents
1-6
7-26
27-28
'T1'
29-30
X'0003'
31-37
38-57
20 '1's
Records with 'GP' in positions 5-6 and X'02' in position 2 are reformatted as
follows:
Position
Contents
1-6
7-26
27-28
'T2'
29-30
X'0008'
31-37
38-57
20 '2's
Records with 'GP' in positions 5-6 and X'03' in position 2 are reformatted as
follows:
Position
Contents
154
1-6
7-26
27-28
'T3'
29-30
X'0005'
31-37
38-57
20 '3's
27-28
'00'
29-30
X'FFFF'
31-57
Example 7
INREC OVERLAY=(16:1,15,JFY=(SHIFT=LEFT))
SORT FIELDS=(16,15,CH,A)
OUTREC BUILD=(1,15)
This example illustrates how you can left-justify characters in an input field so
they can be sorted without regard to the leading blanks.
The 15-byte input records might look like this:
CARRIE
VICKY
FRANK
SAM
DAVID
MARTIN
Note that if we sort these records using just this control statement:
SORT FIELDS=(1,15,CH,A)
Because of the different number of leading blanks in the input records, we don't
get what we want. To fix that, while keeping the leading blanks in the original
records, we use the JFY function of INREC to make a left-justified copy of the
15-byte input field at positions 16-30, SORT on it and use OUTREC to remove the
left-justified field. With the INREC, SORT and OUTREC control statements shown
previously, the output records are:
CARRIE
DAVID
FRANK
MARTIN
SAM
VICKY
If we wanted the output to contain the sorted left-justified fields, we could use
these control statements:
INREC BUILD=(1,15,JFY=(SHIFT=LEFT))
SORT FIELDS=(1,15,CH,A)
155
Example 8
INREC PARSE=(%00=(ENDBEFR=C,,FIXLEN=11),
%01=(ENDBEFR=C,,FIXLEN=5),
%02=(FIXLEN=6)),
OVERLAY=(31:%00,42:%01,47:%02)
SORT FIELDS=(31,11,CH,A,42,5,UFF,A,47,6,SFF,D)
OUTREC BUILD=(1,30)
This example illustrates how you can sort FB input records with variable
position/length fields, such as comma separated values.
The 30-byte input records might look like this:
Marketing,96218,+27365
Development,3807,+1275
Research,7283,+5001
Development,1700,-5316
Research,978,+13562
Development,3807,-158
Research,7283,+5002
Marketing,52,-8736
Development,5781,+2736
Marketing,52,+1603
Research,16072,-2022
We want to sort the first field as character ascending, the second field as unsigned
numeric ascending and the third field as signed numeric descending.
Note that each record has three variable fields in comma separated value format.
The fields do not start and end in the same position in every record and do not
have the same length in every record. The first and second fields end with a
comma and the third field ends with a blank.
In order to sort variable fields like these, we use the PARSE and OVERLAY
functions of INREC to create a fixed parsed copy of each variable field. We use
%00 to create an 11-byte fixed parsed field into which we extract the value before
the first comma. We use %01 to create a 5-byte fixed parsed field into which we
extract the value after the first comma and before the second comma. We use %02
to create a 6-byte fixed parsed field into which we extract the value after the
second comma. Then we SORT on the fixed parsed fields. Finally, we use OUTREC
to remove the fixed parsed fields.
After the INREC statement is processed, the records look like this:
Marketing,96218,+27365
Development,3807,+1275
Research,7283,+5001
Development,1700,-5316
Research,978,+13562
Development,3807,-158
Research,7283,+5002
Marketing,52,-8736
Development,5781,+2736
Marketing,52,+1603
Research,16072,-2022
156
Marketing 96218+27365
Development3807 +1275
Research
7283 +5001
Development1700 -5316
Research
978 +13562
Development3807 -158
Research
7283 +5002
Marketing 52
-8736
Development5781 +2736
Marketing 52
+1603
Research
16072-2022
Example 9
INREC PARSE=(%00=(ENDBEFR=C,,FIXLEN=11),
%01=(ENDBEFR=C,,FIXLEN=5),
%02=(FIXLEN=6)),
BUILD=(1,4,5:%00,16:%01,21:%02,27:5)
SORT FIELDS=(5,11,CH,A,16,5,UFF,A,21,6,SFF,D)
OUTREC BUILD=(1,4,27)
This example illustrates how you can sort VB input records with variable
position/length fields, such as comma separated values. This example is very
similar to the previous example for FB records, except that with VB records we
need to copy the fixed parsed fields after the 4-byte RDW rather than at the end of
the records.
The VB input records might look like this:
Length|Data
26|Marketing,96218,+27365
26|Development,3807,+1275
23|Research,7283,+5001
26|Development,1700,-5316
23|Research,978,+13562
25|Development,3807,-158
23|Research,7283,+5002
22|Marketing,52,-8736
26|Development,5781,+2736
22|Marketing,52,+1603
24|Research,16072,-2022
After the INREC statement is processed, the records look like this:
Length|Data
48|Marketing 96218+27365Marketing,96218,+27365
48|Development3807 +1275 Development,3807,+1275
45|Research
7283 +5001 Research,7283,+5001
48|Development1700 -5316 Development,1700,-5316
45|Research
978 +13562Research,978,+13562
47|Development3807 -158 Development,3807,-158
45|Research
7283 +5002 Research,7283,+5002
44|Marketing 52
-8736 Marketing,52,-8736
48|Development5781 +2736 Development,5781,+2736
44|Marketing 52
+1603 Marketing,52,+1603
46|Research
16072-2022 Research,16072,-2022
After the SORT and OUTREC statements are processed, the output records look
like this:
Chapter 3. Using DFSORT program control statements
157
Example 10
OPTION COPY
INREC FINDREP=(IN=(X00,XFF),OUT=C)
This example illustrates how you can remove characters from FB or VB records.
The VB input records might look like this in hexadecimal:
RDW----|Data
000F0000D1E4D5C500C1D7D9C9D3FF
00100000C2C5E3E3E800C4C1C9E2E8FF
Note that the X'00' and X'FF' characters have been removed and the RDW length
decreased accordingly. For VB input records, FINDREP processing automatically
starts at position 5 after the RDW so the X'00' characters in the RDW are not
affected.
Example 11
OPTION COPY
INREC FINDREP=(IN=CBALANCE,
OUT=CBALANCE 1000,SHIFT=NO,DO=1)
This example illustrates how you can find a value in FB or VB records and overlay
it with a larger value without shifting other bytes in the records.
The FB input records might look like this:
CUSTOMER1 10100
MNTHLY STMT BALANCE 2000
CUSTOMER2 11100
MNTHLY STMT REQUIRES NO MODIFICATION ACCT BALANCE 5000
CUSTOMER3 11111
YOUR INFO ENCLOSED
MNTHLY STMT REQUIRES MODIFICATION ACCT BALANCE 7000
158
Example 12
INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,4,CH,EQ,CRPT.),
PUSH=(31:6,8))
OPTION EQUALS
SORT FIELDS=(31,8,CH,A)
OUTFIL INCLUDE=(31,8,CH,EQ,CFRANK,OR,
31,8,CH,EQ,CSRIHARI),BUILD=(1,30)
This example illustrates how you can SORT and INCLUDE groups of FB records
depending on a value in the first record of each group. We propagate the value in
the first record of the group to every record of the group, SORT and INCLUDE on
the value, and then remove it.
The 30-byte FBA input records might look like this:
1RPT.SRIHARI
LINE 1 FOR
LINE 2 FOR
...
1RPT.VICKY
LINE 1 FOR
LINE 2 FOR
...
1RPT.FRANK
LINE 1 FOR
LINE 2 FOR
...
1RPT.DAVID
LINE 1 FOR
LINE 2 FOR
...
REPORT 1
REPORT 1
REPORT 2
REPORT 2
REPORT 3
REPORT 3
REPORT 4
REPORT 4
Each report starts with 'RPT.reptname' in positions 2-13. In the output data set we
only want to include records for reports with specific reptname values, and the
reptname values we want can change from run to run. We also want to sort by the
reptname values in ascending order. For this example, let's say we just want the
SRIHARI and FRANK reports.
We use an IFTHEN WHEN=GROUP clause to propagate the reptname value to
each record of the group. BEGIN indicates a group starts with 'RPT.' in positions
2-5. PUSH overlays the reptname value from the first record of the group (the
'RPT.reptname' record) at positions 31-38 (after the end of the record) in each
record of the group including the first. After the IFTHEN GROUP clause is
executed, the intermediate records look like this:
159
REPORT 1
REPORT 1
REPORT 2
REPORT 2
REPORT 3
REPORT 3
REPORT 4
REPORT 4
SRIHARI
SRIHARI
SRIHARI
SRIHARI
VICKY
VICKY
VICKY
VICKY
FRANK
FRANK
FRANK
FRANK
DAVID
DAVID
DAVID
DAVID
Note that the records of each group have the reptname value from the first record
of that group in positions 31-38.
We use a SORT statement to sort ascending on the reptname in positions 31-38. We
use the EQUALS option to ensure that records in the same group (that is, with the
same reptname value) are kept in their original order. After the SORT statement is
executed, the intermediate records look like this:
1RPT.DAVID
LINE 1 FOR
LINE 2 FOR
...
1RPT.FRANK
LINE 1 FOR
LINE 2 FOR
...
1RPT.SRIHARI
LINE 1 FOR
LINE 2 FOR
...
1RPT.VICKY
LINE 1 FOR
LINE 2 FOR
...
REPORT 4
REPORT 4
REPORT 3
REPORT 3
REPORT 1
REPORT 1
REPORT 2
REPORT 2
DAVID
DAVID
DAVID
DAVID
FRANK
FRANK
FRANK
FRANK
SRIHARI
SRIHARI
SRIHARI
SRIHARI
VICKY
VICKY
VICKY
VICKY
REPORT 3
REPORT 3
REPORT 1
REPORT 1
Example 13
OPTION COPY,Y2PAST=1996
INREC BUILD=(1,6,Y2W,TOJUL=Y4T,X,
1,6,Y2W,WEEKDAY=CHAR3,X,
9,7,Y4T,TOGREG=Y4T(/),X,
9,7,Y4T,WEEKDAY=DIGIT1)
160
1999014
2003235
0000000
1992343
FRI
WED
999
SAT
1999/01/14
2003/08/23
0000/00/00
1992/12/08
5
7
0
3
The Y2PAST=1996 option sets the century window to 1996-2095. The century
window is used to transform yy in the Y2W field to ccyy.
Note that date conversion is not performed for the special indicators (all 9s and all
0s); the special indicator is just used appropriately for the output date field.
Example 14
OPTION COPY
INREC OVERLAY=(11:1,8,Y4T,ADDDAYS,+50,TOGREG=Y4T,
21:1,8,Y4T,SUBMONS,+7,TOGREG=Y4T,
31:1,8,Y4T,ADDYEARS,+2,TOGREG=Y4T)
OUTFIL REMOVECC,
HEADER1=(Input
+50 days -7 months +2 years)
This example illustrates how you can add and subtract days, months and years
from date fields.
The SORTIN data set has these input records with a C'ccyymmdd' date field in
positions 1-8:
20070305
20071213
20080219
20080901
20091122
20090115
20100915
20100630
99999999
The INREC statement performs three different date field arithmetic operations on
the input date field. It adds 50 days, subtracts 7 months and adds 2 years. We use
1,8,Y4T for the input field to match the C'ccyymmdd' input date, and we use
TOGREG=Y4T to give us a C'ccyymmdd' output date. The OUTFIL statement adds
headings.
SORTOUT will have these records:
Input
+50 days
20070305 20070424
20071213 20080201
20080219 20080409
20080901 20081021
20091122 20100111
-7 months
20060805
20070513
20070719
20080201
20090422
+2 years
20090305
20091213
20100219
20100901
20111122
161
20090306
20101104
20100819
99999999
20080615
20100215
20091130
99999999
20110115
20120915
20120630
99999999
Note that the '99999999' input value is treated as a special indicator for output.
p,m,f,s
,
p,m,
FORMAT=f
f,
COPY
,
,
EQUALS
NOEQUALS
FILES=n
FILSZ=x
SIZE=y
SKIPREC=z
STOPAFT=n
Y2PAST=
s
f
162
p,m,f,s
Is written exactly the same way for a merge as it is for a sort. The meanings of
p, m, f, and s are described in the discussion of the SORT statement. The
defaults for this and the following parameters are also given there. See SORT
control statement on page 442.
FIELDS=COPY
FIELDS=COPY
See the discussion of the COPY option on the OPTION statement, in OPTION
control statement on page 173.
FORMAT=f
163
EQUALS or NOEQUALS
EQUALS
NOEQUALS
FILES=n
FILES=n
Specifies the number of input files for a merge when input is supplied through
the E32 exit.
Default: None; must be specified when an E32 exit is used.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
FILSZ or SIZE
FILSZ=x
SIZE=y
SKIPREC
SKIPREC=z
STOPAFT
STOPAFT=n
164
Y2PAST
Y2PAST=
s
f
FIELDS
The control field begins on byte 2 of each record in the input data sets. The
field is 5 bytes long and contains character (EBCDIC) data that has been
presorted in ascending order.
FILSZ
The input data sets contain exactly 29483 records.
Example 2
MERGE FIELDS=(3,8,ZD,E,40,6,CH,D)
FIELDS
The major control field begins on byte 3 of each record, is 8 bytes long, and
contains zoned decimal data that is modified by your routine before the merge
examines it.
The second control field begins on byte 40, is 6 bytes long, and contains
character data in descending order.
Example 3
MERGE FIELDS=(25,4,A,48,8,A),FORMAT=ZD
FIELDS
The major control field begins on byte 25 of each record, is 4 bytes long, and
contains zoned decimal data that has been placed in ascending sequence.
The second control field begins on byte 48, is 8 bytes long, is also in zoned
decimal format, and is also in ascending sequence. The FORMAT parameter is
used to indicate that both fields have ZD format.
Example 4
MERGE FIELDS=COPY
FIELDS
The input data set is copied to output. No merge takes place.
165
n,m
)
,
HILEVEL=YES
,e
The MODS statement is needed only when DFSORT passes control to your
routines at user exits. The MODS statement associates user routines with specific
DFSORT exits and provides DFSORT with descriptions of these routines. For
details about DFSORT user exits and how user routines can be used, see Chapter 5,
Using your own user exit routines, on page 487.
To use one of the user exits, you substitute its three-character name (for example,
E31) for the word exit in the MODS statement format shown previously in this
section. You can specify any valid user exit, except E32. (E32 can be used only in a
merge operation invoked from a program; its address must be passed in a
parameter list.)
exit
exit= (
n,m
,
s
,e
The values that follow the exit parameter describe the user routine. These
values are:
n
specifies the number of bytes of main storage your routine uses.Include storage
obtained (via GETMAIN) by your routine (or, for example, by OPEN) and the
storage required to load the COBOL library subroutines.
specifies either the name of the DD statement in your DFSORT job step that
defines the library in which your routine is located or SYSIN if your routine is
in the input stream. SYSIN is not valid for copy processing.
If a value is not specified for s, DFSORT uses the following search order to
find the library in which your routine is located:
1. The libraries identified by the STEPLIB DD statement
2. The libraries identified by the JOBLIB DD statement (if there is no STEPLIB
DD statement)
3. The link library.
specifies the linkage editor requirements of your routine or indicates that your
routine is written in COBOL. The following values are allowed:
N
166
specifies that your routine has already been bound or link-edited and can
be used in the DFSORT run without further binding or link-editing. This is
specifies that your E15 or E35 routine is written in COBOL. If you code C
for any other exit, it is ignored, and N is assumed. Your COBOL-written
routine must already have been link-edited. The COBEXIT option of the
OPTION statement specifies the library for the COBOL exits.
specifies that your routine requires binding or link-editing but that it must
be bound or link-edited separately from the other routines (for example,
E3n routines) to be used in a particular phase of DFSORT. E11 and E31 exit
routines are the only routines eligible for separate binding or link-editing.
See Dynamically binding or link-editing user exit routines on page 498
for additional information. This value is not valid for copy processing.
HILEVEL=YES
HILEVEL=YES
specifies that:
v if an E15 routine is identified on the MODS statement, it is written in
COBOL
v if an E35 routine is identified on the MODS statement, it is written in
COBOL.
If you identify an E15 routine and an E35 routine on the MODS statement,
specify HILEVEL=YES only if both routines are written in COBOL. If you do
not identify an E15 or E35 routine on the MODS statement, HILEVEL=YES is
ignored.
Note: COBOL=YES can be used instead of HILEVEL=YES.
Note:
1. The s parameter must be the same or omitted for each routine with N, N64 or
C for the e parameter (library concatenation is allowed). These routines cannot
be placed in SYSIN. Each such routine must be a load module.
2. Each routine for which T or S is specified for the e parameter can be placed in
any library or in SYSIN; they do not all have to be in the same library or
SYSIN (but can be). Some routines can even be in different libraries (or the
Chapter 3. Using DFSORT program control statements
167
E15
At exit E15, DFSORT transfers control to your own routine. Your routine is in
168
Example 2
MODS
E15=(COBOLE15,7000,,C),
E35=(COBOLE35,7000,EXITC,C)
E15
At exit E15, DFSORT transfers control to your own routine. Your routine is
written in COBOL and is in the STEPLIB/JOBLIB or link libraries. Its member
name is COBOLE15 and it uses 7000 bytes.
E35
At exit E35, DFSORT transfers control to your routine. Your routine is written
in COBOL and is in the library defined by the job control statement with the
ddname EXITC. Its member name is COBOLE35 and it uses 7000 bytes.
(logical expression)
FORMAT=f
ALL
NONE
Use an OMIT statement if you do not want all of the input records to appear in
the output data sets. The OMIT statement selects the records you do not want to
include.
You can specify either an INCLUDE statement or an OMIT statement in the same
DFSORT run, but not both.
The way in which DFSORT processes short INCLUDE/OMIT compare fields
depends on the settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. A
short field is one where the variable-length record is too short to contain the entire
field, that is, the field extends beyond the record. For details about including or
omitting short records, see the discussion of the VLSCMP and NOVLSCMP options
in OPTION control statement on page 173.
A logical expression is one or more relational conditions logically combined, based
on fields in the input record, and can be represented at a high level as follows:
relational condition1
.
,
AND
OR
,relational condition2
If the logical expression is true for a given record, the record is omitted from the
output data set.
169
170
v D2 format can be specified with the OMIT statement but not with the OMIT
parameter.
See OUTFIL control statements on page 223 for more details on the OUTFIL
OMIT parameter.
COND
COND=
(logical expression)
ALL
NONE
logical expression
specifies one or more relational conditions logically combined, based
on fields in the input record. If the logical expression is true for a
given record, the record is omitted from the output data sets.
ALL
specifies that all of the input records are to be omitted from the output
data sets.
NONE
specifies that none of the input records are to be omitted from the
output data sets.
Default: NONE. See Appendix B, Specification/override of DFSORT options,
on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
FORMAT
FORMAT=f
For details on this parameter, see INCLUDE control statement on page 96.
171
172
ARESALL=
ARESINV=
AVGRLEN=n
CHALT
NOCHALT
CHECK
NOCHECK
CINV
NOCINV
CKPT
COBEXIT=
COPY
DSA=n
DSPSIZE=
n
nK
nM
n
nK
nM
COB1
COB2
MAX
n
DYNALLOC
=
DYNAPCT=
d
(,n)
(d,n)
OFF
x
OLD
DYNSPC=n
EFS=
name
NONE
EQUALS
NOEQUALS
EXITCK=
STRONG
WEAK
FILSZ=
x
Ex
Ux
SIZE=
y
Ey
Uy
HIPRMAX=
OPTIMAL
n
p%
LIST
NOLIST
LISTX
NOLISTX
LOCALE=
name
CURRENT
NONE
173
MERGEIN=
MOSIZE=
n
nK
nM
MAX
ddname
,
( ddname
MAX
n
p%
MOWRK
NOMOWRK
MSGDDN=ddname
MSGPRT=
ALL
NONE
CRITICAL
NOBLKSET
NOOUTREL
NOOUTSEC
NULLOUT=
RC0
RC4
RC16
ODMAXBF=
n
nK
nM
OVFLO=
RC0
RC4
RC16
PAD=
RC0
RC4
RC16
RESALL=
n
nK
nM
RESET
NORESET
RESINV=
n
nK
nM
SDB=
LARGE
YES
INPUT
NO
SKIPREC=z
SMF=
SHORT
FULL
NO
SOLRF
NOSOLRF
SORTDD=cccc
SORTIN=ddname
SORTOUT=ddname
174
RC0
RC4
RC16
STOPAFT=n
SZERO
NOSZERO
TRUNC=
RC0
RC4
RC16
USEWKDD
VERIFY
NOVERIFY
VLLONG
NOVLLONG
VLSCMP
NOVLSCMP
VLSHRT
NOVLSHRT
VSAMEMT
NVSAMEMT
VSAMIO
NOVSAMIO
WRKREL
NOWRKREL
WRKSEC
NOWRKSEC
Y2PAST=
s
f
ZDPRINT
NZDPRINT
Note for Syntax Diagram: The keywords EFS, LIST, NOLIST, LISTX, NOLISTX,
MSGDDN, MSGPRT, SMF, SORTDD, SORTIN, SORTOUT, and USEWKDD are
used only when they are specified on the OPTION control statement passed by an
extended parameter list or when specified in the DFSPARM data set. If they are
specified on an OPTION statement read from the SYSIN or SORTCNTL data set,
the keyword is recognized, but the parameters are ignored.
The OPTION control statement allows you to override some of the options
available at installation time (such as EQUALS and CHECK) and to supply other
optional information (such as DYNALLOC, COPY, and SKIPREC).
Some of the options available on the OPTION statement are also available on the
SORT or MERGE statement (such as FILSZ and SIZE). It is preferable to specify
these options on the OPTION statement. For override rules, see Appendix B,
Specification/override of DFSORT options, on page 863.
Details of aliases for OPTION statement options are given under the description of
individual options. Table 38 on page 219 summarizes the available aliases.
DFSORT accepts but does not process the following OPTION operands: ALGQ,
APP, APPEND, BIAS=value, BLKSET, CASCADE, DIAG, ERASE, EXCPVR=value,
MAXPFIX=value, NEW, NEWFILE, NODIAG, NOERASE, NOINC, NOSTIMER,
NOSWAP, OPT=value, REP, REPLACE, ROUTE=value, WRKADR=value,
WRKDEV=value, and WRKSIZ=value.
ARESALL
175
n
nK
nM
nK
nM
n
nK
nM
Specifies the average input record length in bytes for variable-length record
176
specifies the average input record length. n must be between 4 and 32767
and must include the 4-byte record descriptor word (RDW).
Note:
1. AVGRLEN=n on the OPTION statement overrides the L5 value on the
RECORD statement (LENGTH operand) if both are specified. The L5 value
on the RECORD statement is ignored for Blockset.
2. L5=n can be used instead of AVGRLEN=n.
Default: If AVGRLEN=n is not specified, DFSORT uses one-half of the
maximum record length as the average record length. See Appendix B,
Specification/override of DFSORT options, on page 863 for full override
details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
CHALT or NOCHALT
CHALT
NOCHALT
CHECK
NOCHECK
177
CINV
NOCINV
Activates the Checkpoint/Restart facility for sorts that use the Peerage or Vale
techniques.
Because CKPT is only supported in the Peerage and Vale techniques, the
Blockset technique must be bypassed for the Checkpoint/Restart facility to be
used. Installation option IGNCKPT=NO causes Blockset to be bypassed when
CKPT is specified at run-time. The NOBLKSET option can also be used to
bypass Blockset at run-time.
A SORTCKPT DD statement must be coded when you use the
Checkpoint/Restart facility (see SORTCKPT DD statement on page 75).
Note:
1. CHKPT can be used instead of CKPT.
2. Functions such as OUTFIL processing, which are supported only by the
Blockset technique, cannot be used if the Checkpoint/Restart facility is
used.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
COBEXIT
178
COB1
COB2
Causes DFSORT to copy a SORTIN data set or inserted records to the output
data sets unless all records are disposed of by an E35 exit routine. Records can
be edited by E15 and E35 exit routines; INCLUDE/OMIT, INREC, OUTREC,
and OUTFIL statements; and SKIPREC and STOPAFT parameters. E35 is
entered after each SORTIN or E15 record is copied.
The following must not be used in copy applications:
v BDAM data sets
v Dynamic binding or link-editing.
See message ICE160A in z/OS DFSORT Messages, Codes and Diagnosis Guide for
additional restrictions that apply to copy applications.
Note: User labels will not be copied to the output data sets.
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
DSA
DSA=n
179
MAX
n
180
=
d
(,n)
(d,n)
Assigns DFSORT the task of dynamically allocating needed work space. You
do not need to calculate and use JCL to specify the amount of work space
needed by the program. DFSORT uses the dynamic allocation facility of the
operating system to allocate work space for you.
Refer to Appendix A, Using work space, on page 853 for guidelines on the
use of DYNALLOC.
d
specifies the device name. You can specify any IBM disk or tape device
181
specifies the maximum number of requested work data sets. If you specify
more than 255, a maximum of 255 data sets is used. If you specify 1 and
the Blockset technique is selected, a maximum of 2 data sets is used. If you
specify more than 32 and the Blockset technique is not selected, a
maximum of 32 data sets is used.
182
x
OLD
specifies additional work data sets to be dynamically allocated with zero space.
DFSORT only extends these data sets when necessary to complete a sort
application. The availability of additional work data sets can help avoid out of
space ABENDs.
x
specifies the number of additional work data sets (y) as a percentage of the
maximum number of dynamically allocated work data sets
(DYNALLOC/DYNALOC n value) in effect. y will be set to n * x%. The
total number of dynamically allocated work data sets will be n + y. For
example, if DYNALLOC=(SYSDA,20) and DYNAPCT=20 are in effect, 4
additional work data sets will be allocated for a total of 24.
The value x must be between 0 and 254. The minimum value for y is 1 and
the maximum value for y is 254. The maximum value for n + y is 255; if x
results in a value for n + y greater than 255, y will be set to 255-n.
OLD
specifies additional work data sets should only be allocated when DFSORT
cannot determine the file size. When DFSORT is able to determine the file
size, additional work data sets will not be allocated (y=0), and the total
number of work data sets will be n.
Note: When message ICE118I is issued indicating that DFSORT cannot
determine the file size, y is set as follows:
v For DYNAPCT=OLD, y is set to n * 50%
v For DYNAPCT=x with x <= 50, y is set to n * 50%
v For DYNAPCT=x with x > 50, y is set to n * x%
Default: None; optional. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
DYNSPC
DYNSPC=n
183
32
48
64
93
128
183
256
366
512
732
The larger your DYNSPC value, the more data DFSORT can sort when the file
size is unknown. For example, in a test using just dynamically allocated work
space (no Hiperspace or data space) with the primary space shown in Table 34,
and all of the corresponding secondary space, Blockset is able to sort
approximately 150 megabytes with DYNSPC=32 and approximately 1200
megabytes with DYNSPC=256. If Hiperspace or data space can be used along
with dynamically allocated work space, the amount of data DFSORT can sort
will increase according to the amount of Hiperspace or data space available.
n
EFS
EFS=
184
name
NONE
EQUALS
NOEQUALS
185
STRONG
WEAK
186
FILSZ=
SIZE=
x
Ex
Ux
y
Ey
Uy
The FILSZ parameter specifies either the exact number of records to be sorted
or merged, or an estimate of the number of records to be sorted. The SIZE
parameter specifies either the exact number of records in the input data sets, or
an estimate of the number of records in the input data sets. The supplied
record count is used by DFSORT for two purposes:
1. To check that the actual number of records sorted or merged or the number
of records in the input data sets is equal to the exact number of records
expected. FILSZ=x or SIZE=y causes this check to be performed and results
in termination with message ICE047A if the check fails.
2. To determine the input file size for a sort application. DFSORT performs
calculations based on the user supplied record count and other parameters
(such as AVGRLEN) to estimate the total number of bytes to be sorted. This
value is important for sort runs, because it is used for several internal
optimizations as well as for dynamic work data set allocation (see OPTION
DYNALLOC). If no input record count (or only an estimate) is supplied for
the sort run, DFSORT attempts to automatically compute the file size to be
used for the optimizations and allocations.
The type of FILSZ or SIZE value specified (x/y, Ux/Uy, Ex/Ey, or none)
controls the way DFSORT performs the previous two functions, and can have a
significant effect on performance and work data set allocation. See Chapter 10,
Improving efficiency, on page 799 and File size and dynamic allocation on
page 857 for more information on file size considerations.
x or y
specifies the exact number of records to be sorted or merged (x) or the
exact number of records in the input data sets (y). This value is always
used for both the record check and the file size calculations. FILSZ=x or
SIZE=y can be used to force DFSORT to perform file size calculations
based on x or y, and to cause DFSORT to terminate the sort or merge
application if x or y is not exact.
If installation option FSZEST=NO is in effect and either FILSZ=x or SIZE=y
is specified, DFSORT terminates if the actual number of records is different
from the specified exact value (x or y). In this case, the actual number of
records is placed in the IN field of message ICE047A (or message ICE054I
in some cases) before termination. However, if installation option
FSZEST=YES is in effect, DFSORT treats FILSZ=x or SIZE=y like FILSZ=Ex
or SIZE=Ey, respectively; it does not terminate when the actual number of
records does not equal x or y.
FILSZ=0 causes Hipersorting, dataspace sorting, and dynamic allocation of
work space not to be used, and results in termination with message
ICE047A unless the number of records sorted or merged is 0. If no E15
user exit is present, SIZE=0 has the same effect in terms of Hipersorting
and dynamic allocation of work space, and results in termination with
message ICE047A unless the number of records in the input data sets is 0.
x
187
specifies the exact number of records in the input data sets; it must
take into account the number of records to be deleted by STOPAFT. y
must be changed whenever the number of records in the input data
sets changes in any way.
Limit: 28 digits (15 significant digits)
Ex or Ey
specifies an estimate of the number of records to be sorted (x) or an
estimate of the number of records in the input data sets (y). This value is
not used for the record check. It is used for the file size calculations, but
only if DFSORT could not reasonably estimate the input file size itself. In
all other cases, this value is ignored by DFSORT. See Dynamic allocation
of work data sets on page 856 for details on exactly when an estimated
record count is used and when it is ignored by DFSORT.
FILSZ=E0 or SIZE=E0 is always ignored.
x
Ux or Uy
specifies the number of records to be sorted (x) or the number of records in
the input data sets (y). This value is not used for the record check, but is
always used for the file size calculations. FILSZ=Ux or SIZE=Uy can be
used to force DFSORT to perform file size calculations based on x or y,
while avoiding termination if x or y is not exact.
The FSZEST installation option has no effect on FILSZ=Ux or SIZE=Uy
processing.
FILSZ=U0 causes Hipersorting, dataspace sorting, and dynamic allocation
of work space not to be used, and may cause degraded performance or
termination with message ICE046A, if the actual number of records to be
sorted is significantly larger than 0. If no E15 user exit is present, SIZE=U0
has the same effect in terms of Hipersorting, dataspace sorting,and
dynamic allocation of work space, and may cause degraded performance
or termination with message ICE046A, if the actual number of records in
the input data sets is significantly larger than 0.
x
188
specifies the number of records in the input data sets; it should take
into account the number of records to be deleted by STOPAFT. y
should be changed whenever the number of records in the input data
sets changes significantly.
Limit: 28 digits (15 significant digits)
FILSZ=n
FILSZ=Un
FILSZ=En
Number of records
Exact
Estimate
Estimate
Applications
Sort, merge
Sort
Sort
Terminate if n wrong?
Yes
No
No
Yes
n includes records:
In input data sets
Yes
Yes
Yes
Inserted/deleted by E15
Yes
Yes
Yes
Inserted by E32
Yes
No
No
Deleted by
INCLUDE/OMIT
Yes
Yes
Yes
Deleted by SKIPREC
Yes
Yes
Yes
Deleted by STOPAFT
Yes
Yes
Yes
In any way
Significantly
Significantly
Effects of n=0
Hipersorting and
DYNALLOC not used
Hipersorting and
DYNALLOC not used
None
SIZE=n
SIZE=Un
SIZE=En
Number of records
Exact
Estimate
Estimate
Applications
Sort, merge
Sort
Sort
Terminate if n wrong?
Yes
No
No
Yes
n includes records:
In input data sets
Yes
Yes
Yes
Inserted/deleted by E15
No
No
No
Inserted by E32
No
No
No
Deleted by
INCLUDE/OMIT
No
No
No
189
SIZE=n
SIZE=Un
SIZE=En
Deleted by SKIPREC
No
No
No
Deleted by STOPAFT
Yes
Yes
Yes
In any way
Significantly
Significantly
Effects of n=0
Hipersorting and
DYNALLOC not used
Hipersorting and
DYNALLOC not used
None
OPTIMAL
n
p%
190
191
LIST
NOLIST
LISTX
NOLISTX
192
name
CURRENT
NONE
CURRENT
specifies that locale processing is to be used, and the current locale
active when DFSORT is entered will remain the active locale during
DFSORT processing.
NONE
specifies that locale processing is not to be used. DFSORT will use the
binary encoding of the code page defined for your data for collating
and comparing.
Note:
1. LOCALE is processed only if it is passed on the OPTION control statement
in an extended parameter list or in DFSPARM.
2. To use an IBM-supplied locale, DFSORT must have access to the Language
Environment run-time library. For example, this library might be called
SYS1.SCEERUN. If you are unsure of the name of this library at your
location, contact your system administrator. To use a user-defined locale,
DFSORT must have access to the load library containing it.
3. If you use locale processing for SORT, MERGE, INCLUDE, or OMIT fields:
v VLSHRT is not used for SORT or MERGE
Chapter 3. Using DFSORT program control statements
193
n
nK
nM
MAX
Temporarily overrides the SIZE installation option, which specifies the amount
of main storage available to DFSORT.
MAINSIZE applies to the total amount of main storage above and below 16MB
virtual. DFSORT determines how much storage to allocate above and below
16MB virtual, but the total amount of storage cannot exceed MAINSIZE.
Storage used for OUTFIL processing will be adjusted automatically, depending
upon several factors, including:
v Total available storage
v Non-OUTFIL processing storage requirements
v Number of OUTFIL data sets and their attributes (for example, block size).
OUTFIL processing is subject to the ODMAXBF limit and your system storage
limits (for example, IEFUSI) but not to DFSORT storage limits, that is,
SIZE/MAINSIZE, MAXLIM, and TMAXLIM. DFSORT attempts to use storage
above 16MB virtual for OUTFIL processing whenever possible.
For details on main storage allocation, see Tuning main storage on page 807.
n
specifies that n bytes of storage are to be allocated. If you specify more that
2097152000, 2097152000 is used.
Limit: 10 digits
194
ddname
,
( ddname
MAX
n
p%
195
196
MOWRK
NOMOWRK
197
ALL
CRITICAL
NONE
Causes DFSORT to bypass the Blockset technique normally used for a sort or
merge application. Using this option generally results in degraded
performance.
Note: Functions such as OUTFIL processing, which are supported only by the
Blockset technique, cause the NOBLKSET option to be ignored.
198
RC0
RC4
RC16
199
n
nK
nM
200
RC0
RC4
RC16
RC0
RC4
RC16
Temporarily overrides the PAD installation option, which specifies the action to
be taken by DFSORT when the SORTOUT LRECL is larger than the
SORTIN/SORTINnn LRECL, for the cases where DFSORT allows LRECL
padding.
RC0
specifies that DFSORT should issue message ICE171I, set a return code of 0
and continue processing when the SORTOUT LRECL is larger than the
SORTIN/SORTINnn LRECL.
RC4
specifies that DFSORT should issue message ICE171I, set a return code of 4
and continue processing when the SORTOUT LRECL is larger than the
SORTIN/SORTINnn LRECL.
RC16
specifies that DFSORT should issue message ICE196A, terminate and give
a return code of 16 when the SORTOUT LRECL is larger than the
SORTIN/SORTINnn LRECL.
Note:
1. The return code of 0 or 4 set for LRECL padding can be overridden by a
higher return code set for some other reason.
Chapter 3. Using DFSORT program control statements
201
n
nK
nM
specifies that n bytes of storage are to be reserved. If you specify less than
4096, 4096 is used.
Limit: 8 digits.
202
RESET
NORESET
n
nK
nM
203
LARGE
YES
INPUT
NO
204
RECFM
F or FS
LRECL
FB or FBS
V, D, VS, or DS
LRECL + 4
DFSORT uses the system-determined optimum block size for the output
data set in most cases when the block size is zero. However, the following
conditions prevent DFSORT from using the system-determined block size:
v Output data set block size is available (that is, non-zero) in the JFCB
(disk or tape) or format 1 DSCB (disk) or tape label (only for
DISP=MOD with AL, SL, or NSL label, when appropriate)
v Output is a spool, dummy, VSAM, or unmovable data set, or a z/OS
UNIX file.
v The output data set is on tape with a label type of AL
v DFSORT's Blockset technique is not selected.
In the previous cases, DFSORT uses the specified block size, or determines
an appropriate (though not necessarily optimum) block size for the output
data set. The selected block size is limited to 32760 bytes.
YES
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the
selected block size to a maximum of 32760 bytes. See the discussion of
SDB=LARGE for more information; the only difference between
SDB=LARGE and SDB=YES is that SDB=LARGE allows block sizes greater
than 32760 bytes for tape output data sets, whereas SDB=YES does not.
INPUT
specifies that DFSORT is to use the system-determined optimum block size
for an output data set when its block size is zero, but is to limit the
selected block size to a maximum of 32760 bytes if the input block size is
less than or equal to 32760 bytes. Thus, SDB=INPUT works like
SDB=LARGE if the input block size is greater than 32760 bytes (only
possible for tape input data sets) and works like SDB=YES if the input
block size is less than or equal to 32760 bytes. See the discussions of
SDB=LARGE and SDB=YES for more information.
NO specifies that DFSORT is not to use the system-determined optimum block
size. When the output data set block size is zero, DFSORT selects an
appropriate (though not necessarily optimum) block size for the output
data set based on the obtained or derived output or input attributes.
SDB=NO limits the selected block sizes to a maximum of 32760 bytes.
SDB=NO works like SDB=YES if the input block size is greater than 32760
bytes (only possible for tape input data sets). See the discussion of
SDB=YES for more information.
Note:
1. SDB=NO does not prevent the use of system-determined block size for the
output data set at allocation or in other cases where the output data set
block size is set before DFSORT gets control.
2. When DFSORT uses system-determined block size, the selected output data
set block size may be different from the block size selected previously.
Chapter 3. Using DFSORT program control statements
205
Specifies the number of records z you want to skip (delete) before starting to
sort or copy the input data set. SKIPREC is usually used if, on a preceding
DFSORT run, you have processed only part of the input data set.
An application with an input data set that exceeds intermediate storage
capacity usually terminates unsuccessfully. However, for a tape work data set
sort, you can use a routine at E16 (as described in Chapter 5, Using your own
user exit routines, on page 487) to instruct the program to sort only those
records already read in. It then prints a message giving the number of records
sorted. You can use SKIPREC in a subsequent sort run to bypass the
previously-sorted records, sort only the remaining records, and then merge the
output from different runs to complete the application.
z
SHORT
FULL
NO
206
SOLRF
NOSOLRF
207
208
Specifies a ddname to be associated with the SORTIN data set. This allows you
to dynamically invoke DFSORT more than once in a program step, passing a
different ddname for each input data set.
The ddname can be 1 through 8 characters, but must be unique within the job
step. Do not use ddnames reserved for use by DFSORT, such as ccccWKd,
ccccWKdd, ccccDKd, or ccccDKdd , where cccc is the specified or defaulted
value for the SORTDD operand and d is any character.
Note:
1. SORTIN is processed only if it is passed on the OPTION control statement
in an extended parameter list, or in DFSPARM.
2. If both SORTIN=ddname and SORTDD=cccc are specified, ddname is used
for the input file. The same ddname cannot be specified for SORTIN and
SORTOUT, or for MERGEIN and SORTOUT.
3. If SORTIN is used for a tape work data set sort, DFSORT terminates.
Default: SORTIN, unless SORTDD=cccc is specified in which case ccccIN is the
default. See Appendix B, Specification/override of DFSORT options, on page
863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
SORTOUT
SORTOUT=ddname
RC0
RC4
RC16
209
Specifies the maximum number of records (n) you want accepted for sorting or
copying (that is, read from SORTIN or inserted by E15 and not deleted by
SKIPREC, E15, or the INCLUDE/OMIT statement). When n records have been
accepted, no more records are read from SORTIN; E15 continues to be entered
as if EOF were encountered until a return code of 8 is sent, but no more
records are inserted. If end-of-file is encountered before n records are accepted,
only those records accepted up to that point are sorted or copied.
n
SZERO
NOSZERO
210
RC0
RC4
RC16
211
212
VERIFY
NOVERIFY
VLLONG
NOVLLONG
VLSCMP
NOVLSCMP
213
If a variable-length input record has a length less than 71 bytes, the field at
bytes 70-71 is short and the following occurs:
v With VLSCMP, the record is included if byte 6 of the input record is C'1' or
omitted if byte 6 is not C'1'. The comparison of bytes 70-71 equal to C'T1' is
false because bytes 70-71 contain either X'hh00' (for a record length of 70
bytes) or X'0000' (for a record length of less than 70 bytes). The comparison
involving the non-short field is performed even though a short field is
present.
v With NOVLSCMP and VLSHRT, the record is omitted because any short
field makes the entire logical expression false. The comparison involving the
non-short field is not performed because a short field is present.
v With NOVLSCMP and NOVLSHRT, DFSORT terminates because any short
field results in termination.
In general, comparisons involving short fields are false with VLSCMP.
However, if a binary zero value is relevant to the comparison, the use of binary
zeros for padding might make the comparison true. For example, suppose the
following INCLUDE statement is used:
INCLUDE COND=(21,2,CH,EQ,CJX,OR,
(55,2,CH,EQ,58,2,CH,AND,
70,1,BI,LT,X08))
If a variable-length input record has a length less than 70 bytes, the field at
byte 70 is short and is padded to X'00'. This makes the comparison of byte 70
less than X'08' true even though byte 70 is a short field and so probably
irrelevant.
Likewise, if a variable-length record has a length less than 55 bytes, the fields
at bytes 55-56 and 58-59 are short and are each padded to X'0000', and the field
at byte 70 is short and is padded to X'00'. This makes the comparison of bytes
55-56 equal to 58-59 true and the comparison of byte 70 less than X'08' true
even though all three fields are short and probably irrelevant.
214
Now the comparisons involving bytes 55-56, 58-59 and 70 can only be true for
records that are 70 bytes (X'0046') or longer. Thus, the irrelevant comparisons
involving short fields are eliminated.
Keep in mind that short compare fields are padded with zeros when VLSCMP
is in effect and code your INCLUDE/OMIT logical expressions to allow for
that or even take advantage of it.
VLSCMP
specifies that short variable-length compare fields are padded with binary
zeros.
NOVLSCMP
specifies that short variable-length compare fields are not padded.
Default: Usually the installation default. See Appendix B, Specification/
override of DFSORT options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
VLSHRT or NOVLSHRT
VLSHRT
NOVLSHRT
215
VSAMEMT
NVSAMEMT
216
VSAMIO
NOVSAMIO
WRKREL
NOWRKREL
217
WRKSEC
NOWRKSEC
s
f
specifies the number of years DFSORT is to subtract from the current year
to set the beginning of the sliding century window. Because the Y2PAST
value is subtracted from the current year, the century window slides as the
current year changes. For example, Y2PAST=81 would set a century
window of 1925-2024 in 2006 and 1926-2025 in 2007. s must be a value
between 0 and 100.
218
ZDPRINT
NZDPRINT
SOLRF
CENTURY=value
Y2PAST=value
CENTWIN=value
Y2PAST=value
CHKPT
CKPT
CORE=value
MAINSIZE=value
HIPRLIM=value
HIPRMAX=value
L5=value
AVGRLEN=value
NOSDB
SDB=NO
PRINT=value
MSGPRT=value
RLS=n
WRKREL
RLS=0
NOWRKREL
SDB
SDB=YES
SDB=SMALL
SDB=YES
SEC=n
WRKSEC
SEC=0
NOWRKSEC
SEQ=YES
VERIFY
SEQ=NO
NOVERIFY
ZDPRINT=YES
ZDPRINT
219
NZDPRINT
FIELDS
The control field begins on the first byte of each record in the input data set, is
20 bytes long, contains character data, and is to be sorted in ascending order.
SIZE
The data set to be sorted contains 50000 records.
SKIPREC
Five records are skipped (deleted) before starting to process the input data set.
EQUALS
The sequence of records that collate identically is preserved from input to
output.
DYNALLOC
Two data sets (by default) are allocated on SYSDA (by default). The space on
the data set is calculated using the SIZE value in effect.
Example 2
SORT
FIELDS=(1,2,CH,A),CKPT
OPTION EQUALS,NOCHALT,NOVERIFY,CHECK
FIELDS
The control field begins on the first byte of each record in the input data set, is
2 bytes long, contains character data, and is to be sorted in ascending order.
CKPT
DFSORT takes checkpoints during this run.
Note: CKPT is ignored if the Blockset technique is used. If checkpoints are
required, you must bypass the Blockset technique by specifying the
NOBLKSET option, or by specifying installation option IGNCKPT=NO.
However, functions such as OUTFIL, which are supported only by the Blockset
technique, cannot be used if the Checkpoint/Restart facility is used.
EQUALS
The sequence of records that collate identically is preserved from input to
output.
NOCHALT
Only AQ fields are translated through the ALTSEQ translate table. If
installation option CHALT=YES was specified, then NOCHALT temporarily
overrides it.
NOVERIFY
No sequence check is performed on the final output records.
CHECK
The record count is checked at the end of program processing.
220
Example 3
OPTION FILSZ=50,SKIPREC=5,DYNALLOC=3390
SORT FIELDS=(1,2,CH,A),SKIPREC=1,SIZE=200,DYNALLOC=(3380,5)
This example shows how parameters specified on the OPTION control statement
override those specified on the SORT control statement, regardless of the order of
the two statements.
FILSZ
DFSORT expects 50 records on the input data set. (Note that there is a
difference in meaning between FILSZ and SIZE and that the OPTION
specification of FILSZ is used in place of SIZE.)
SKIPREC
DFSORT causes five records from the beginning of the input file to be skipped.
(SKIPREC=1 on the SORT statement is ignored.)
DYNALLOC
DFSORT allocates two work data sets (by default) on an IBM 3390.
FIELDS
The control field begins on the first byte of each record in the input data set, is
2 bytes long, contains character data, and is to be sorted in ascending order.
Example 4
OPTION NOBLKSET
NOBLKSET
DFSORT does not use the Blockset technique for a sort or merge.
Example 5
OPTION STOPAFT=100
STOPAFT
DFSORT accepts 100 records before sorting or copying.
Example 6
OPTION RESINV=32000,MSGPRT=NONE,
MSGDDN=SORTMSGS,SORTDD=ABCD,SORTIN=MYINPUT,
SORTOUT=MYOUTPUT,NOLIST
221
Example 7
OPTION RESINV=32000,MSGPRT=CRITICAL
MSGDDN=SORTMSGS,SORTDD=ABCD,SORTIN=MYINPUT,
SORTOUT=MYOUTPUT,NOLIST
Example 8
SORT
FIELDS=(3,4,CH,A)
OPTION COPY,SKIPREC=10,CKPT
MODS E15=(E15,1024,MODLIB),E35=(E35,1024,MODLIB)
SORT
The sort statement is ignored because the COPY option has been specified.
COPY
The copy processing is always done on a record-by-record basis. Each record is
therefore read from SORTIN, passed to the E15 exit, passed to the E35 exit, and
written to SORTOUT. (Contrast this with a sort, where all the records are read
from SORTIN and passed to the E15 exit before any records are passed to the
E35 exit and written to SORTOUT.)
SKIPREC
Ten records are skipped before copying starts.
CKPT
The checkpoint option is not used for copy applications.
222
Example 9
SORT
FIELDS=(5,4,CH,A)
SUM FIELDS=(12,5,ZD,25,6,ZD)
OPTION ZDPRINT
ZDPRINT
The positive summed ZD values are printable because DFSORT uses an F sign
for the last digit.
Example 10
//S1 EXEC PGM=SORT
//SYSOUT
DD SYSOUT=*
//SARA DD *
AAA FROM SARA
CCC FROM SARA
DDD FROM SARA
//MOLLY DD *
AAA FROM MOLLY
BBB FROM MOLLY
DDD FROM MOLLY
//NORA DD *
AAA FROM NORA
BBB FROM NORA
CCC FROM NORA
//SORTOUT DD SYSOUT=*
//DFSPARM DD
*
OPTION EQUALS,MERGEIN=(NORA,SARA,MOLLY)
MERGE FIELDS=(1,3,CH,A)
/*
This example illustrates the use of the alternate ddnames NORA, SARA and
MOLLY for a MERGE application instead of SORTINnn ddnames. Since EQUALS
is specified, equally collating records will be from NORA, then SARA, then
MOLLY, that is, in the order specified in the MERGEIN list. Thus, SORTOUT
contains these records:
AAA
AAA
AAA
BBB
BBB
CCC
CCC
DDD
DDD
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
NORA
SARA
MOLLY
NORA
MOLLY
NORA
SARA
SARA
MOLLY
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
FROM
SARA
MOLLY
NORA
MOLLY
NORA
SARA
NORA
SARA
MOLLY
223
FNAMES=
FILES=
ddname
,
( ddname
suffix
,
( suffix )
STARTREC=n
ENDREC=n
SAMPLE=
n
(n,m)
INCLUDE= ( logical expression )
ALL
NONE
OMIT=
( logical expression )
ALL
NONE
SAVE
ACCEPT=n
,
PARSE=( definition
,
OUTREC=
BUILD=
( item
)
,VTOF
,CONVERT
,
OVERLAY= ( item
,
FINDREP= ( item
,
IFTHEN=(clause)
IFOUTLEN=n
FTOV
VLTRIM=byte
VLTRAIL=string
REPEAT=n
SPLIT
SPLITBY=n
SPLIT1R=n
NULLOFL= RC0
RC4
RC16
LINES=n
,
HEADER1= ( item
,
TRAILER1= ( item
,
HEADER2= ( item
,
TRAILER2= ( item )
Additional Parameters for OUTFIL
224
,VLFILL=byte
SECTIONS= ( item
NODETAIL
BLKCCH1
BLKCCH2
BLKCCT1
REMOVECC
IFTRAIL=(updates)
OUTFIL control statements allow you to create one or more output data sets for a
sort, copy, or merge application from a single pass over one or more input data
sets. You can use multiple OUTFIL statements, with each statement specifying the
OUTFIL processing to be performed for one or more output data sets. OUTFIL
processing begins after all other processing ends (that is, after processing for exits,
options, and other control statements).
OUTFILE can be used as an alias for OUTFIL.
OUTFIL statements support a wide variety of output data set tasks, including:
v Creation of multiple output data sets containing unedited or edited records from
a single pass over one or more input data sets.
v Creation of multiple output data sets containing different ranges or subsets of
records from a single pass over one or more input data sets. In addition, records
that are not selected for any subset can be saved in a separate output data set.
v Conversion of variable-length record data sets to fixed-length record data sets.
v Conversion of fixed-length record data sets to variable-length record data sets.
v A wide variety of parsing, editing, and reformatting tasks including:
The use of fixed position/length fields or variable position/length fields. For
fixed fields, you specify the starting position and length of the field directly.
For variable fields, such as delimited fields, comma separated values (CSV),
tab separated values, blank separated values, keyword separated fields,
null-terminated strings (and many other types), you define rules that allow
DFSORT to extract the relevant data into fixed parsed fields, and then use the
parsed fields as you would use fixed fields.
Insertion of blanks, zeros, strings, current date, future date, past date, current
time, sequence numbers, decimal constants, and the results of arithmetic
expressions before, between, and after the input fields in the reformatted
records.
Sophisticated conversion capabilities, such as find and replace, hexadecimal
display, bit display, translation of EBCDIC letters from lowercase to uppercase
or uppercase to lowercase, translation of characters from EBCDIC to ASCII
and from ASCII to EBCDIC, translation of characters using the ALTSEQ
translation table, conversion of numeric values from one format to another,
left justify or left-squeeze (remove leading blanks or all blanks and shift left),
and right-justify or right-squeeze (remove trailing blanks or all blanks and
shift right).
Sophisticated editing capabilities, such as control of the way numeric fields
are presented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs,
and so on.
Chapter 3. Using DFSORT program control statements
225
Transformation of SMF, TOD, and ETOD date and time values to more usable
forms.
Conversion of input date fields of one type (CH, ZD, PD, 2-digit year, 4-digit
year, Julian, Gregorian) to corresponding output date fields of another type or
to a corresponding day of the week.
Various types of arithmetic operations for input date fields.
Selection of a character constant, hexadecimal constant, or input field from a
lookup table for output, based on a character, hexadecimal, or bit string as
input (that is, lookup and change).
v Creation of the reformatted records in one of the following ways:
By building the entire record one item at a time.
By only overlaying specific columns.
By performing find and replace operations.
By using sophisticated conditional logic or group operations to choose how
different records are reformatted.
v Highly detailed three-level (report, page, and section) reports containing a
variety of report elements you can specify (for example, current date, current
time, edited or converted page numbers, character strings, and blank lines) or
derive from the input records (for example, character fields; unedited, edited or
converted numeric input fields; edited or converted record counts; and edited or
converted totals, maximums, minimums, and averages for numeric input fields).
v Creation of multiple output records from each input record, with or without
intervening blank output records.
v Repetition and sampling of data records.
v Splitting of data records in rotation among a set of output data sets.
v Updating counts and totals in an existing trailer (last) record based on the
current data records.
The parameters of OUTFIL are grouped by primary purpose as follows:
v
v FNAMES and FILES specify the ddnames of the OUTFIL data sets to be
created. Each OUTFIL data set to be created must be specifically identified using
FNAMES or FILES in an OUTFIL statement. By contrast, the SORTOUT data set
is created by default if a DD statement for it is present. The term SORTOUT
data set denotes the single non-OUTFIL output data set, but in fact, the
SORTOUT ddname can be used for an OUTFIL data set either explicitly or by
default.
If SORTOUT is identified as an OUTFIL ddname, either explicitly (for example,
via FILES=OUT) or by default (OUTFIL without FILES or FNAMES), the data
set associated with the SORTOUT ddname will be processed as an OUTFIL data
set rather than as the SORTOUT data set.
OUTFIL data sets have characteristics and requirements similar to those for the
SORTOUT data set, but there are differences in the way each is processed. The
major differences are that an E39 exit routine is not entered for OUTFIL data
sets, and that OUTFIL processing does not permit the use of the LRECL value to
pad fixed-format OUTFIL records. (DFSORT will automatically determine and
226
227
228
229
Note:
1. DFSORT accepts but does not process the following OUTFIL operands:
BLKSIZE=value, BUFLIM=value, BUFOFF=value, CARDS=value,
CLOSE=value, DISK, ESDS, EXIT, FREEOUT, KSDS, LRECL=value, NOTPMK,
OPEN=value, OUTPUT, PAGES=value, PRINT, PUNCH, REUSE, RRDS, SPAN,
SYSLST, TAPE, and TOL.
2. Sample syntax is shown throughout this section. Complete OUTFIL statement
examples are shown and explained under OUTFIL featuresexamples on
page 377.
FNAMES
FNAMES=
ddname
,
(
ddname
Specifies ddnames associated with the OUTFIL data sets for this OUTFIL
230
Default for FNAMES: If neither FNAMES nor FILES is specified for an OUTFIL
statement, the default ddname is:
v ddname if SORTOUT=ddname is in effect
v ccccOUT if SORTDD=cccc is in effect and SORTOUT=ddname is not in effect
v SORTOUT if neither SORTOUT=ddname nor SORTDD=cccc is in effect.
FILES
FILES=
d
dd
OUT
,
(
d
dd
OUT
Specifies suffixes for ddnames to be associated with the OUTFIL data sets for
this OUTFIL statement. The ddnames specified using the FNAMES and FILES
parameters constitute the output data sets for this OUTFIL group to which all
of the other parameters for this OUTFIL statement apply.
If FILES specifies the ddname in effect for the SORTOUT data set (that is,
whichever is in effect among ddname from SORTOUT=name, ccccOUT from
SORTDD=cccc, or SORTOUT), DFSORT will treat the data set associated with
that ddname as an OUTFIL data set rather than as the SORTOUT data set.
specifies the 1-character suffix to be used to form the ddname SORTOFd or
ccccOFd if SORTDD=cccc is in effect. A DD statement must be present for
this ddname.
231
Specifies the OUTFIL input record at which OUTFIL processing is to start for
this OUTFIL group. OUTFIL input records before this starting record are not
included in the data sets for this OUTFIL group.
specifies the relative record number. The value for n starts at 1 (the first
record) and is limited to 28 digits (15 significant digits).
Sample Syntax:
OUTFIL FNAMES=SKIP20,STARTREC=21
Specifies the OUTFIL input record at which OUTFIL processing is to end for
this OUTFIL group. OUTFIL input records after this ending record are not
included in the data sets for this OUTFIL group.
The ENDREC value must be equal to or greater than the STARTREC value if
both are specified on the same OUTFIL statement.
specifies the relative record number. The value for n starts at 1 (the first
record) and is limited to 28 digits (15 significant digits).
Sample Syntax:
OUTFIL
OUTFIL
OUTFIL
OUTFIL
FNAMES=TOP10,ENDREC=10
FNAMES=FRONT,ENDREC=500
FNAMES=MIDDLE,STARTREC=501,ENDREC=2205
FNAMES=BACK,STARTREC=2206
SAMPLE
SAMPLE=
n
(n,m)
232
specifies the interval size. The value for n starts at 2 (sample every other
record) and is limited to 28 digits (15 significant digits).
(logical expression)
ALL
NONE
Selects the records to be included in the data sets for this OUTFIL group.
The INCLUDE parameter operates in the same way as the INCLUDE
statement, except that:
v The INCLUDE statement applies to all input records; the INCLUDE
parameter applies only to the OUTFIL input records for its OUTFIL group.
v FORMAT=f can be specified with the INCLUDE statement, but not with the
INCLUDE parameter. Thus, you can use FORMAT=f and p,m or p,m,f fields
with the INCLUDE statement, but you must only use p,m,f fields with the
INCLUDE parameter. For example:
INCLUDE FORMAT=BI,
COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
61,20,SS,EQ,CFLY)
OUTFIL INCLUDE=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
61,20,SS,EQ,CFLY)
v D2 format can be specified with the INCLUDE statement, but not with the
INCLUDE parameter.
See INCLUDE control statement on page 96 for complete details.
logical expression
specifies one or more relational conditions logically combined based on
fields in the OUTFIL input record. If the logical expression is true for a
given record, the record is included in the data sets for this OUTFIL group.
ALL
specifies that all of the OUTFIL input records are to be included in the data
sets for this OUTFIL group.
NONE
specifies that none of the OUTFIL input records are to be included in the
data sets for this OUTFIL group.
Sample Syntax:
OUTFIL FNAMES=J69,INCLUDE=(5,3,CH,EQ,CJ69)
OUTFIL FNAMES=J82,INCLUDE=(5,3,CH,EQ,CJ82)
Chapter 3. Using DFSORT program control statements
233
(logical expression)
ALL
NONE
Selects the records to be omitted from the data sets for this OUTFIL group.
The OMIT parameter operates in the same way as the OMIT statement, except
that:
v The OMIT statement applies to all input records; the OMIT parameter
applies only to the OUTFIL input records for its OUTFIL group.
v FORMAT=f can be specified with the OMIT statement, but not with the
OMIT parameter. Thus, you can use FORMAT=f and p,m or p,m,f fields
with the OMIT statement, but you must only use p,m,f fields with the OMIT
parameter. For example:
OMIT FORMAT=BI,
COND=(5,4,LT,11,4,OR,21,4,EQ,31,4,OR,
61,20,SS,EQ,CFLY)
OUTFIL OMIT=(5,4,BI,LT,11,4,BI,OR,21,4,BI,EQ,31,4,BI,OR,
61,20,SS,EQ,CFLY)
v The D2 format can be specified with the OMIT statement, but not with the
OMIT parameter.
See OMIT control statement on page 169 and INCLUDE control statement
on page 96 for complete details.
logical expression
specifies one or more relational conditions logically combined based on
fields in the OUTFIL input record. If the logical expression is true for a
given record, the record is omitted from the data sets for this OUTFIL
group.
ALL
specifies that all of the OUTFIL input records are to be omitted from the
data sets for this OUTFIL group.
NONE
specifies that none of the OUTFIL input records are to be omitted from the
data sets for this OUTFIL group.
Sample Syntax:
OUTFIL FILES=01,OMIT=NONE
OUTFIL OMIT=(5,1,BI,EQ,B110.....)
OUTFIL FNAMES=(OUT1,OUT2),
OMIT=(7,2,CH,EQ,C32,OR,18,3,CH,EQ,CXYZ)
234
Specifies the number of OUTFIL input records to be accepted for processing for
this OUTFIL group. A record is accepted if it is not deleted by STARTREC,
ENDREC, SAMPLE, INCLUDE or OMIT processing for the group. After n
OUTFIL input records have been accepted, additional OUTFIL input records
are not included in the data sets for this OUTFIL group.
n
235
%n=
%nn=
%nnn=
%=
FIXLEN=m
ABSPOS=p
ADDPOS=x
SUBPOS=y
,
STARTAFT=string
STARTAFT=an
STARTAFT=BLANKS
STARTAT=string
STARTAT=an
STARTAT=BLANKS
STARTAT=NONBLANK
,
ENDBEFR=string
ENDBEFR=an
ENDBEFR=BLANKS
ENDAT=string
ENDAT=an
ENDAT=BLANKS
PAIR=APOST
PAIR=QUOTE
REPEAT=v
This operand allows you to extract variable position/length fields into fixed
parsed fields. Parsed fields (%n, %nn or %nnn) can be used where fixed
position/length fields (p,m) can be used in the BUILD (or OUTREC) or
OVERLAY operands as described later in this section.
Note: Although you can use %n (%0-%9), %nn (%00-%99) or %nnn
(%000-%999) for a parsed field, for convenience in this book %nn will be used
in general when referring to a parsed field. %n, %0n or %00n can be used
interchangeably for parsed field n (for example, %1, %01 or %001 for parsed
field 1). %nn or %0nn can be used interchangeably for parsed field nn (for
example, %12 or %012 for parsed field 12).
PARSE can be used for many different types of variable fields including
delimited fields, comma separated values (CSV), tab separated values, blank
separated values, keyword separated fields, null-terminated strings, and so on.
You can assign up to 1000 parsed fields (%0-%999) to the variable fields you
want to extract.
Note that if all of the fields in your records have fixed positions and lengths,
you don't need to use PARSE. But if any of the fields in your records have
variable positions or lengths, you can use PARSE to treat them as fixed parsed
fields in BUILD or OVERLAY. You can mix p,m fields (fixed fields) and %nn
fields (parsed fields) in BUILD and OVERLAY.
For each %nn parsed field, you define where the data to be extracted starts
and ends, and the length (m) of the fixed field to contain the extracted data.
For example, if your input records contained CSV data as follows:
AA,BBBB,C,DDDDD
EEEEE,,F,GG
HHH,IIIII,JJ,K
236
BBBB
IIIII
C
F
JJ
DDDDD
GG
K
237
238
For this example, the Start Pointer advances as follows for the first record:
v For %00: Set Start Pointer to position 1. Start searching for '*' end string at
position 1. Extract '11' (per ENDBEFR=C'*'). Set Start Pointer after '*' (at '+').
v For %01: Start searching for end blank at the Start Pointer (at '+'). Extract
'+23' (per ENDBEFR=BLANKS). Set Start Pointer after the blanks (at 'N').
v For %02: Start searching for 'MAX' start string at the Start Pointer (at 'N').
Extract 'MAXCC=00' (per FIXLEN=8). Increment Start Pointer by m (8) bytes
from the start of the extracted string (at blank after '00').
v For %03: Start searching for '(' start string at Start Pointer (at blank after '00').
Set Start Pointer after '(' (at 'M'). Start searching for ')' end string at Start
Pointer (at 'M'). Extract 'Monica' (per ENDBEFR=C')'). Set Start Pointer after
')' (at blank after ')').
v For %04: Start searching for start blank at the Start Pointer (at blank after ')').
Extract '18 ' (per FIXLEN=5).
If the Start Pointer advances past the end of the record, PARSE processing
stops. For example, if you had these input records:
First=George Last=Washington
First=John Middle=Quincy Last=Adams
239
the %01 parsed field (middle name) is not found in the first record, so PARSE
processing stops and the %02 parsed field is set to blanks. You can handle this
kind of possible missing field situation by using IFTHEN PARSE instead of
PARSE. For example:
OUTFIL FNAMES=OUT1,
IFTHEN=(WHEN=INIT,
PARSE=(%00=(STARTAFT=CFirst=,ENDBEFR=C ,FIXLEN=12))),
IFTHEN=(WHEN=INIT,
PARSE=(%01=(STARTAFT=CMiddle=,ENDBEFR=C ,FIXLEN=12))),
IFTHEN=(WHEN=INIT,
PARSE=(%02=(STARTAFT=CLast=,ENDBEFR=C ,FIXLEN=12)),
BUILD=(%00,%01,%02))
By default, the Start Pointer is set to 1 (F) or 5 (V) for each IFTHEN PARSE, so
the missing middle name in the first record does not prevent the last name
from being extracted.
See the discussion of "IFTHEN" for more information on IFTHEN PARSE.
You must define each %nn field with PARSE before you use it in BUILD or
OVERLAY, so generally you would want to specify PARSE before BUILD or
OVERLAY. If you define a %nn field with PARSE, but do not use it in BUILD
or OVERLAY, data will not be extracted for that parsed field.
Each %nn parsed field (%0-%999) can only be defined once per run with
PARSE, but can be used as many times as needed in BUILD or OVERLAY.
The %nn parsed fields defined for a particular source (INREC, OUTREC or
OUTFIL) can only be used in the BUILD or OVERLAY operands for that
source. Generally, you will only use PARSE for one source (for example,
INREC) per run. But you could define a separate set of %nn parsed fields for
each source, if needed. For example, you could define %21 and %22 for the
INREC statement, %101, %102 and %103 for the OUTREC statement, %40 and
%45 for OUTFIL statement 1, and %30, %31 and %32 for OUTFIL statement 2.
You could then use %21 and %22 for INREC BUILD or OVERLAY, %102 and
%103 for OUTREC BUILD or OVERLAY, %40 and %45 for OUTFIL statement 1
BUILD or OVERLAY, and %30, %31 and %32 for OUTFIL statement 2 BUILD
or OVERLAY. Note that you could not, for example, use %21 and %22 for
OUTREC BUILD or OVERLAY.
If you specify PARSE=(...),IFTHEN=(...) or IFTHEN=(...),PARSE=(...), DFSORT
will terminate. If you need to specify PARSE with IFTHEN, specify it within
one or more individual IFTHEN clauses, as appropriate. For details, see the
description of "IFTHEN".
%n, %nn or %nnn
Assigns %n, %nn or %nnn to a parsed field. The variable-length data
defined for the parsed field is extracted to a fixed length area (padded
with blanks or truncated as appropriate) and can be used where a p,m
field can be used in BUILD or OVERLAY.
n can be 0 to 9, nn can be 00 to 99, and nnn can be 000 to 999 but each %n,
%nn or %nnn value can only be defined once per run. This gives you a
maximum of 1000 parsed fields per run.
240
Data is extracted for %01 (first field) and %04 (fourth field), but not for %
(second and third fields).
FIXLEN=m
Specifies the length (m) of the fixed area to contain the extracted
variable-length data for this %nn fixed parsed field. m can be 1 to 32752.
You must specify FIXLEN=m for each %nn parsed field. FIXLEN=m is
optional for a % ignored field.
When %nn is specified in BUILD or OVERLAY, the variable-length data is
extracted to the fixed area and then used for BUILD or OVERLAY
processing. The fixed area always contains m bytes. If the extracted data is
longer than m, the fixed area contains the first m bytes of the extracted
data (the data is truncated on the right to m bytes). If the extracted data is
shorter than m, the fixed area contains the extracted data padded with
blanks on the right to m bytes. If no data is extracted, the fixed area
contains all blanks.
The length m from FIXLEN=m for fixed parsed fields (%nn) corresponds to
the length (m) for fixed fields (p,m). Keep in mind that %nn fields are
left-aligned and may be padded on the right with blanks. You must ensure
that the data in each %nn field and its length (m) are valid for the way
you want to use that %nn field in BUILD or OVERLAY. For example, if
you had these records as input:
123,8621
1,302
18345,17
86.21
3.02
0.17
241
Note that the 5-byte extracted parsed fields for %00 are left-aligned and
padded with blanks (b) like this:
123bb
1bbbb
18345
and the 5-byte extracted parsed fields for %01 are left-aligned and padded
with blanks (b) like this:
8621b
302bb
17bbb
Thus, you cannot use numeric formats like ZD or FS for these parsed
fields, but you can use UFF. Note also that you must ensure that m from
FIXLEN=m for each %nn parsed field is valid for the specific BUILD or
OVERLAY item in which you use %nn. For example, you could use 1-44 as
m for UFF, but you couldn't use 45 as m.
If ENDBEFR and ENDAT are not specified, the Start Pointer is set m bytes
past the start of the extracted data. For example, if you had this record as
input:
MAX=(ABCDEF)
DEF
Sample Syntax
OUTFIL PARSE=(%00=(STARTAFT=CKW=,FIXLEN=12)),
BUILD=(%00)
ABSPOS=p
Sets the Start Pointer for this parsed field to p. p can be 1 to 32752. By
default, the Start Pointer for the first %nn parsed field is position 1 for
fixed-length records or position 5 for variable-length records, and the Start
Pointer for each subsequent %nn parsed field is the Start Pointer set by the
previous %nn field. You can use ABSPOS=p to set the Start Pointer to
position p to override the default Start Pointer. If the resulting Start Pointer
is less than position 5 for variable length records, it will be set to position
5.
Example
If your input is:
****|BB|CCCC|
****|EEEE|FF|
and you wanted to reformat the data into fixed positions like this:
**** BB
CCCC
**** EEEE FF
242
The initial Start Pointer for the %01 parsed field is set to position 6 instead
of to position 1.
ADDPOS=x
Increments the Start Pointer for this parsed field by x. x can be 1 to 32752.
By default, the Start Pointer for the first %nn parsed field is position 1 for
fixed-length records or position 5 for variable-length records, and the Start
Pointer for each subsequent %nn parsed field is the Start Pointer set by the
previous %nn field. You can use ADDPOS=x to increment the Start Pointer
by x to override the default Start Pointer.
Sample Syntax
OUTFIL PARSE=(%00=(ENDAT=C||,FIXLEN=10),
%01=(ADDPOS=5,STARTAFT=C;,FIXLEN=6)),
BUILD=(%00,TRAN=ALTSEQ,%01)
SUBPOS=y
Decrements the Start Pointer for this parsed field by y. y can be 1 to 32752.
By default, the Start Pointer for the first %nn parsed field is position 1 for
fixed-length records or position 5 for variable-length records, and the Start
Pointer for each subsequent %nn parsed field is the Start Pointer set by the
previous %nn field. You can use SUBPOS=y to decrement the Start Pointer
by x to override the default Start Pointer. If the resulting Start Pointer is
less than position 1 for fixed-length records, it will be set to position 1. If
the resulting Start Pointer is less than position 5 for variable-length
records, it will be set to position 5.
Sample Syntax
OUTFIL PARSE=(%00=(ENDBEFR=C|;|,FIXLEN=10),
%01=(SUBPOS=1,STARTAT=C|,ENDAT=C|,FIXLEN=12)),
BUILD=(%00,TRAN=ALTSEQ,%01)
STARTAFT=string
Data is to be extracted for this parsed field starting after the last byte of
the specified string. The search for the string begins at the Start Pointer. If
the specified string is not found, data is not extracted for this parsed field
or any subsequent parsed fields. If the specified string is found, data is
extracted to the fixed area for this parsed field starting at the byte after the
end of the string, and the Start Pointer is set to the byte after the end of
the string.
string can be 1 to 256 characters specified using a character string constant
(C'xx...x') or a hexadecimal string constant (X'yy...yy'). See INCLUDE
control statement on page 96 for details of coding character and
hexadecimal string constants.
Example
If your input is:
MAX=25,832
MAX=1,275
MIN=17 %3
MIN=2,831
$4
and you wanted your output to contain MAX-MIN, you could use this
OUTFIL statement:
OUTFIL PARSE=(%00=(STARTAFT=CMAX=,ENDBEFR=X40,FIXLEN=6),
%01=(STARTAFT=CMIN=,ENDBEFR=X40,FIXLEN=6)),
OVERLAY=(50:CDELTA: ,%00,UFF,SUB,%01,UFF,TO=ZD,LENGTH=8)
Chapter 3. Using DFSORT program control statements
243
is equivalent to specifying
%=(STARTAFT=C0,STARTAFT=C1,STARTAFT=C2,STARTAFT=C3,
STARTAFT=C4,STARTAFT=C5,STARTAFT=C6,STARTAFT=C7,
STARTAFT=C8,STARTAFT=C9)
You can add more characters to a set with additional STARTAFT operands.
For example, if you wanted the lowercase characters and the $ and @
characters for the set, you could use:
%05=(STARTAFT=LC,STARTAFT=C$,STARTAFT=C@,FIXLEN=10)
Example
If your input is:
a123
1Stop
Z0056
2rest
q8
3go
STARTAFT=BLANKS
Data is to be extracted for this parsed field starting at the first nonblank
after one or more blanks. The search for a blank begins at the Start Pointer.
If a blank is not found, data is not extracted for this parsed field or any
subsequent parsed fields. If a blank is found, data is extracted to the fixed
area for this parsed field starting at the first nonblank, and the Start
Pointer is set to the first nonblank.
Example
244
D28
Vicky
D52
D28
D52
STARTAT=string
Data is to be extracted for this parsed field starting at the first byte of the
specified string. The search for the string begins at the Start Pointer. If the
specified string is not found, data is not extracted for this parsed field or
any subsequent parsed fields. If the specified string is found, data is
extracted to the fixed area for this parsed field starting at the first byte of
the string, and the Start Pointer is set to the byte after the end of the
string.
string can be 1 to 256 characters specified using a character string constant
(C'xx...x') or a hexadecimal string constant (X'yy...yy'). See INCLUDE
control statement on page 96 for details of coding character and
hexadecimal string constants.
Example
If your input is:
MAX=58321
MIN=00273
MAX=01275
MIN=00017
STARTAT=an
Data is to be extracted for this parsed field starting at the first character
found from the specified alphanumeric set. The search for a character in
the specified set begins at the Start Pointer. If a character in the set is not
found, data is not extracted for this parsed field or any subsequent parsed
field. If a character in the set is found, data is extracted to the fixed area
for this parsed field starting at that character, and the Start Pointer is set to
the byte after that character.
See STARTAFT=an previously in this section for more information on using
the available alphanumeric character sets.
Example
If your input is:
$@$321%@%$Frank
@053$Susan
%%%$$836%$Vicky
245
STARTAT=BLANKS
Data is to be extracted for this parsed field starting at the first blank. The
search for a blank begins at the Start Pointer. If a blank is not found, data
is not extracted for this parsed field or any subsequent parsed fields. If a
blank is found, data is extracted to the fixed area for this parsed field
starting at the first blank, and the Start Pointer is set to the first nonblank.
STARTAT=NONBLANK
Data is to be extracted for this parsed field starting at the first nonblank.
The search for a nonblank begins at the Start Pointer. If a nonblank is not
found, data is not extracted for this parsed field or any subsequent parsed
fields. If a nonblank is found, data is extracted to the fixed area for this
parsed field starting at the nonblank, and the Start Pointer is set to the
nonblank.
Example
If your input is:
Frank
D28
Victoria
Holly D15
Roberta
D52
D52
D28
D52
D15
D52
Note: Multiple STARTAFT/STARTAT strings, UC, LC, MC, UN, LN, MN,
NUM, BLANKS or NONBLANK can be used for a %nn parsed field to
search for more than one string, set of characters, blanks or a nonblank.
The first search satisfied is used.
Example
If your input is:
12
MAXCC=08
58 MINCC=00
MAXCC=04
246
ENDBEFR=string
Data is to be extracted for this parsed field ending before the first byte of
the specified string. The search for the string begins at the Start Pointer. If
the specified string is not found, data is extracted to the fixed area for this
parsed field up to the end of the record, but data is not extracted for any
subsequent parsed fields. If the specified string is found, data is extracted
to the fixed area for this parsed field up to the byte before the start of the
string, and the Start Pointer is set to the byte after the end of the string.
string can be 1 to 256 characters specified using a character string constant
(C'xx...x') or a hexadecimal string constant (X'yy...yy'). See INCLUDE
control statement on page 96 for details of coding character and
hexadecimal string constants.
Example
If your input is:
Morgan Hill;California;5000:
San Jose;California;2000:
Austin;Texas;8000:
California 5000
California 2000
Texas
8000
ENDBEFR=an
Data is to be extracted for this parsed field ending before the first character
Chapter 3. Using DFSORT program control statements
247
and you wanted to extract the leading $ characters in each input record,
you could use this OUTFIL statement:
OUTFIL PARSE=(%10=(ENDBEFR=MN,FIXLEN=10)),
BUILD=(%10)
ENDBEFR=BLANKS
Data is to be extracted for this parsed field ending before the first blank.
The search for a blank begins at the Start Pointer. If a blank is not found,
data is extracted to the fixed area for this parsed field up to the end of the
record, but data is not extracted for any subsequent parsed fields. If a
blank is found, data is extracted to the fixed area for this parsed field up to
the byte before the blank, and the Start Pointer is set to the first nonblank.
Example
If your input is:
1
Frank
2 Loretta
D28 123
No
D52
58 Yes
ENDAT=string
Data is to be extracted for this parsed field ending at the last byte of the
specified string. The search for the string begins at the Start Pointer. If the
specified string is not found, data is extracted to the fixed area for this
parsed field up to the end of the record, but data is not extracted for any
subsequent parsed fields. If the specified string is found, data is extracted
to the fixed area for this parsed field up to the last byte of the string, and
the Start Pointer is set to the byte after the end of the string
string can be 1 to 256 characters specified using a character string constant
(C'xx...x') or a hexadecimal string constant (X'yy...yy'). See INCLUDE
control statement on page 96 for details of coding character and
hexadecimal string constants.
248
ENDAT=an
Data is to be extracted for this parsed field ending at the first character
found from the specified alphanumeric set. The search for a character in
the specified set begins at the Start Pointer. If a character in the set is not
found, data is extracted to the fixed area for this parsed field up to the end
of the record, but data is not extracted for any subsequent parsed fields. If
a character in the set is found, data is extracted to the fixed area for this
parsed field up to that character, and the Start Pointer is set to the byte
after that character.
See STARTAFT=an previously in this section for more information on using
the available alphanumeric character sets.
Example
If your input is:
A0005X2
Z081789Q331
R3M05
S52J06834
2
331
05
06834
ENDAT=BLANKS
Data is to be extracted for this parsed field ending at the last blank before
a nonblank. The search for a blank begins at the Start Pointer. If a blank is
not found, data is extracted to the fixed area for this parsed field up to the
end of the record, but data is not extracted for any subsequent parsed
fields. If a blank is found, data is extracted to the fixed area for this parsed
field up to the byte before the first nonblank, and the Start Pointer is set to
the first nonblank.
Note: Multiple ENDBEFR/ENDAT strings, UC, LC, MC, UN, LN, MN,
NUM, or BLANKS can be used for a %nn parsed field to search for more
than one string, set of characters or blanks. The first search satisfied is
used.
249
PAIR=APOST
Do not search for strings or blanks between apostrophe (') pairs. Use
POST=APOST when you might have strings you are searching for within
literals that should not satisfy the search.
Once an apostrophe is found, searching is discontinued until another
apostrophe is found. Searching then continues after the second apostrophe
of the pair. If an unpaired apostrophe is found, strings or BLANKS will not
be recognized from that point on, so be careful not to set the Start Pointer
in the middle of an apostrophe pair.
Do not specify PAIR=APOST if you want to search for a string containing
an apostrophe, because the string will not be searched for within the
paired apostrophes.
Example
If your input is:
23,12,567,823,5,032
9,903,18,321,8
5,032
8
With PAIR=APOST, the commas outside the apostrophe pairs satisfy the
search, but the commas within the apostrophe pairs do not satisfy the
search.
PAIR=QUOTE
Do not search for strings or blanks between quote (") pairs. Use
POST=QUOTE when you might have strings you are searching for within
literals that should not satisfy the search.
Once a quote is found, searching is discontinued until another quote is
found. Searching then continues after the second quote of the pair. If an
250
5,032
8
With PAIR=QUOTE, the commas outside the quote pairs satisfy the search,
but the commas within the quote pairs do not satisfy the search.
Default for PARSE: None; must be specified.
REPEAT=v
Repeat this parsed field v times.
REPEAT=v can be used with % to specify v identically defined consecutive
parsed fields to be ignored. v can be 2 to 1000. For example, to ignore five
consecutive comma delimited fields, you can use:
%=(ENDBEFR=C,,REPEAT=5),
251
and you wanted to extract the first value, skip the next three values and
then extract the last six values to produce output like this:
011 055 160 007 082 095 037
010 005 016 072 002 005 042
003 007 009 052 012 000 000
OUTREC=
BUILD=
( item
,
OVERLAY=( ( item
,
FINDREP=( ( item
,
IFTHEN=(clause)
These operands allow you to reformat the OUTFIL input records in this
OUTFIL group.
You can create the reformatted OUTFIL records in one of the following ways
using unedited, edited, or converted input fields (p,m for fixed fields, or %nn
for parsed fields - see PARSE) and a variety of constants:
252
v OVERLAY: Reformat each record by specifying just the items that overlay
specific columns. Overlay lets you change specific existing columns without
affecting the entire record. Example:
OUTFIL OVERLAY=(45:45,8,TRAN=LTOU)
v FINDREP: Reformat each record by doing various types of find and replace
operations. Example:
OUTREC FINDREP=(INOUT=(CPigeon,CDove,CHawk,CEagle))
You can choose to include any or all of the following items in your reformatted
OUTFIL records:
v Fixed position/length fields or variable position/length fields. For fixed
fields, you specify the starting position and length of the field directly. For
variable fields, such as delimited fields, comma separated values (CSV), tab
separated values, blank separated values, keyword separated fields,
null-terminated strings (and many other types), you define rules that allow
DFSORT to extract the relevant data into fixed parsed fields, and then use
the parsed fields as you would use fixed fields.
v Blanks, binary zeros, character strings, and hexadecimal strings.
v Current date, future date, past date, and current time in various forms.
v Replaced or removed strings.
v Unedited input fields aligned on byte, halfword, fullword, and doubleword
boundaries.
v Hexadecimal or bit representations of binary input fields.
v Characters translated from uppercase to lowercase, lowercase to uppercase,
ASCII to EBCDIC or EBCDIC to ASCII.
v Left-justified, right-justified, left-squeezed or right-squeezed input fields.
v Numeric input fields of various formats converted to different numeric
formats, or to character format edited to contain signs, thousands separators,
decimal points, leading zeros or no leading zeros, and so on.
253
254
OUTREC=
BUILD=
c:
s
p,m
,a
%nn
p
p,m
%nn
p
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
Specifies all of the items in the reformatted OUTFIL record in the order in
which they are to be included. The reformatted OUTFIL record consists of the
separation fields, edited and unedited input fields (p,m for fixed fields, or %nn
for parsed fields - see PARSE), edited decimal constants, edited results of
arithmetic expressions, and sequence numbers you select, in the order in which
you select them, aligned on the boundaries or in the columns you indicate.
For variable-length records, the first item in the BUILD or OUTREC parameter
must specify or include the unedited 4-byte record descriptor word (RDW),
that is, you must start with 1,m with m equal to or greater than 4. If you want
to include the bytes from a specific position to the end of each input record at
the end of each reformatted output record, you can specify that starting
position (p) as the last item in the BUILD or OUTREC parameter. For example:
OUTFIL OUTREC=(1,4,
1,2,BI,TO=ZD,LENGTH=5,
C|,
5)
unedited RDW
display RDW length in decimal
| separator
display input positions 5 to end
Chapter 3. Using DFSORT program control statements
255
DFSORT will then set the LRECL to 81 (1 byte for the ANSI carriage control
character plus 80 bytes for the length of the data records), and pad the data
records with blanks on the right.
If you don't want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them. For example, if you
specify:
OUTREC=(1,40,80:X),REMOVECC
DFSORT will set the LRECL to 80 instead of 81 and remove the ANSI carriage
control character from each record before it is written.
The BUILD or FIELDS parameter of the OUTREC statement differs from the
BUILD or OUTREC parameter of the OUTFIL statement in the following ways:
256
nZ
257
ONEILL Specify:
CONEILL
See Table 32 on page 131 for examples of valid and invalid character
string separation.
nX'yy...yy'
Hexadecimal string separation. n repetitions of the hexadecimal string
constant (X'yy...yy') are to appear in the reformatted OUTFIL output
records. n can range from 1 to 4095. If n is omitted, 1 is used.
The value yy represents any pair of hexadecimal digits. You can
specify from 1 to 256 pairs of hexadecimal digits.
See Table 33 on page 132 for examples of valid and invalid
hexadecimal string separation.
Format of Constant
Length (bytes)
Example of Constant
DATE1
C'yyyymmdd'
C'20050621'
DATE1(c)
C'yyyycmmcdd'
10
C'2005/06/21'
DATE1P
P'yyyymmdd'
P'20050621'
DATE2
C'yyyymm'
C'200506'
DATE2(c)
C'yyyycmm'
C'2005/06'
DATE2P
P'yyyymm'
P'200506'
DATE3
C'yyyyddd'
C'2005172'
258
Format of Constant
Length (bytes)
Example of Constant
DATE3(c)
C'yyyycddd'
C'2005/172'
DATE3P
P'yyyyddd'
P'2005172'
DATE4
C'yyyy-mm-dd-hh.mm.ss'
19
C'2005-06-21-16.52.45'
DATE5
C'yyyy-mm-dd-hh.mm.ss.nnnnnn'
26
C'2005-06-21-16.52.45.602837'
Note: You can precede each of the operands in the table with an &
with identical results.
&DATEn, &DATEN(c), &DATEnP
Can be used instead of DATEn, DATEn(c) and DATEnP, respectively
DATEn+r, DATEn(c)+r, DATEnP+r
Constant for future date. A future date relative to the current date of
the run is to appear in the reformatted OUTFIL output records.
DATE1+d, &DATE1+d, DATE1(c)+d, &DATE1(c)+d, DATE2+m,
&DATE2+m, DATE2(c)+m, &DATE2(c)+m, DATE3+d, &DATE3+d,
DATE3(c)+d or &DATE3(c)+d can be used to generate a character
constant for a future date relative to the current date of the run.
DATE1P+d, &DATE1P+d, DATE2P+m, &DATE2P+m, DATE3P+d or
&DATE3P+d can be used to generate a packed decimal constant for a
future date relative to the current date of the run. d is days in the
future and m is months in the future. d and m can be 0 to 9999.
Table 40 shows the form of the constant generated for each future date
operand and an example of the actual constant generated when the
date of the run is June 21, 2005, using (/) for (c) where relevant. yyyy
represents the year, mm (for date) represents the month (01-12), dd
represents the day (01-31), ddd represents the day of the year (001-366),
and c can be any character except a blank.
Table 40. Future Date Constants
Format of
Operand
Format of
Constant
Length (bytes)
Example of
Operand
Example of
Constant
DATE1+d
C'yyyymmdd'
DATE1+11
C'20050702'
DATE1(c)+d
C'yyyycmmcdd'
10
DATE1(/)+90
C'2005/09/19'
DATE1P+d
P'yyyymmdd'
DATE1P+11
P'20050702'
DATE2+m
C'yyyymm'
DATE2+2
C'200508'
DATE2(c)+m
C'yyyycmm'
DATE2(.)+25
C'2007.07'
DATE2P+m
P'yyyymm'
DATE2P+2
P'200508'
DATE3+d
C'yyyyddd'
DATE3+200
C'2006007'
DATE3(c)+d
C'yyyycddd'
DATE3(-)+1
C'2005-171'
DATE3P+d
P'yyyyddd'
DATE3P+200
P'2006007'
Note: You can precede each of the operands in the table with an &
with identical results.
259
Format of
Constant
Length (bytes)
Example of
Operand
Example of
Constant
DATE1-d
C'yyyymmdd'
DATE1-1
C'20050620'
DATE1(c)-d
C'yyyycmmcdd'
10
DATE1(-)-60
C'2005-04-22'
DATE1P-d
P'yyyymmdd'
DATE1P-30
P'20050522'
DATE2-m
C'yyyymm'
DATE2-6
C'200412'
DATE2(c)-m
C'yyyycmm'
DATE2(/)-1
C'2005/05'
DATE2P-m
P'yyyymm'
DATE2P-12
P'200406'
DATE3-d
C'yyyyddd'
DATE3-300
C'2004238'
DATE3(c)-d
C'yyyycddd'
DATE3(.)-21
C'2005.151'
DATE3P-d
P'yyyyddd'
DATE3P-172
P'2004366'
Note: You can precede each of the operands in the table with an &
with identical results.
&DATEn-r, &DATEn(c)-r, &DATEnP-r
Can be used instead of DATEn-r, DATEn(c)-r and DATEnP-r,
respectively.
TIMEn, TIMEn(c), TIMEnP
Constant for current time. The time of the run is to appear in the
reformatted OUTFIL output records. Table 42 on page 261 shows the
constant generated for each separation field you can specify along with
its length and an example using (:) for (c) where relevant. hh
represents the hour (00-23), mm represents the minutes (00-59), ss
represents the seconds (00-59), and c can be any character except a
blank.
260
Constant
TIME1
C'hhmmss'
C'135543'
TIME1(c)
C'hhcmmcss'
C'13:55:43'
TIME1P
P'hhmmss'
P'135543'
TIME2
C'hhmm'
C'1355'
TIME2(c)
C'hhcmm'
C'13:55'
TIME2P
P'hhmm'
P'1355'
TIME3
C'hh'
C'13'
TIME3P
P'hh'
P'13'
261
262
263
Note that four OUTFIL output records are produced for each OUTFIL
input record.
p,m,a
specifies that an unedited input field is to appear in the reformatted OUTFIL
output record.
p
specifies the first byte of the input field relative to the beginning of the
OUTFIL input record. The first data byte of a fixed-length record has
relative position 1. The first data byte of a variable-length record has
relative position 5, because the first four bytes are occupied by the RDW.
All fields must start on a byte boundary, and no field can extend beyond
byte 32752. See OUTFIL statements notes on page 374 for special rules
concerning variable-length records.
Alignment can be necessary if, for example, the data is used in a COBOL
application program where items are aligned through the
SYNCHRONIZED clause. Unused space preceding aligned fields are
always padded with binary zeros.
%nn
specifies that an unedited parsed input field is to appear in the reformatted
OUTFIL output record. See PARSE for details of parsed fields. See p,m,a for
further details. Note that alignment (H, F, D) is not permitted for %nn fields
(for example, %nn,F results in an error message and termination).
p
specifies the unedited variable part of the OUTFIL input record (that part
beyond the minimum record length) is to appear in the reformatted OUTFIL
output record as the last field. p without m can only be used for
variable-length records; not for fixed-length records.
Attention: If 1,4,p is specified (only RDW and variable part of record), "null"
records containing only an RDW will result if the record length is less than p.
A value must be specified for p that is less than or equal to the minimum
OUTFIL input record length plus 1 byte.
264
specifies the length in bytes of the numeric field and depends on the
keyword used as indicated.
TRAN=keyword
specifies the type of translation to be performed. The keyword can be one
of the following:
TRAN=LTOU
translates lowercase EBCDIC letters (that is, a-z) to uppercase EBCDIC
letters (that is, A-Z). Other characters are not changed. For example,
the characters 'Vicky-123,x' would be replaced by 'VICKY-123,X'.
m can be 1 to 32752. The output length will be m bytes.
TRAN=UTOL
translates uppercase EBCDIC letters (that is, A-Z) to lowercase EBCDIC
letters (that is, a-z). Other characters are not changed. For example, the
characters 'CARRIE-005, CA' would be replaced by 'carrie-005, ca'.
m can be 1 to 32752. The output length will be m bytes.
TRAN=ALTSEQ
translates characters according to the ALTSEQ translation table in
effect. For example, the characters X'5B5C' would be replaced by
X'4040' if ALTSEQ CODE=(5B40,5C40) was in effect.
m can be 1 to 32752. The output length will be m bytes.
TRAN=ATOE
translates characters from ASCII to EBCDIC using the default standard
TCP/IP service ASCII-to-EBCDIC translation table. For example, with
TRAN=ATOE, the ASCII characters aB2 (X'614232') would be replaced
by the EBCDIC characters aB2 (X'81C2F2').
m can be 1 to 32752. The output length will be m bytes.
Table 43 on page 266 is the default standard TCP/IP table used for
TRAN=ATOE. Each column shows the ASCII (A) character value on
the left and its equivalent EBCDIC (E) character value on the right.
265
E| A
--|-00|10
01|11
02|12
03|13
37|14
2D|15
2E|16
2F|17
16|18
05|19
25|1A
0B|1B
0C|1C
0D|1D
0E|1E
0F|1F
E| A
--|-10|20
11|21
12|22
13|23
3C|24
3D|25
32|26
26|27
18|28
19|29
3F|2A
27|2B
22|2C
1D|2D
35|2E
1F|2F
E| A
--|-40|30
5A|31
7F|32
7B|33
5B|34
6C|35
50|36
7D|37
4D|38
5D|39
5C|3A
4E|3B
6B|3C
60|3D
4B|3E
61|3F
E| A
--|-F0|40
F1|41
F2|42
F3|43
F4|44
F5|45
F6|46
F7|47
F8|48
F9|49
7A|4A
5E|4B
4C|4C
7E|4D
6E|4E
6F|4F
E| A
--|-7C|50
C1|51
C2|52
C3|53
C4|54
C5|55
C6|56
C7|57
C8|58
C9|59
D1|5A
D2|5B
D3|5C
D4|5D
D5|5E
D6|5F
E| A
--|-D7|60
D8|61
D9|62
E2|63
E3|64
E4|65
E5|66
E6|67
E7|68
E8|69
E9|6A
AD|6B
E0|6C
BD|6D
5F|6E
6D|6F
E| A
--|-79|70
81|71
82|72
83|73
84|74
85|75
86|76
87|77
88|78
89|79
91|7A
92|7B
93|7C
94|7D
95|7E
96|7F
E|
--|
97|
98|
99|
A2|
A3|
A4|
A5|
A6|
A7|
A8|
A9|
C0|
4F|
D0|
A1|
07|
E| A
--|-00|90
01|91
02|92
03|93
37|94
2D|95
2E|96
2F|97
16|98
05|99
25|9A
0B|9B
0C|9C
0D|9D
0E|9E
0F|9F
E| A
--|-10|A0
11|A1
12|A2
13|A3
3C|A4
3D|A5
32|A6
26|A7
18|A8
19|A9
3F|AA
27|AB
22|AC
1D|AD
35|AE
1F|AF
E| A
--|-40|B0
5A|B1
7F|B2
7B|B3
5B|B4
6C|B5
50|B6
7D|B7
4D|B8
5D|B9
5C|BA
4E|BB
6B|BC
60|BD
4B|BE
61|BF
E| A
--|-F0|C0
F1|C1
F2|C2
F3|C3
F4|C4
F5|C5
F6|C6
F7|C7
F8|C8
F9|C9
7A|CA
5E|CB
4C|CC
7E|CD
6E|CE
6F|CF
E| A
--|-7C|D0
C1|D1
C2|D2
C3|D3
C4|D4
C5|D5
C6|D6
C7|D7
C8|D8
C9|D9
D1|DA
D2|DB
D3|DC
D4|DD
D5|DE
D6|DF
E| A
--|-D7|E0
D8|E1
D9|E2
E2|E3
E3|E4
E4|E5
E5|E6
E6|E7
E7|E8
E8|E9
E9|EA
AD|EB
E0|EC
BD|ED
5F|EE
6D|EF
E| A
--|-79|F0
81|F1
82|F2
83|F3
84|F4
85|F5
86|F6
87|F7
88|F8
89|F9
91|FA
92|FB
93|FC
94|FD
95|FE
96|FF
E|
--|
97|
98|
99|
A2|
A3|
A4|
A5|
A6|
A7|
A8|
A9|
C0|
4F|
D0|
A1|
07|
TRAN=ETOA
translates characters from EBCDIC to ASCII using the default standard
TCP/IP service EBCDIC-to-ASCII translation table. For example, with
TRAN=ETOA, the EBCDIC characters aB2 (X'81C2F2') would be
replaced by the ASCII characters aB2 (X'614232').
m can be 1 to 32752. The output length will be m bytes.
Table 44 on page 267is the default standard TCP/IP table used for
TRAN=ETOA. Each column shows the EBCDIC (E) character value on
the left and its equivalent ASCII (A) character value on the right.
266
A| E
--|-00|10
01|11
02|12
03|13
1A|14
09|15
1A|16
7F|17
1A|18
1A|19
1A|1A
0B|1B
0C|1C
0D|1D
0E|1E
0F|1F
A| E
--|-10|20
11|21
12|22
13|23
1A|24
0A|25
08|26
1A|27
18|28
19|29
1A|2A
1A|2B
1C|2C
1D|2D
1E|2E
1F|2F
A| E
--|-1A|30
1A|31
1C|32
1A|33
1A|34
0A|35
17|36
1B|37
1A|38
1A|39
1A|3A
1A|3B
1A|3C
05|3D
06|3E
07|3F
A| E
--|-1A|40
1A|41
16|42
1A|43
1A|44
1E|45
1A|46
04|47
1A|48
1A|49
1A|4A
1A|4B
14|4C
15|4D
1A|4E
1A|4F
A| E
--|-20|50
A6|51
E1|52
80|53
EB|54
90|55
9F|56
E2|57
AB|58
8B|59
9B|5A
2E|5B
3C|5C
28|5D
2B|5E
7C|5F
A| E
--|-26|60
A9|61
AA|62
9C|63
DB|64
A5|65
99|66
E3|67
A8|68
9E|69
21|6A
24|6B
2A|6C
29|6D
3B|6E
5E|6F
A| E
--|-2D|70
2F|71
DF|72
DC|73
9A|74
DD|75
DE|76
98|77
9D|78
AC|79
BA|7A
2C|7B
25|7C
5F|7D
3E|7E
3F|7F
A|
--|
D7|
88|
94|
B0|
B1|
B2|
FC|
D6|
FB|
60|
3A|
23|
40|
27|
3D|
22|
A| E
--|-F8|90
61|91
62|92
63|93
64|94
65|95
66|96
67|97
68|98
69|99
96|9A
A4|9B
F3|9C
AF|9D
AE|9E
C5|9F
A| E
--|-8C|A0
6A|A1
6B|A2
6C|A3
6D|A4
6E|A5
6F|A6
70|A7
71|A8
72|A9
97|AA
87|AB
CE|AC
93|AD
F1|AE
FE|AF
A| E
--|-C8|B0
7E|B1
73|B2
74|B3
75|B4
76|B5
77|B6
78|B7
79|B8
7A|B9
EF|BA
C0|BB
DA|BC
5B|BD
F2|BE
F9|BF
A| E
--|-B5|C0
B6|C1
FD|C2
B7|C3
B8|C4
B9|C5
E6|C6
BB|C7
BC|C8
BD|C9
8D|CA
D9|CB
BF|CC
5D|CD
D8|CE
C4|CF
A| E
--|-7B|D0
41|D1
42|D2
43|D3
44|D4
45|D5
46|D6
47|D7
48|D8
49|D9
CB|DA
CA|DB
BE|DC
E8|DD
EC|DE
ED|DF
A| E
--|-7D|E0
4A|E1
4B|E2
4C|E3
4D|E4
4E|E5
4F|E6
50|E7
51|E8
52|E9
A1|EA
AD|EB
F5|EC
F4|ED
A3|EE
8F|EF
A| E
--|-5C|F0
E7|F1
53|F2
54|F3
55|F4
56|F5
57|F6
58|F7
59|F8
5A|F9
A0|FA
85|FB
8E|FC
E9|FD
E4|FE
D1|FF
A|
--|
30|
31|
32|
33|
34|
35|
36|
37|
38|
39|
B3|
F7|
F0|
FA|
A7|
FF|
TRAN=HEX
translates binary values to their equivalent EBCDIC hexadecimal
values. For example, with TRAN=HEX, X'C1F1' (C'A1') would be
replaced by C'C1F1'.
m can be 1 to 16376. The output length will be m*2 bytes
TRAN=UNHEX
translates EBCDIC hexadecimal values to their equivalent binary
values. For example, with TRAN=UNHEX, C'C1F1' would be replaced
by X'C1F1' (C'A1').
m can be 1 to 32752. The output length will be (m+1)/2 bytes.
If m is odd, the last nibble will be 0. As an example, C'C1F1F' would
translate to X'C1F1F0' (C'A10').
If an input character is not 0-9 or A-F, the equivalent nibble will be set
to 0. As an example, C'G2' will be translated to X'02'.
267
%nn,TRAN=keyword
Specifies that a parsed input field is to be translated as indicated by the
keyword. See PARSE for details of PARSED fields. See p,m,TRAN=keyword for
details of the translation functions.
p,TRAN=keyword
Specifies that the variable part of the input record is to be translated as
indicated by the keyword. p,TRAN=keyword must be the last item and can
only be used for variable-length records; not for fixed-length records. A value
must be specified for p that is less than or equal to the minimum input record
length plus 1 byte. See p,m,TRAN=keyword for details of the translation
functions.
Attention: If 1,4,p,TRAN=keyword is specified (only RDW and variable part
of record), "null" records containing only an RDW will result if the record
length is less than p.
Sample Syntax:
OUTFIL FNAMES=OUT2,BUILD=(1,4,5,TRAN=ETOA)
p,m,HEX
Can be used instead of p,m,TRAN=HEX. See p,m,TRAN=HEX for details.
%nn,HEX
Can be used instead of %nn,TRAN=HEX. See %nn,TRAN=HEX for details.
p,HEX
Can be used instead of p,TRAN=HEX. See p,TRAN=HEX for details.
p,m,f,edit or (p,m,f),edit
specifies that an edited numeric input field is to appear in the reformatted
OUTFIL output record. You can edit BI, FI, PD, PD0, ZD, FL,CSF, FS, UFF, SFF,
DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4, TE1,
TE2, TE3, TE4, TM1, TM2, TM3 or TM4 fields using either pre-defined edit
masks (M0-M26) or specific edit patterns you define. You can control the way
the edited fields look with respect to length, leading or suppressed zeros,
thousands separators, decimal points, leading and trailing positive and
negative signs, and so on.
268
specifies the length in bytes of the numeric field. The length must include
the sign, if the data is signed. See Table 45 for permissible length values.
Length
Description
BI
1 to 8 bytes
Unsigned binary
FI
1 to 8 bytes
Signed fixed-point
PD
1 to 16 bytes
PD0
2 to 8 bytes
ZD
1 to 31 bytes
FL
4 or 8 bytes
CSF or FS
UFF
SFF
DT1
4 bytes
DT2
4 bytes
DT3
4 bytes
DC1
8 bytes
DC2
8 bytes
DC3
8 bytes
DE1
8 bytes
DE2
8 bytes
DE3
8 bytes
TM1
4 bytes
TM2
4 bytes
TM3
4 bytes
TM4
4 bytes
TC1
8 bytes
TC2
8 bytes
TC3
8 bytes
TC4
8 bytes
TE1
8 bytes
TE2
8 bytes
TE3
8 bytes
TE4
8 bytes
269
Length
Description
270
Mn
EDIT=
EDxy=
(pattern)
('pattern')
,
SIGNS=
SIGNz=
(lp,ln,tp,tn)
,LENGTH=n
Specifies how the numeric field is to be edited for output. If an Mn, EDIT, or
EDxy parameter is not specified:
v a DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4,
TE1, TE2, TE3, TE4, TM1, TM2, TM3, or TM4 field is edited using the M11
edit mask.
v a BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, or SFF field is edited using the M0
edit mask.
Mn specifies one of twenty-seven pre-defined edit masks (M0-M26) for
presenting numeric data. If these pre-defined edit masks are not suitable
for presenting your numeric data, the EDIT parameter gives you the
flexibility to define your own edit patterns.
The twenty-seven pre-defined edit masks can be represented as follows:
Table 46. Edit Mask Patterns
Mask
M0
M1
M2
M3
Pattern
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIITS
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTS
II,III,III,III,III,III,III,III,III,IIT.TTS
II,III,III,III,III,III,III,III,III,IIT.TTCR
Examples
Value
Result
+01234
1234
-00001
1-
-00123
00123-
+00123
00123
+123450
1,234.50
-000020
0.20-
-001234
12.34CR
+123456
M4
M5
SII,III,III,III,III,III,III,III,III,IIT.TT
SII,III,III,III,III,III,III,III,III,IIT.TTS
+0123456
+1,234.56
-1234567
-12,345.67
-001234
(12.34)
+123450
M6
M7
M8
III-TTT-TTTT
TTT-TT-TTTT
IT:TT:TT
1,234.56
1,234.50
00123456
012-3456
12345678
1-234-56788
00123456
000-12-3456
12345678
012-34-5678
030553
3:05:53
121736
12:17:36
271
M9
M10
M11
M12
M13
M14
Pattern
Examples
IT/TT/TT
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
SI,III,III,III,III,III,III,III,III,III,IIT
SI.III.III.III.III.III.III.III.III.III.IIT
SI III III III III III III III III III IITS
Value
Result
123004
12/30/04
083104
8/31/04
01234
1234
00000
00010
00010
01234
01234
+1234567
1,234,567
-0012345
-12,345
+1234567
1.234.567
-0012345
-12.345
+1234567
-0012345
M15
M16
M17
M18
M19
M20
M21
M22
M23
M24
M25
M26
I III III III III III III III III III IITS
SI III III III III III III III III III IIT
SI'III'III'III'III'III'III'III'III'III'IIT
SII,III,III,III,III,III,III,III,III,IIT.TT
SII.III.III.III.III.III.III.III.III.IIT,TT
SII'III'III'III'III'III'III'III'III'IIT.TT
SII'III'III'III'III'III'III'III'III'IIT,TT
SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT
STTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
+1234567
1 234 567
(12 345)
1 234 567
-0012345
12 345-
+1234567
1 234 567
-0012345
-12 345
+1234567
1'234'567
-0012345
-12'345
+0123456
1,234.56
-1234567
-12,345.67
+0123456
1.234,56
-1234567
-12.345,67
+0123456
1 234,56
-1234567
(12 345,67)
+0123456
1 234,567
-1234567
12 345,67-
+0123456
1 234,56
-1234567
-12 345,67
+0123456
1'234.56
-1234567
-12'345.67
+0123456
1'234,56
-1234567
-12'345,67
+01234
1234
-00001
-1
1234
+01234
-1
-00001
The elements used in the representation of the edit masks in Table 46 on page 271
are as follows:
272
lp
ln
tp
tn
M0
none
none
blank
M1
none
none
blank
M2
none
none
blank
M3
none
none
none
none
M4
none
none
M5
blank
blank
M6
none
none
none
none
M7
none
none
none
none
M8
none
none
none
none
M9
none
none
none
none
M10
none
none
none
none
M11
none
none
none
none
M12
blank
none
none
M13
blank
none
none
M14
blank
blank
M15
none
none
blank
M16
blank
none
none
M17
blank
none
none
M18
blank
none
none
M19
blank
none
none
M20
blank
blank
M21
none
none
blank
M22
blank
none
none
M23
blank
none
none
M24
blank
none
none
M25
blank
none
none
M26
none
none
v any other character (for example, /) will be printed as shown, subject to certain
rules to be subsequently discussed.
273
Input Length
Digits Needed
ZD
PD
2m-1
PD0
2m-2
BI, FI
BI, FI
BI, FI
BI, FI
10
BI, FI
13
BI, FI
15
BI, FI
17
BI, FI
20
FL
4 or 8
20
CSF or FS
32
31
CSF or FS
UFF, SFF
32 to 44
31
UFF, SFF
The length of the output field can be represented as follows for each pattern,
where d is the number of digits needed, as shown in Table 48, and the result is
rounded down to the nearest integer:
Table 49. Edit Mask Output Field Lengths
Mask
Example
Input (f,m)
Output Length
M0
d+1
ZD,3
M1
d+1
PD,10
20
M2
d + 1 + d/3
BI,4
14
M3
d + 2 + d/3
UFF,20
28
M4
d + 1 + d/3
PD,8
21
M5
d + 2 + d/3
FI,3
12
M6
12
ZD,10
12
M7
11
PD,5
11
M8
ZD,6
M9
PD,4
M10
BI,6
15
M11
PD,5
274
Example
Input (f,m)
Output Length
M12
d + 1 + (d - 1)/3
PD,3
M13
d + 1 + (d - 1)/3
FS,5
M14
d + 2 + (d - 1)/3
ZD,5
M15
d + 1 + (d - 1)/3
FI,3
11
M16
d + 1 + (d - 1)/3
SFF,41
42
M17
d + 1 + (d - 1)/3
FI,4
14
M18
d + 1 + d/3
BI,4
14
M19
d + 1 + d/3
PD,8
21
M20
d + 2 + d/3
FI,3
12
M21
d + 1 + d/3
ZD,3
M22
d + 1 + d/3
BI,2
M23
d + 1 + d/3
PD,6
15
M24
d + 1 + d/3
ZD,21
29
M25
d+1
CSF,16
17
M26
d+1
FL,4
21
To illustrate conceptually how DFSORT produces the edited output from the
numeric value, consider the following example:
OUTFIL OUTREC=(5,7,ZD,M5)
with ZD values of C0123456(+0123456)
and C000302J (-0003021)
275
276
277
specifies the length of the edited output field. The value for n must be
between 1 and 44.
LENGTH does not change the pattern used, only the length of the
resulting edited output field. For example, as discussed previously for Mn,
if you specify:
OUTFIL OUTREC=(5,1,ZD,M4)
the pattern will be C'ST' rather than C'ST.TT' because the digit length is 1.
Specifying:
OUTFIL OUTREC=(5,1,ZD,M4,LENGTH=5)
278
%nn,f,edit or (%nn,f),edit
specifies that an edited numeric parsed input field is to appear in the
reformatted OUTFIL output record. See PARSE for details of parsed fields.
See p,m,f,edit or (p,m,f),edit for further details.
p,m,f,to or (p,m,f),to
specifies that a converted numeric input field is to appear in the
reformatted OUTFIL output record. You can convert BI, FI, PD, PD0, ZD,
FL, CSF, FS, UFF, SFF, DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3,
TC1, TC2, TC3, TC4, TE1, TE2, TE3, TE4, TM1, TM2, TM3, or TM4 fields to
BI, FI, PD, PDC, PDF, ZD, ZDF, ZDC, or CSF/FS fields.
p
to
fo
TO=
fo
(fo)
,LENGTH=
n
(n)
279
Output Length
Example Output
Length
BI with d <= 9
FS,9
BI with d > 9
FS,10
FI with d <= 9
ZD,7
FI with d > 9
ZD,12
d/2 + 1
BI,4
PD,9
17
CSF or FS
d+1
FI,4
21
For ZD or ZDF output, F is used as the positive sign and D is used as the
negative sign. For ZDC output, C is used as the positive sign.
For PD or PDC output, C is used as the positive sign and D is used as the
negative sign. For PDF output, F is used as the positive sign.
For CSF or FS output, blank is used as the positive sign, - is used as the
negative sign and leading zeros are suppressed.
For ZD, ZDF, ZDC, PD, PDC, PDF, CSF, or FS output, the maximum output
value is 9999999999999999999999999999999 (31 digits) and the minimum output
value is -9999999999999999999999999999999 (31 digits), which correspond to
the maximum and minimum input values, respectively.
For BI output:
v An input value greater than 18446744073709551615 (X'FFFFFFFFFFFFFFFF')
produces an output value of 18446744073709551615 (X'FFFFFFFFFFFFFFFF').
v An input value less than zero produces an absolute output value. For
example, an input value of P'-5000' produces a BI output value of 5000
(X'1388').
For FI output, an input value greater than 9223372036854775807
(X'7FFFFFFFFFFFFFFF') produces an output value of 9223372036854775807
(X'7FFFFFFFFFFFFFFF'), and an input value less than -9223372036854775808
(X'8000000000000000') produces an output value of -9223372036854775808
(X'8000000000000000').
fo, TO=fo and TO=(fo) are interchangeable except that:
v fo must be specified before the LENGTH parameter whereas TO can be
specified before or after the LENGTH parameter.
v TO=fo or TO=(fo) should be used after a symbol rather than fo to prevent
the misinterpretation of fo as f. See the discussion of OUTFIL OUTREC in
Chapter 7 for details.
LENGTH
specifies the length of the converted output field. If the implied length of the
output field is not suitable, LENGTH can be used to make the output field
shorter or longer.
n
specifies the length of the converted output field. The value for n must be
between 1 and 44.
If you specify a value for n that is shorter than the implied length,
truncation on the left will occur after conversion. For example, if you
specify:
280
%nn,f,to or (%nn,f),to
specifies that a converted numeric parsed input field is to appear in the
reformatted OUTFIL output record. See PARSE for details of parsed fields. See
p,m,f,to or (p,m,f),to for further details.
deccon,edit or (deccon),edit
specifies that an edited decimal constant is to appear in the reformatted
OUTFIL output record. The decimal constant must be in the form +n or -n
where n is 1 to 31 decimal digits. The sign (+ or -) must be specified. A
decimal constant produces a signed, 31-digit zoned decimal (ZD) result to be
edited as specified. If an Mn, EDIT, or EDxy parameter is not specified, the
decimal constant is edited using the M0 edit mask.
The default number of digits (d) used for editing is 15 for a decimal constant
with 1 to 15 significant digits, or 31 for a decimal constant with 16 to 31
significant digits. If EDIT or EDxy is specified, the number of digits in the
pattern (I's and T's) is used.
See edit under p,m,f,edit for further details on the edit fields you can use.
Sample Syntax:
OUTFIL OUTREC=(5,8,+4096,2X,-17,M18,LENGTH=7,2X,
(+2000000),EDIT=(STTTTT.TT),SIGNS=(+))
deccon,to or (deccon),to
specifies that a converted decimal constant is to appear in the reformatted
OUTFIL output record. The decimal constant must be in the form +n or -n
where n is 1 to 31 decimal digits. The sign (+ or -) must be specified. A
decimal constant produces a signed, 31-digit zoned decimal (ZD) result to be
converted as specified.
281
arexp,edit or (arexp),edit
Specifies that the edited result of an arithmetic expression is to appear in the
reformatted OUTFIL output record. An arithmetic expression takes the form:
term,operator,term<,operator,...>
where:
v term is a field (p,m,f), a parsed field (%nn,f), or a decimal constant (+n or
-n). See p,m,f under p,m,f,edit for details on the fields you can use. See
deccon under deccon,edit for details on the decimal constants you can use.
v operator is MIN (minimum), MAX (maximum), MUL (multiplication), DIV
(division), MOD (modulus), ADD (addition) or SUB (subtraction).
The order of evaluation precedence for the operators is as follows unless it is
changed by parentheses:
1. MIN and MAX
2. MUL, DIV and MOD
3. ADD and SUB
The intermediate or final result of a DIV operation is rounded down to the
nearest integer. The intermediate or final result of a MOD operation is an
integer remainder with the same sign as the dividend. If an intermediate or
final result of an arithmetic expression overflows 31 digits, the overflowing
intermediate or final result will be truncated to 31 digits, intentionally or
unintentionally. If an intermediate or final result of an arithmetic expression
requires division or modulus by 0, the intermediate or final result will be set to
0, intentionally or unintentionally.
An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result
to be edited as specified. If an Mn, EDIT, or EDxy parameter is not specified,
the result is edited using the M0 edit mask.
The default number of digits (d) used for editing is 15 if every term in the
expression is one of the following:
v a 1-4 byte BI or FI field
v a 1-8 byte PD field
v a 1-15 byte ZD, FS, CSF, UFF or SFF field
v
The default number of digits (d) used for editing is 31 if any term in the
expression is one of the following:
v a 5-8 byte BI or FI field
v a 9-16 byte PD field
v a 16-31 byte ZD field
v a 4-byte or 8-byte FL field
282
arexp,to or (arexp),to
specifies that the converted result of an arithmetic expression is to appear in
the reformatted OUTFIL output record. See arexp under arexp,edit for further
details on arithmetic expressions.
An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result
to be converted as specified.
The default number of digits (d) used for conversion is 15 if every term in the
expression is one of the following:
v
v
v
v
a
a
a
a
The default number of digits (d) used for conversion is 31 if any term in the
expression is one of the following:
v a 5-8 byte BI or FI field
v a 9-16 byte PD field
v
v
v
v
v
a
a
a
a
a
See to under p,m,f,to for further details on the to fields you can use.
Sample Syntax:
OUTFIL FNAMES=OUT,
OUTREC=(61,3,X,
35,6,FS,ADD,45,6,FS,ADD,55,6,FS,TO=FS,LENGTH=7,X,
(5,11,PD,MIN,112,11,PD),PD,LENGTH=11,X,
64,5,SEQNUM,5,ZD)
p,m,Y2x or p,m,Y4x
Specifies that an input date field is to be edited. Real Y2x dates are edited
using the century window established by the Y2PAST option in effect. Y2x and
Y4x dates with special indicators are expanded appropriately (for example,
p,6,Y2T transforms C'000000' to C'00000000').
Editing involving an input date with an invalid digit (A-F) can result in a data
exception (0C7 ABEND) or an incorrect output value. Editing involving an
invalid input date can result in an invalid output value.
p
283
Y2x or Y4x
Specifies the Y2 or Y4 format for the date field. See Appendix C, Data
format descriptions, on page 891 for detailed format descriptions.
Sample Syntax:
OUTFIL BUILD=(21,3,Y2U,X,3,8,Y4W)
Table 51 shows the output produced for each type of edited date.
Table 51. Input and result fields for Yxx date editing
m,Yxx
Input date
3,Y2T
4,Y2T
5,Y2T
6,Y2T
7,Y4T
8,Y4T
2,Y2U
3,Y2V
3,Y2U
4,Y2V
4,Y4U
5,Y4V
3,Y2W
4,Y2W
5,Y2W
6,Y2W
7,Y4W
8,Y4W
2,Y2X
3,Y2Y
3,Y2X
4,Y2Y
4,Y4X
5,Y4Y
2,Y2C
2,Y2Z
2,Y2S
2,Y2P
1,Y2D
1,Y2B
C'yyx' or Z'yyx'
C'yyxx' or Z'yyxx'
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
C'ccyyddd' or Z'ccyyddd'
C'ccyymmdd' or Z'ccyymmdd'
P'yyx'
P'yyxx'
P'yyddd'
P'yymmdd'
P'ccyyddd'
P'ccyymmdd'
C'xyy' or Z'xyy'
C'xxyy' or Z'xxyy'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
C'dddccyy' or Z'dddccyy'
C'mmddccyy' or Z'mmddccyy'
P'xyy'
P'xxyy'
P'dddyy'
P'mmddyy'
P'dddccyy'
P'mmddccyy'
C'yy'
Z'yy'
C'yy'
P'yy'
X'yy'
B'yy'
C'ccyyx'
C'ccyyxx'
C'ccyyddd'
C'ccyymmdd'
C'ccyyddd'
C'ccyymmdd'
C'ccyyx'
C'ccyyxx'
C'ccyyddd'
C'ccyymmdd'
C'ccyyddd'
C'ccyymmdd'
C'xccyy'
C'xxccyy'
C'dddccyy'
C'mmddccyy'
C'dddccyy'
C'mmddccyy'
C'xccyy'
C'xxccyy'
C'dddccyy'
C'mmddccyy'
C'dddccyy'
C'mmddccyy'
C'ccyy'
C'ccyy'
C'ccyy'
C'ccyy'
C'ccyy'
C'ccyy'
%nn,Y2x or %nn,Y4x
Specifies that a parsed input date field is to be edited. See PARSE for details of
parsed fields. See "p,m,Y2x or p,m,Y4x" for further details.
p,m,Y2x,edit or p,m,Y4x,edit
Specifies that the output for a p,m,Yxx input date field as shown in Table 51 is
to be further edited according to the edit parameters you specify. For example,
if you specify:
OUTFIL BUILD=(28,5,Y4V,EDIT=(TTTT-TT-TT)
284
p,m
,Y2x,
,Y4x,
TOJUL=Yaa
TOJUL=Yaa(s)
TOGREG=Yaa
TOGREG=Yaa(s)
WEEKDAY=CHAR3
WEEKDAY=CHAR9
WEEKDAY=DIGIT1
DT=(abcd)
DTNS=(abc)
WEEKNUM=USA
WEEKNUM=ISO
AGE=YMD
AGE=YM
AGE=YD
285
Input date
5,Y2T
6,Y2T
7,Y4T
8,Y4T
3,Y2U
4,Y2V
4,Y4U
5,Y4V
5,Y2W
6,Y2W
7,Y4W
8,Y4W
3,Y2X
4,Y2Y
4,Y4X
5,Y4Y
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
C'ccyyddd' or Z'ccyyddd'
C'ccyymmdd' or Z'ccyymmdd'
P'yyddd'
P'yymmdd'
P'ccyyddd'
P'ccyymmdd'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
C'dddccyy' or Z'dddccyy'
C'mmddccyy' or Z'mmddccyy'
P'dddyy'
P'mmddyy'
P'dddccyy'
P'mmddccyy'
Y2x or Y4x
Specifies the Y2 or Y4 format for the date field. See Appendix C, Data
format descriptions, on page 891 for detailed format descriptions.
todate Specifies the type of date conversion to be performed.
p,m,Yxx,TOJUL=Yaa
Converts the input date to a Julian output date.
p,m,Yxx,TOJUL=Yaa(s)
Converts the input date to a Julian output date with s
separators. s can be any character except a blank.
p,m,Yxx,TOGREG=Yaa
Converts the input date to a Gregorian output date.
p,m,Yxx,TOGREG=Yaa(s)
Converts the input date to a Gregorian output date with s
separators. s can be any character except a blank.
The output date field created by each valid TOJUL and TOGREG
combination is shown in Table 53 on page 287.
286
TOJUL=Yaa
TOJUL=Yaa(s)
TOGREG=Yaa
TOGREG=Yaa(s)
Y2T
Y2W
Y2U
Y2V
Y2X
Y2Y
Y4T
Y4W
Y4U
Y4V
Y4X
Y4Y
C'yyddd'
C'dddyy'
P'yyddd'
n/a
P'dddyy'
n/a
C'ccyyddd'
C'dddccyy'
P'ccyyddd'
n/a
P'dddccyy'
n/a
C'yysddd'
C'dddsyy'
n/a
n/a
n/a
n/a
C'ccyysddd'
C'dddsccyy'
n/a
n/a
n/a
n/a
C'yymmdd'
C'mmddyy'
n/a
P'yymmdd'
n/a
P'mmddyy'
C'ccyymmdd'
C'mmddccyy'
n/a
P'ccyymmdd'
n/a
P'mmddccyy'
C'yysmmsdd'
C'mmsddsyy'
n/a
n/a
n/a
n/a
C'ccyysmmsdd'
C'mmsddsccyy'
n/a
n/a
n/a
n/a
Sample Syntax:
* Convert a Pdddyy input date to a Cccyy/mm/dd output date
OUTFIL BUILD=(21,3,Y2X,TOGREG=Y4T(/),X,
* Convert a Cccyymmdd input date to a Pccyyddd output date
42,8,Y4T,TOJUL=Y4U,X,
* Convert a Cmmddyy input date to a Cyymmdd output date
11,6,Y2W,TOGREG=Y2T)
p,m,Yxx,WEEKDAY={CHAR3|CHAR9|DIGIT1}
Converts an input date field to a corresponding output day of
the week in one of several forms.
Each type of input date field you can use is shown in Table 52
on page 286. The different types of output you can display are
shown in Table 54.
Table 54. Output for weekdays
Day
CHAR3
CHAR9
DIGIT1
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
CSUN
CMON
CTUE
CWED
CTHU
CFRI
CSAT
CSUNDAY
CMONDAY
CTUESDAY
CWEDNESDAY
CTHURSDAY
CFRIDAY
CSATURDAY
C1
C2
C3
C4
C5
C6
C7
Sample Syntax:
* Convert a Pmmddccyy input date to a 3-character weekday
OUTFIL BUILD=(5:15,5,Y4Y,WEEKDAY=CHAR3,
* Convert a Cyyddd input date to a 1-digit weekday
18:27,5,Y2T,WEEKDAY=DIGIT1,
* Convert a Pdddccyy input date to a 9-character weekday
41:121,4,Y4X,WEEKDAY=CHAR9)
p,m,Yxx,DT=(abcd) or p,m,Yxx,DTNS=(abc)
Converts an input date field of one type to a corresponding
Gregorian output date field of another type.
Each type of input date field you can use is shown in Table 52
on page 286.
DT=(abcd) creates an output date in the form C'adbdc', where
a, b, and c indicate the order in which the month, day, and
year are to appear and whether the year is to appear as two or
four digits, and d is the character to be used to separate the
Chapter 3. Using DFSORT program control statements
287
p,m,Yxx,WEEKNUM={USA|ISO}
Converts an input date field to a corresponding 2 byte output
number of the week in 2 different forms.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Each type of input date field you can use is shown in Table 52
on page 286. The different types of output you can display are
shown in Table 55.
Input - Date
WEEKNUM=USA
WEEKNUM=ISO
2000-01-01
01
52
2000-01-02
02
52
2000-01-03
02
01
2000-12-31
54
52
2014-01-02
01
01
2014-06-09
24
24
|
|
2014-12-31
53
01
Sample Syntax:
288
|
|
|
|
|
p,m,Yxx,AGE={YMD|YM|YD}
Can be used to calculate the date duration that specifies the
number of years, months, and days between a given date and
the current date. The Input date cannot be greater than the
current date.
|
|
|
|
|
|
|
|
|
|
For example, if the input birth date is March 12th 2015 and the
current date is September 30th 2015 then Age=YMD will
produce a duration of 00000618 (0000 years, 06 months, and 18
days).
|
|
|
|
|
|
|
|
|
|
Sample Syntax: If the input birth date is March 12th 2015 and
the current date is September 30th 2015 then Age=YMD will
produce a duration of 00000618 (0000 years, 06 months, and 18
days).
* Calculate the date duration of a Cccyyddd input date to
* current date as years, months and days
OUTFIL BUILD=(15:1,7,Y4T,AGE=YMD,
* Calculate the date duration of a Pyymmdd input date to
* current date as years and days
55:27,4,Y2V,AGE=YD)
289
v DATEDIFF can be used to calculate the number of days between two date
fields. As a simple example, you could use the following to calculate the
difference in days between two C'ccyymmdd' dates:
41,8,Y4T,DATEDIFF,31,8,Y4T
v NEXTDday can be used to calculate the next specified day for a date field.
As a simple example, you could use the following to calculate the next
Friday for a C'ccyyddd' date as a C'ccyy.ddd' date:
3,7,Y4T,NEXTDFRI,TOJUL=Y4T(.)
v PREVDday can be used to calculate the previous specified day for a date
field. As a simple example, you could use the following to calculate the
previous Wednesday for a P'yyddd' date as a C'ccyymmdd' date:
51,3,Y2U,PREVDWED,TOGREG=Y4T
290
%nn,Y2x,dateop or %nn,Y4x,dateop
Specifies an arithmetic operation for a parsed input date field.
Adding or Subtracting Days, Months or Years
p,m
%nn
,Y2x
,Y4x
ADDDAYS
ADDMONS
ADDYEARS
SUBDAYS
SUBMONS
SUBYEARS
p,m,f
deccon
TOJUL=Yaa
TOJUL=Yaa(s)
TOGREG=Yaa
TOGREG=Yaa(s)
p,m,Yxx,keyword,numeric,todate
Can be used to add n days, months or years to an input date field, or subtract
n days, months or years from an input date field. The valid keywords are
ADDDAYS, ADDMONS, ADDYEARS, SUBDAYS, SUBMONS and SUBYEARS.
The numeric value specifies the number of days, months or years to be added
to or subtracted from the input date field. The resulting output date field is
converted to the form indicated by todate.
p,m,Yxx specifies the starting position (p), length (m) and format (Yxx) of a
2-digit or 4-digit year input date field. The valid length and format for each
type of date field you can use is shown in Table 56.
Table 56. p,m,Yxx fields for date arithmetic
m,Yxx
Type of date
5,Y2T
6,Y2T
7,Y4T
8,Y4T
5,Y2W
6,Y2W
7,Y4W
8,Y4W
3,Y2U
4,Y2V
4,Y4U
5,Y4V
3,Y2X
4,Y2Y
4,Y4X
5,Y4Y
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
C'ccyyddd' or Z'ccyyddd'
C'ccyymmdd' or Z'ccyymmdd'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
C'dddccyy' or Z'dddccyy'
C'mmddccyy' or Z'mmddccyy'
P'yyddd'
P'yymmdd'
P'ccyyddd'
P'ccyymmdd'
P'dddyy'
P'mmddyy'
P'dddccyy'
P'mmddccyy'
291
p,m
%nn
,Y2x
,Y4x
DATEDIFF p,m
,Y2x
,Y4x
p,m,Yxx,DATEDIFF,p,m,Yxx
Can be used to calculate the number of days difference between two input
date fields. The result is an 8-byte value consisting of a sign and 7 digits
(sddddddd). If the first date is greater than or equal to the second date, the
sign is + (plus). If the first date is less than the second date, the sign is (minus).
p,m,Yxx specifies the starting position (p), length (m) and format (Yxx) of a
2-digit or 4-digit year input date field. The valid length and format for each
type of date field you can use is shown in Table 56 on page 291.
DATEDIFF calculates the number of days that result when the second date is
subtracted from the first date. The result is in the form sddddddd with + or for s as appropriate and leading zeros. The result can be between -3652058 and
+3652058 days.
292
p,m
%nn
,Y2x
,Y4x
NEXTDday
PREVDday
LASTDAYx
TOJUL=Yaa
TOJUL=Yaa(s)
TOGREG=Yaa
TOGREG=Yaa(s)
p,m,Yxx,keyword,todate
Can be used to specify the next specified day, previous specified day, or last
day of the week, month, quarter or year for an input date. The valid keywords
are NEXTDday, PREVDday or LASTDAYx (where day can be SUN, MON,
TUE, WED, THU, FRI or SAT and x can be W, M, Q or Y).
The result is an output date field which is converted to the form indicated by
todate.
p,m,Yxx specifies the starting position (p), length (m) and format (Yxx) of a
2-digit or 4-digit year input date field. The valid length and format for each
type of date field you can use is shown in Table 56 on page 291.
NEXTDSUN calculates the next Sunday for a date field.
NEXTDMON calculates the next Monday for a date field.
NEXTDTUE calculates the next Tuesday for a date field.
NEXTDWED calculates the next Wednesday for a date field.
NEXTDTHU calculates the next Thursday for a date field.
NEXTDFRI calculates the next Friday for a date field.
NEXTDSAT calculates the next Saturday for a date field.
PREVDSUN calculates the previous Sunday for a date field.
PREVDMON calculates the previous Monday for a date field.
PREVDTUE calculates the previous Tuesday for a date field.
PREVDWED calculates the previous Wednesday for a date field
PREVDTHU calculates the previous Thursday for a date field.
PREVDFRI calculates the previous Friday for a date field.
PREVDSAT calculates the previous Saturday for a date
LASTDAYW calculates the last day of the week (Friday) for a date field.
LASTDAYM calculates the last day of the month for a date field.
LASTDAYQ calculates the last day of the quarter for a date field.
LASTDAYY calculates the last day of the year for a date field.
TOJUL and TOGREG
See TOJUL and TOGREG under "p,m,Y2x,todate or p,m,Y4x,todate" for
details.
293
294
Y2x(s) or Y4x(s)
Specifies the Y2 or Y4 format for the date field and the separator
character(s). See Appendix C, Data format descriptions, on page 891
for detailed format descriptions.
Sample Syntax:
* Convert a Zdddccyy date to a Cddd/ccyy date.
OUTFIL BUILD=(19,7,Y4W(/),X,
* Convert a Pccyymmdd date to a Cccyy-mm-dd date.
43,5,Y4V(-))
Table 57 shows the output produced for each type of edited date.
Table 57. Input and result fields for Yxx(s) date editing
m,Yxx
Input date
3,Y2T(s)
4,Y2T(s)
5,Y2T(s)
6,Y2T(s)
7,Y4T(s)
8,Y4T(s)
2,Y2U(s)
3,Y2V(s)
3,Y2U(s)
4,Y2V(s)
4,Y4U(s)
5,Y4V(s)
3,Y2W(s)
4,Y2W(s)
5,Y2W(s)
6,Y2W(s)
7,Y4W(s)
8,Y4W(s)
2,Y2X(s)
3,Y2Y(s)
3,Y2X(s)
4,Y2Y(s)
4,Y4X(s)
5,Y4Y(s)
C'yyx' or Z'yyx'
C'yyxx' or Z'yyxx'
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
C'ccyyddd' or Z'ccyyddd'
C'ccyymmdd' or Z'ccyymmdd'
P'yyx'
P'yyxx'
P'yyddd'
P'yymmdd'
P'ccyyddd'
P'ccyymmdd'
C'xyy' or Z'xyy'
C'xxyy' or Z'xxyy'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
C'dddccyy' or Z'dddccyy'
C'mmddccyy' or Z'mmddccyy'
P'xyy'
P'xxyy'
P'dddyy'
P'mmddyy'
P'dddccyy'
P'mmddccyy'
C'ccyysx'
C'ccyysxx'
C'ccyysddd'
C'ccyysmmsdd'
C'ccyysddd'
C'ccyysmmsdd'
C'ccyysx'
C'ccyysxx'
C'ccyysddd'
C'ccyysmmsdd'
C'ccyysddd'
C'ccyysmmsdd'
C'xsccyy'
C'xxsccyy'
C'dddsccyy'
C'mmsddsccyy'
C'dddsccyy'
C'mmsddsccyy'
C'xsccyy'
C'xxsccyy'
C'dddsccyy'
C'mmsddsccyy'
C'dddsccyy'
C'mmsddsccyy'
%nn,Y2x(s) or %nn,Y4x(s)
Specifies that a parsed input date field is to be edited with separators. See
PARSE for details of parsed fields. See "p,m,Y2x(s) or p,m,Y4x(s)" for further
details.
p,m,Y2xP
Specifies that an input date field is to be converted to a packed decimal output
date field. Real Y2x dates are edited using the century window established by
the Y2PAST option in effect. Y2x and Y4x dates with special indicators are
expanded appropriately (for example, p,6,Y2TP transforms C'000000' to
P'00000000').
Editing involving an input date with an invalid digit (A-F) can result in a data
exception (0C7 ABEND) or an incorrect output value. Editing involving an
invalid input date can result in an invalid output value.
p
295
Y2xP
Specifies the Y2 format for the date field. See Appendix C, Data
format descriptions, on page 891 for detailed format descriptions.
Sample Syntax:
OUTFIL BUILD=(11,3,Y2XP,X,21,4,Y2WP)
Input date
3,Y2TP
4,Y2TP
5,Y2TP
6,Y2TP
2,Y2UP
3,Y2VP
3,Y2UP
4,Y2VP
3,Y2WP
4,Y2WP
5,Y2WP
6,Y2WP
2,Y2XP
3,Y2YP
3,Y2XP
4,Y2YP
2,Y2PP
1,Y2DP
C'yyx' or Z'yyx'
C'yyxx' or Z'yyxx'
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
P'yyx'
P'yyxx'
P'yyddd'
P'yymmdd'
C'xyy' or Z'xyy'
C'xxyy' or Z'xxyy'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
P'xyy'
P'xxyy'
P'dddyy'
P'mmddyy'
P'yy'
X'yy'
P'ccyyx'
P'ccyyxx'
P'ccyyddd'
P'ccyymmdd'
P'ccyyx'
P'ccyyxx'
C'ccyyddd'
C'ccyymmdd'
C'xccyy'
C'xxccyy'
C'dddccyy'
C'mmddccyy'
C'xccyy'
C'xxccyy'
C'dddccyy'
C'mmddccyy'
C'ccyy'
C'ccyy'
%nn,Y2xP
Specifies that a parsed input date field is to be converted to a packed decimal
output date field. See PARSE for details of parsed fields. See "p,m,Y2xP" for
further details
p,m,lookup or %nn,lookup
specifies that a character constant, hexadecimal constant, input field (p,m), or
parsed input field (%nn) from a lookup table is to appear in the reformatted
OUTFIL output record. You can use p,m,lookup or %nn,lookup to select a
specified set constant (that is, a character or hexadecimal string) or set field
(that is, an input field or parsed input field) based on matching an input value
against find constants (that is, character, hexadecimal, or bit constants).
p
specifies the length in bytes of the input field to be compared to the find
constants. The value for m must be 1 to 64 if character or hexadecimal find
constants are used, or 1 if bit find constants are used.
%nn
specifies a parsed input field to be compared to the find constants. See
PARSE for details of parsed fields.
lookup
Specifies how the input field or parsed input field is to be changed to the
output field, using a lookup table.
CHANGE
296
,NOMATCH=(set)
find
specifies a find constant to be compared to the input field value or parsed
input field value. If the input field value or parsed input field value
matches the find constant, the corresponding set constant or set field is
used for the output field.
The find constants can be either character string constants, hexadecimal
string constants, or bit constants:
v Character string constants (C'xx...x') and hexadecimal string constants
(X'yy...yy') can be 1 to m bytes and can be intermixed with each other,
but not with bit constants. See INCLUDE control statement on page 96
for details of coding character and hexadecimal string constants.
If the string is less than m bytes, it will be padded on the right to a
length of m bytes, using blanks (X'40') for a character string constant or
zeros (X'00') for a hexadecimal string constant.
v Bit constants (B'bbbbbbbb') must be 1 byte and cannot be intermixed
with character or string constants. See INCLUDE control statement on
page 96 for details of coding bit constants.
For bit constants, because of the specification of bits to be ignored, more
than one find constant can match an input field value; the set constant
for the first match found will be used as the output field. For example, if
you specify:
OUTFIL OUTREC=(5,1,
CHANGE=(1,B11......,CA,B1.......,CB))
input field value X'C0' (B'11000000') matches both bit constants, but C'A'
will be used for the set constant, because its find constant is the first
match.
set
specifies a set constant or set field to be used as the output field if the
corresponding find constant matches the input field value or parsed input
field value. Set constants and set fields can be intermixed.
Set constants can be either character string constants (C'xx...x') or
hexadecimal string constants (X'yy...yy') of 1 to v bytes. See INCLUDE
control statement on page 96 for details of coding character and
hexadecimal string constants.
If the string is less than v bytes, it will be padded on the right to a length
of v bytes, using blanks (X'40') for a character string constant or zeros
(X'00') for a hexadecimal string constant.
Set fields are specified as q,n or %nn. q specifies the input position. See p
under p,m,a for details of coding q. n specifies the input length of 1 to v
Chapter 3. Using DFSORT program control statements
297
p,m,justify
specifies that a left-justified or right-justified input field is to appear in the
reformatted OUTFIL output record. For a left-justified field, leading blanks are
removed and the characters from the first nonblank to the last nonblank are
shifted left, with blanks inserted on the right if needed. For a right-justified
field, trailing blanks are removed and the characters from the last nonblank to
the first nonblank are shifted right, with blanks inserted on the left if needed.
Optionally:
v specific leading and trailing characters can be changed to blanks before
justification begins
v a leading string can be inserted
v a trailing string can be inserted
298
justify
specifies how the input field is to be justified for output.
JFY
,
JFY=
(
SHIFT=LEFT
SHIFT=RIGHT
LENGTH=n
PREBLANK=list
LEAD=string
TRAIL=string
299
If we specify:
1,19,JFY=(SHIFT=LEFT,PREBLANK=C*)
each leading or trailing asterisk is changed to a blank before leftjustify processing begins. So the output field is:
<*ABbCD*bEF>bbbbbbb
If we specify:
1,19,JFY=(SHIFT=RIGHT,PREBLANK=C*<>)
each leading or trailing asterisk, less than sign and greater than sign is
changed to a blank before right-justify processing begins. So the output
field is:
bbbbbbbbbbABbCD*bEF
LEAD=string
specifies a string to be inserted in the output field before the first
nonblank character in the input field.
string can be 1 to 50 characters specified using a character string
constant (C'xx...x') or a hexadecimal string constant (X'yy...yy'). See
INCLUDE control statement on page 96 for details of coding
character and hexadecimal string constants.
For example, let's say we have an input field of:
300
If we specify:
1,11,JFY=(SHIFT=RIGHT,LEAD=CXYZ)
If we specify:
1,5,JFY=(SHIFT=LEFT,LEAD=CXYZ)
Since the output field length is defaulted to the input field length of 5,
the resulting 8 characters (XYZAbBbC) are truncated on the right to 5
characters (XYZAb) for output. If we instead specify:
1,5,JFY=(SHIFT=LEFT,LEAD=CXYZ,LENGTH=8)
If we specify:
1,11,JFY=(SHIFT=LEFT,TRAIL=CXYZ)
If we specify:
1,5,JFY=(SHIFT=RIGHT,TRAIL=CXYZ)
301
Since the output field length is defaulted to the input field length of 5,
the resulting 8 characters (AbBbCXYZ) are truncated on the left to 5
characters (bCXYZ) for output. If we instead specify:
1,5,JFY=(SHIFT=RIGHT,TRAIL=CXYZ,LENGTH=8)
%nn,justify
specifies that a left-justified or right-justified parsed input field is to appear in
the reformatted OUTFIL output record. See PARSE for details of parsed fields.
See p,m,justify for further details.
p,m,squeeze
specifies that a left-squeezed or right-squeezed input field is to appear in the
reformatted OUTFIL output record. For a left-squeezed field, all blanks are
removed and the characters from the first nonblank to the last nonblank are
shifted left, with blanks inserted on the right if needed. For a right-squeezed
field, all blanks are removed and the characters from the last nonblank to the
first nonblank are shifted right, with blanks inserted on the left if needed.
Optionally:
v specific characters can be changed to blanks before squeezing begins
v a leading string can be inserted
v a trailing string can be inserted
v a string (for example, a comma delimiter) can be inserted wherever a group
of blanks is removed between the first nonblank and the last nonblank
v blanks can be kept as is between paired apostrophes ('AB CD EF') or paired
quotes ("AB CD EF")
v the output length can be changed (it is equal to the input length by default)
p
squeeze
Specifies how the input field is to be squeezed for output.
SQZ
302
(
SHIFT=LEFT
SHIFT=RIGHT
LENGTH=n
PREBLANK=list
LEAD=string
MID=string
TRAIL=string
PAIR=APOST
PAIR=QUOTE
303
If we specify:
1,21,SQZ=(SHIFT=LEFT,PREBLANK=C*,LENGTH=12)
If we specify:
1,21,SQZ=(SHIFT=RIGHT,PREBLANK=C*<>)
each asterisk, less than sign and greater than sign is changed to a
blank before right-squeeze processing begins. The output field is:
bbbbbbbbbbbbbbbABCDEF
LEAD=string
specifies a string to be inserted in the output field before the first
nonblank character in the input field.
string can be 1 to 50 characters specified using a character string
constant (C'xx...x') or a hexadecimal string constant (X'yy...yy'). See
INCLUDE control statement on page 96 for details of coding
character and hexadecimal string constants.
For example, let's say we have an input field of:
bABCbEbbbbb
If we specify:
1,11,SQZ=(SHIFT=RIGHT,LEAD=CXYZ)
304
If we specify:
1,12,SQZ=(SHIFT=LEFT,MID=C,)
If we specify:
1,5,SQZ=(SHIFT=LEFT,MID=CXY)
Since the output field length is defaulted to the input field length of 5,
the resulting 7 characters (AXYBXYC) are truncated on the right to 5
characters (AXYBX) for output. If we instead specify:
1,5,SQZ=(SHIFT=LEFT,MID=CXY,LENGTH=7)
If we specify:
1,11,SQZ=(SHIFT=LEFT,LEAD=X7D,TRAIL=X7D)
305
If we specify:
1,25,SQZ=(SHIFT=LEFT,PREBLANK=C*,MID=C,)
all of the blanks and asterisks, including those inside the apostrophe
pairs, are squeezed out. The output field is:
AB,,C,D,E,bbbbbbbbb
However, if we specify:
1,25,SQZ=(SHIFT=LEFT,PREBLANK=C*,MID=C,,
PAIR=APOST)
only the blanks and asterisks outside of the apostrophe pairs are
squeezed out. The output field is:
ABbb**C,D*Ebbbbbbbb
If we specify:
1,15,SQZ=(SHIFT=LEFT,PAIR=APOST)
If we specify:
306
PAIR=QUOTE
specifies that blanks and PREBLANK characters between quote (")
pairs are to be kept as is. Use PAIR=QUOTE when you have literals
that should not be squeezed.
For example, let's say we have an input field of:
b*b"ABbb*""*C"bbb"D*Ebb"*
If we specify:
1,25,SQZ=(SHIFT=LEFT,PREBLANK=C*,MID=C,)
all of the blanks and asterisks, including those inside the quote pairs,
are squeezed out. The output field is:
"AB,"",C","D,E,"bbbbbbbbb
However, if we specify:
1,25,SQZ=(SHIFT=LEFT,PREBLANK=C*,MID=C,,
PAIR=QUOTE)
only the blanks and asterisks outside of the quote pairs are squeezed
out. The output field is:
"ABbb*""*C","D*Ebbbbbbbb
If we specify:
1,15,SQZ=(SHIFT=LEFT,PAIR=QUOTE)
there's an unpaired quote, so all of the characters from the quote to the
end of the input field are ignored. The output field is:
XY"ABCbbbDbbbbb
If we specify:
1,15,SQZ=(SHIFT=RIGHT,PAIR=QUOTE)
Chapter 3. Using DFSORT program control statements
307
Sample Syntax:
OUTFIL BUILD=(5:16,20,SQZ=(SHIFT=LEFT,PAIR=QUOTE,PREBLANK=C<>))
%nn,squeeze
specifies that a left-squeezed or right-squeezed parsed input field is to appear
in the reformatted OUTFIL output record. See PARSE for details of parsed
fields. See p,m,squeeze for further details.
seqnum
SEQNUM,n,fs
,START=j
,INCR=i
,RESTART=(p,m)
,RESTART=(%nn)
specifies the length of the sequence number. The value for n must be
between 1 and 16.
fs specifies the format for the sequence number, which can be BI, PD, ZD,
CSF, or FS.
For a ZD format sequence number, F is used as the sign.
For a PD format sequence number, C is used as the sign.
For a CSF or FS format sequence number, blank is used as the sign and
leading zeros are suppressed.
For a PD, ZD, CSF, or FS format sequence number, the maximum value
DFSORT can create is limited to the lesser of 15 decimal digits or the
output field length (n). If a sequence number overflows this limit, it will be
truncated to the lesser of 15 decimal digits or the output field length, and
then subsequently incremented as usual.
For a BI format sequence number, the maximum value DFSORT can create
is limited to the lesser of 8 bytes of ones (X'FFFFFFFFFFFFFFFF') or the
number of ones that will fit in the specified output field length (n). If a
sequence number overflows this limit, it will be truncated to the lesser of 8
bytes or the output field length, and then subsequently incremented as
usual.
START
specifies the starting value for the sequence number.
j
specifies the starting value. The value for j must be between 0 and
100000000000. The default for j is 1.
INCR
specifies the increment value for the sequence number.
i
308
specifies the increment value. The value for i must be between 1 and
10000000. The default for i is 1.
specifies the length in bytes of the input field. The value for m
must be between 1 and 256.
%nn
specifies the parsed input field. See PARSE for details of
parsed fields.
Sample Syntax:
OUTFIL FNAMES=O1,OUTREC=(SEQNUM,6,ZD,START=1000,INCR=50,
X,22,8,X,13,5)
OUTFIL FNAMES=O2,OUTREC=(1,12,SEQNUM,4,BI)
OUTFIL FNAMES=O3,OUTREC=(1,80,81:SEQNUM,8,ZD,START=21,INCR=20,
RESTART=(35,8))
309
s
p,m
,a
%nn
p,m
%nn
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
310
and input position 5 has 'A'. The second item (UTOL) would change 'A' to 'a'
and the third item (CHANGE) would change 'a' again to 'X'.
If you specify an OVERLAY item that extends the overlay record beyond the
end of the input record, the reformatted record length is automatically
increased to that length, and blanks are filled in on the left as needed. For
variable-length records, the RDW length is increased to correspond to the
larger reformatted record length after all of the OVERLAY items are processed.
For example, if your OUTFIL input record has a length of 40 and you specify:
OUTFIL OVERLAY=(16:CABC,51:5C*,35:15,2)
the OUTFIL output record is given a length of 55. Blanks are filled in from
columns 41-50. For variable-length records, the length in the RDW is changed
from 40 to 55 after all of the OVERLAY items are processed.
Missing bytes in specified input fields are replaced with blanks so the padded
fields can be processed.
You can use the OVERLAY parameter with the FTOV parameter to convert
fixed-length record data sets to variable-length record data sets.
You can use the VLTRIM parameter with the OVERLAY parameter to remove
specified trailing bytes from the end of variable-length records.
You can use the VLTRAIL parameter with the OVERLAY parameter to insert a
string at the end of variable-length records.
You can use the OVERLAY parameter with any or all of the report parameters
in the same way as for the BUILD or OUTREC parameter.
The OVERLAY parameter of the OUTREC statement applies to all input
records whereas the OVERLAY parameter of the OUTFIL statement only
applies to the OUTFIL input records for its OUTFIL group.
See OUTFIL OUTREC for details of the items listed in the OVERLAY syntax
diagram shown previously in this section. You can specify all of the items for
OVERLAY in the same way that you can specify them for BUILD or OUTREC
with the following exceptions:
v You cannot specify p or p,HEX or p,TRAN=keyword for OVERLAY.
v You cannot specify / for OVERLAY.
v For p,m,H or p,m,F or or p,m,D fields specified for OVERLAY, fields are
aligned as necessary without changing the preceding bytes.
v For variable-length records, you must not overlay positions 1-4 (the RDW)
for OVERLAY, so be sure to specify the first column (c:) as 5 or greater. Do
not specify 1:, 2:, 3: or 4: anywhere in your OVERLAY parameter. If you do
not specify the first column, it will default to 1: which is invalid for
variable-length records with OVERLAY. Whereas OUTREC=(1,m,...) is
required, OVERLAY=(1,m) is not allowed since it would overlay the RDW.
Chapter 3. Using DFSORT program control statements
311
IN=incon,OUT=outcon
,
IN=( incon
,
,OUT=outcon
INOUT=( incon,outcon
)
,
STARTPOS=p
ENDPOS=q
DO=n
MAXLEN=n
OVERRUN=ERROR
OVERRUN=TRUNC
SHIFT=YES
SHIFT=NO
You can use FINDREP to find constants anywhere in a record and replace
them with other constants of the same or different lengths. You can find
character or hexadecimal input constants anywhere in your records and replace
them with character, hexadecimal or null output constants. As appropriate,
bytes can be shifted left or right, blank padding can be added for fixed-length
records, and the length can be changed for variable-length records.
Various options of FINDREP allow you to define one or more input constants
and a corresponding output constant, define one or more pairs of input and
output constants, start and end the find scan at specified positions, stop after a
specified number of constants are replaced, increase or decrease the length of
the output record, define the action to be taken if nonblank characters overrun
the end of the record, and specify whether output constants are to replace or
overlay input constants.
You can use the FINDREP parameter with the FTOV parameter to convert
fixed-length record data sets to variable-length record data sets.
You can use the VLTRIM parameter with the FINDREP parameter to remove
specified trailing bytes from the end of variable-length records.
You can use the VLTRAIL parameter with the FINDREP parameter to insert a
string at the end of variable-length records.
You can use the FINDREP parameter with any or all of the report parameters
in the same way as for the BUILD or OUTREC parameter.
312
313
Removes every X'FF' and X'000000' input constant, and shifts the bytes
after each removed constant to the left.
INOUT=(incon1,outcon1,incon2,outcon2,...,inconx,outconx)
Specifies one or more pairs of input and output constants. Position 1
(for fixed-length records) or 5 (for variable-length records) will be set
as the current position. The current position of the input record will be
checked for each input constant in turn until a match is found or all of
the input constants have been checked. If a match is not found at the
current position for any input constant, the current position will be
incremented by 1, and the process will be repeated. If a match is found
at the current position for an input constant, the corresponding output
constant will replace the input constant, the current position will be
incremented past the input constant, and the process will be repeated.
Bytes after the replaced constants up to the end of the record will be
shifted left or right as needed. Processing will stop when the current
position is beyond the end of the input record.
Example:
OUTFIL FINDREP=(INOUT=(CSAT,CSATURDAY,CSUN,CSUNDAY))
314
Replaces every C'D27', C'A52' and C'X31' input constant found before
or at position 2015 with a C'INVALID' output constant, and shifts the
bytes after each replaced constant to the right (past 2015 up to the end
of the record).
DO=n Specifies the maximum number of times find and replace is to be
performed for a record, overriding the default of every time. Scanning
for the input constant stops when n input constants have been found
and replaced. Use DO=n if you want to stop after a particular number
of constants have been replaced. n can be 1 to 1000.
Example:
OUTFIL FNAMES=OUT1,FINDREP=(IN=X015C,OUT=X015D,DO=3)
Replaces the first three X'015C' input constants found with X'015D'
output constants.
MAXLEN=n
Specifies the maximum length to be used for the output record created
by find and replace processing, overriding the default of using the
maximum length of the input record. Use MAXLEN=n if you want to
increase or decrease the output record length. (For IFTHEN FINDREP,
MAXLEN=n can only be used to increase the output record length, not
decrease it. See "Notes" later in this section for more information.)
If an output constant is larger than a corresponding input constant,
MAXLEN=n can be used to increase the size of the output record to
allow for shifting characters to the right. n can be 1 to 32752.
MAXLEN=n will be used to set the LRECL of the output data set,
when appropriate.
Example:
OUTFIL FINDREP=(INOUT=(C01,CJanuary,C02,CFebruary,
C03,CMarch),MAXLEN=150)
315
316
The first IFTHEN clause would change C'AB' to C'XY'. The second IFTHEN
clause would start over from the first position and change C'XYC' to C'RST'.
v Duplicates and supersets of the same input constant after the first are
effectively ignored, whereas subsets of the same input constant after the first
are processed. For example, if you had this input record:
ABCD ABQ
an overrun will not occur because IFTHEN FINDREP will operate against an
80-byte record padded with 77 blanks on the right, rather than against a
3-byte record even though the output record will be 3 bytes.
v For FINDREP in an IFTHEN clause, MAXLEN=n can be used to increase the
maximum output length, but cannot be used to decrease the maximum
output length. For example, with:
OUTFIL IFTHEN=(WHEN=INIT,BUILD=(1,100)),
IFTHEN=(WHEN=INIT,
FINDREP=(IN=CA,OUT=CB,MAXLEN=150))
317
IFTHEN=(
WHEN=INIT
,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
WHEN=GROUP ,BEGIN=(logexp) ,PUSH=(items)
,KEYBEGIN=(p,m)
,END=(logexp)
,RECORDS=n
WHEN=(logexp) ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=ANY ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=NONE ,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
318
319
The WHEN=INIT clause adds 1 to the ZD value and stores it in the IFTHEN
record. The WHEN=(8,4,ZD,EQ,+27) clause tests the incremented ZD value in
the IFTHEN record rather than the original ZD value in the input record.
The IFTHEN record is adjusted as needed for the records created or changed
by the IFTHEN clauses. For fixed-length records, blanks are filled in on the left
as needed. For variable-length records, the RDW length is adjusted as needed
each time the IFTHEN record is changed.
Missing bytes in specified input fields are replaced with blanks so the padded
fields can be processed.
DFSORT sets an appropriate LRECL for the OUTFIL output records based on
the build, overlay, find/replace and group operation items specified by the
IFTHEN clauses. However, DFSORT does not analyze the possible results of
WHEN=(logexp) conditions when determining an appropriate LRECL. When
you use OUTFIL IFTHEN clauses, you can override the OUTFIL LRECL
determined by DFSORT with the OUTFIL IFOUTLEN parameter.
If SEQNUM is used in multiple IFTHEN clauses, the sequence number will be
incremented for each record that satisfies the IFTHEN clause, that is, a separate
SEQNUM counter will be kept for each IFTHEN clause. For example, if your
input is:
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
320
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
0001
0001
0002
0001
0002
0002
0003
0003
BUILD=(items)
Specifies the build items to be applied to each record. See OUTFIL
BUILD for details. You can specify all of the items in the same way
that you can specify them for OUTFIL BUILD, except that you cannot
specify / to create blank records or new records.
OVERLAY=(items)
Specifies the overlay items to be applied to each record. See OUTFIL
OVERLAY for details. You can specify all of the items in the same way
that you can specify them for OUTFIL OVERLAY.
Sample Syntax:
321
FINDREP=(items)
Specifies find and replace operations to be applied to each record. See
OUTFIL FINDREP for details. You can specify all of the items in the
same way that you can specify them for OUTFIL FINDREP.
Sample Syntax
OUTFIL FNAMES=OUT2,
IFTHEN=(WHEN=INIT,FINDREP=(IN=X00,OUT=X40)),
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD))
WHEN=GROUP clause
Identifies groups of records in various ways and propagates fields,
identifiers and sequence numbers to the records of each group. Fields,
identifiers and sequence numbers are not propagated to records before,
between or after identified groups. Multiple WHEN=INIT clauses and
WHEN=GROUP clauses may be intermixed. They are processed before any
other type of IFTHEN clauses and in the order in which they are specified.
You can specify the BEGIN, KEYBEGIN, END and RECORDS operands in
any combination to define the groups, but you must specify at least one of
these operands.
BEGIN=(logexp)
Specifies the criteria to be tested to determine if a record starts a
group. See the INCLUDE statement for details of the logical
expressions you can use. You can specify all of the logical expressions
in the same way that you can specify them for the INCLUDE
statement except that:
v You cannot specify FORMAT=f with BEGIN=(logexp).
v You cannot specify D2 format in BEGIN=(logexp).
v Locale processing is not used for BEGIN=(logexp).
v VLSCMP and VLSHRT are not used with BEGIN=(logexp). Instead,
missing bytes in specified input fields are replaced with blanks so
the padded fields can be processed.
A new group starts with a record that satisfies the BEGIN condition,
that is, when the specified logical expression is true for that record. If
BEGIN is specified without END or RECORDS, all of the records from
the begin record up to but not including the next begin record belong
to a group. Here's an example of groups with
BEGIN=(1,1,CH,EQ,CA):
H
R
A
B
C
A
A
B
group
group
group
group
group
group
1
1
1
2
3
3
Example:
OUTFIL IFTHEN=(WHEN=GROUP,
BEGIN=(1,40,SS,EQ,CJ82,OR,1,40,SS,EQ,CM72),
PUSH=(41:ID=5))
322
group
group
group
group
group
group
1
1
1
2
2
3
Example:
OUTFIL IFTHEN=(WHEN=GROUP,
KEYBEGIN=(11,5),PUSH=(81:21,8))
Starts a new group each time the value in positions 11-15 changes.
Overlays positions 81-88 of each record of a group with positions 21-28
from the first record of that group.
END=(logexp)
Specifies the criteria to be tested to determine if a record ends a group.
See the INCLUDE statement for details of the logical expressions you
can use. You can specify all of the logical expressions in the same way
that you can specify them for the INCLUDE statement except that:
v You cannot specify FORMAT=f with END=(logexp).
v You cannot specify D2 format in END=(logexp).
v Locale processing is not used for END=(logexp).
v VLSCMP and VLSHRT are not used with END=(logexp). Instead,
missing bytes in specified input fields are replaced with blanks so
the padded fields can be processed.
A group ends whenever a record satisfies the END condition, that is,
whenever the specified logical expression is true for that record. If
END is specified without BEGIN or KEYBEGIN, all of the records up
to the end record (or the last record of the data set) belong to a group.
Here's an example of groups with
END=(1,1,CH,EQ,CT)
A group 1
B group 1
T group 1
Chapter 3. Using DFSORT program control statements
323
group
group
group
group
2
3
3
4
group 1
group 1
group 1
group 2
group 2
group 3
group 3
Example:
OUTFIL IFTHEN=(WHEN=GROUP,
BEGIN=(1,2,CH,EQ,C02,AND,8,3,CH,EQ,CYES),
END=(11,5,CH,EQ,CPAGE:),PUSH=(61:SEQ=3))
Starts a new group each time C'02' is found in positions 1-2 and C'YES'
is found in positions 8-10 of a record. Ends the group when C'PAGE:'
is found in positions 11-15 of a record. Overlays positions 61-63 of each
record of a group with a 3-byte ZD sequence number. The records
between the groups are not changed.
RECORDS=n
Specifies the maximum number of records in a group. n can be 1 to
2000000000. If RECORDS is specified without BEGIN, KEYBEGIN or
END, a new group starts after n records. Here's an example of groups
with
RECORDS=3
H
B
T
H
B
T
M
N
group
group
group
group
group
group
group
group
1
1
1
2
2
2
3
3
324
group 1
group 1
group 1
group
group
group
group
group
2
2
3
3
3
group 1
group 1
group 1
group
group
group
group
2
2
2
2
group 3
group 3
325
WHEN=(logexp) clause
Specifies build, overlay or find/replace items to be applied to records for
which the specified logical expression is true. If multiple WHEN=(logexp)
clauses are specified, they are processed in the order in which they are
specified.
WHEN=(logexp)
Identifies a WHEN=(logexp) clause and specifies the criteria to be
tested to determine if the build, overlay or find/replace items are to be
applied to the record. See the INCLUDE statement for details of the
logical expressions you can use. You can specify all of the logical
expressions in the same way that you can specify them for the
INCLUDE statement except that:
v You cannot specify FORMAT=f with WHEN=(logexp).
v You cannot specify D2 format in WHEN=(logexp).
v Locale processing is not used for WHEN=(logexp).
v VLSCMP and VLSHRT are not used with WHEN=(logexp). Instead,
missing bytes in specified input fields are replaced with blanks so
the padded fields can be processed.
PARSE=(definitions)
Defines %nn fixed parsed fields into which variable position/length
fields are extracted for each record for which the logical expression is
true. See OUTFIL PARSE for details. You can only use the %nn parsed
fields defined in a WHEN=(logexp) clause in the BUILD or OVERLAY
operand of that WHEN=(logexp) clause.
Sample Syntax:
OUTFIL IFTHEN=(WHEN=(45,2,CH,EQ,CAL),
PARSE=(%01=(ENDBEFR=C,,FIXLEN=12),
%02=(FIXLEN=10)),
OVERLAY=(21:%02,51:%01))
BUILD=(items)
Specifies the build items to be applied to each record for which the
logical expression is true. See OUTFIL BUILD for details. You can
specify all of the items in the same way that you can specify them for
OUTFIL BUILD.
OVERLAY=(items)
Specifies the overlay items to be applied to each record for which the
logical expression is true. See OUTFIL OVERLAY for details. You can
specify all of the items in the same way that you can specify them for
OUTFIL OVERLAY.
FINDREP=(items)
Specifies find and replace operations to be applied to each record for
326
HIT=NEXT
Specifies that IFTHEN processing should continue even if the logical
expression is true. By default (if HIT=NEXT is not specified), IFTHEN
processing stops if the logical expression is true.
Sample Syntax:
OUTFIL FNAMES=OUT2,
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,LE,+2000),OVERLAY=(42:CType1 <= 2000),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X03),
BUILD=(1,21,42,13)),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,GT,+2000),OVERLAY=(42:CType1 > 2000 ),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X01),
BUILD=(1,25,42,13))
WHEN=ANY clause
Specifies build, overlay or find/replace items to be applied to records for
which the logical expression in any "preceding" WHEN=(logexp) clause is
true. For the first WHEN=ANY clause, the "preceding" WHEN=(logexp)
clauses are those before this WHEN=ANY clause. For the second or
subsequent WHEN=ANY clause, the "preceding" WHEN=(logexp) clauses
are those between the previous WHEN=ANY clause and this WHEN=ANY
clause. At least one WHEN=(logexp) clause must be specified before a
WHEN=ANY clause. A WHEN=ANY clause can be used without any
build, overlay or find/replace items to just stop IFTHEN processing if any
preceding WHEN=(logexp) clause is satisfied.
PARSE=(definitions)
Defines %nn fixed parsed fields into which variable position/length
fields are extracted for each record for which the logical expression in
any preceding WHEN=(logexp) clause is true. See OUTFIL PARSE for
details. You can only use the %nn parsed fields defined in a
WHEN=ANY clause in the BUILD or OVERLAY operand of that
WHEN=ANY clause.
BUILD=(items)
Specifies the build items to be applied to each record for which the
logical expression in any preceding WHEN=(logexp) clause is true. See
OUTFIL BUILD for details. You can specify all of the items in the same
way that you can specify them for OUTFIL BUILD.
OVERLAY=(items)
Specifies the overlay items to be applied to each record for which the
logical expression in any preceding WHEN=(logexp) clause is true. See
OUTFIL OVERLAY for details. You can specify all of the items in the
same way that you can specify them for OUTFIL OVERLAY.
FINDREP=(items)
Specifies find and replace operations to be applied to each record for
which the logical expression in any preceding WHEN=(logexp) clause
327
WHEN=NONE clause
Specifies build, overlay or find/replace items to be applied to records for
which none of the logical expressions in any WHEN=(logexp) clause is
true. If there are no WHEN=(logexp) clauses, the build, overlay or
find/replace items are applied to all of the records. If multiple
WHEN=NONE clauses are specified, they are processed in the order in
which they are specified. WHEN=NONE clauses are processed after any
other type of IFTHEN clauses.
PARSE=(definitions)
Defines %nn fixed parsed fields into which variable position/length
fields are extracted for each record for which no logical expression was
true. See OUTFIL PARSE for details. You can only use the %nn parsed
fields defined in a WHEN=NONE clause in the BUILD or OVERLAY
operand of that WHEN=NONE clause.
Sample Syntax:
OUTFIL IFTHEN=(WHEN=(5,2,ZD,GT,+5),
PARSE=(%01=(STARTAT=C<,ENDAT=C>,FIXLEN=12),
%02=(STARTAFT=BLANKS,FIXLEN=10)),
BUILD=(5,2,21:%01,X,%02,HEX)),
IFTHEN=(WHEN=NONE,
PARSE=(%03=(STARTAFT=C(,ENDBEFR=C),FIXLEN=8)),
BUILD=(5,2,%03,SFF,M12))
BUILD=(items)
Specifies the build items to be applied to each record for which no
logical expression was true. See OUTFIL BUILD for details. You can
specify all of the items in the same way that you can specify them for
OUTFIL BUILD.
OVERLAY=(items)
Specifies the overlay items to be applied to each record for which no
logical expression was true. See OUTFIL OVERLAY for details. You can
specify all of the items in the same way that you can specify them for
OUTFIL OVERLAY.
Sample Syntax:
328
FINDREP=(items)
Specifies find and replace operations to be applied to each record for
which no logical expression was true. See OUTFIL FINDREP for
details. You can specify all of the items in the same way that you can
specify them for OUTFIL FINDREP.
Default for IFTHEN clauses: None; must be specified.
IFOUTLEN
IFOUTLEN=n
Sample Syntax:
OUTFIL FNAMES=OUT5,IFOUTLEN=70,
IFTHEN=(WHEN=(5,1,CH,EQ,C1,AND,8,3,ZD,EQ,+10),
BUILD=(1,40,CT01-GROUP-A,65)),
IFTHEN=(WHEN=(5,1,CH,EQ,C2,AND,8,3,ZD,EQ,+12),
BUILD=(1,40,CT02-GROUP-B,65))
Default for IFOUTLEN: The LRECL determined from the IFTHEN clauses.
VTOF or CONVERT
VTOF
CONVERT
329
330
VLTRIM
VLTRIM=byte
VLTRIM=byte specifies that the trailing bytes are to be removed from the end
of variable-length OUTFIL output records for this OUTFIL group before the
records are written.
The trim byte can be any value, such as blank, binary zero, or asterisk. If
DFSORT finds one or more trim bytes at the end of a variable-length OUTFIL
data record or report record, it will decrease the length of the record
accordingly, effectively removing the trailing trim bytes. However,
VLTRIM=byte will not remove the RDW, the ANSI carriage control character (if
produced), or the first data byte.
For example, say that you have the following 17-byte fixed-length data records
that you want to convert to variable-length data records:
123456***********
0003*************
ABCDEFGHIJ*****22
*****************
If you use:
Chapter 3. Using DFSORT program control statements
331
Data
123456***********
0003*************
ABCDEFGHIJ*****22
*****************
Data
123456
0003
ABCDEFGHIJ*****22
*
VLTRIM=C'*' removed the trailing asterisks from the first and second records.
The third record did not have any trailing asterisks to remove. The fourth
record had all asterisks, so one asterisk was kept.
If VLTRIM=byte is specified for fixed-length output records, it will not be
used.
If VLTRIM is specified with IFTRAIL, DFSORT will terminate.
byte
specifies the trim byte. Permissible values are C'x' and X'yy'.
C'x'
X'yy'
Sample Syntax:
Fixed input:
OUTFIL FNAMES=TRIM1,FTOV,VLTRIM=C
Variable input:
OUTFIL FNAMES=TRIM2,VLTRIM=X00
OUTFIL FNAMES=TRIM3,VLTRIM=C*,
OUTREC=(1,15,5X,16,8,5X,28)
VLTRAIL
VLTRAIL=string
332
and you want to add X'0D0A' (CR,LF) to the end of each record. If you use the
following OUTFIL statement:
OUTFIL FNAMES=OUT1,VLTRAIL=X0D0A
X'0D0A' will be inserted at the end of each record and the length of each
record will be increased by 2 bytes. If we represent X'0D0A' by CL, the OUT1
records will look like this:
Length | Data
30
Professional DevelopmentCL
20
PsychoanalysisCL
27
Theory of ComputationCL
Note that if the LRECL of the output data set is less than the maximum output
record (30 bytes for this example), we must increase it to at least the maximum
(LRECL=30 or greater for this example).
If VLTRIM=byte is used with VLTRAIL=string, the indicated bytes will be
trimmed from the end of the record before the indicated string is added. For
example, say that you have the following variable-length input records:
Length | Data
30
Abby is a sweet rat*******
31
Samantha is a curious rat**
43
Rachel is our oldest rat***************
29
Cathy is a mischief maker
and you want to remove any trailing asterisks, and add '|March 21|' at the
end of each record. If you use the following OUTFIL statement:
OUTFIL FNAMES=OUT2,VLTRIM=C*,VLTRAIL=C|March 21|
The trailing asterisks will be removed, 'March 21' will be inserted, and the
length of each record will be updated appropriately. The OUT2 records will
look like this:
Length | Data
33
Abby is a sweet rat|March 21|
39
Samantha is a curious rat|March 21|
38
Rachel is our oldest rat|March 21|
39
Cathy is a mischief maker|March 21|
333
Fixed input:
OUTFIL FNAMES=ADD3,FTOV,VLTRIM=C ,VLTRAIL=Cend
Specifies the number of times each OUTFIL output record is to be repeated for
this OUTFIL group. Each OUTFIL output record is written n times.
If SEQNUM is used in the OUTREC, BUILD, OVERLAY, or IFTHEN parameter
for this OUTFIL group, the sequence number will be incremented for each
repeated record. For example, if your input is:
RECORD A
RECORD B
A
A
B
B
00001
00002
00003
00004
If SEQNUM is used in multiple IFTHEN clauses for this OUTFIL group, the
sequence number will be incremented for each repeated record that satisfies
the IFTHEN clause. For example, if your input is:
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
RECORD
A
B
C
A
C
B
B
1
1
1
2
2
2
3
334
A
A
B
B
C
C
A
A
C
C
B
B
B
B
1
1
1
1
1
1
2
2
2
2
2
2
3
3
0001
0002
0001
0002
0001
0002
0003
0004
0003
0004
0003
0004
0005
0006
RECORD
RECORD
A 0001
A 0002
RECORD
RECORD
B 0003
B 0004
0001
0002
0003
0004
The REPEAT parameter cannot be used with any of the following parameters:
IFTRAIL, LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS,
and NODETAIL.
n
Sample Syntax:
* WRITE EACH OUTPUT RECORD 12 TIMES.
OUTFIL FNAMES=OUT1,REPEAT=12
* WRITE EACH INCLUDED AND REFORMATTED OUTPUT RECORD 50 TIMES.
* (THE SEQUENCE NUMBER WILL BE INCREMENTED FOR EACH REPETITION.)
OUTFIL FNAMES=OUT2,INCLUDE=(5,2,SS,EQ,CB2,C5,M3),
SPLIT
SPLIT
Splits the output records one record at a time in rotation among the data sets
of this OUTFIL group until all of the output records have been written. As a
result, the records will be split as evenly as possible among all of the data sets
in the group.
As an example, for an OUTFIL group with three data sets:
v the first OUTFIL data set in the group will receive records 1, 4, 7, and so on.
v the second OUTFIL data set in the group will receive records 2, 5, 8, and so
on.
v the third OUTFIL data set in the group will receive records 3, 6, 9, and so
on.
Chapter 3. Using DFSORT program control statements
335
SPLITBY
SPLITBY=n
Splits the output records n records at a time in rotation among the data sets of
this OUTFIL group until all of the output records have been written.
As an example, if SPLITBY=10 is specified for an OUTFIL group with three
data sets:
v the first OUTFIL data set in the group will receive records 1-10, 31-40, and
so on.
v the second OUTFIL data set in the group will receive records 11-20, 41-50,
and so on.
v the third OUTFIL data set in the group will receive records 21-30, 51-60, and
so on.
The records are not contiguous in each OUTFIL data set.
SPLITBY=1 is equivalent to SPLIT.
The SPLITBY parameter cannot be used with any of the following parameters:
IFTRAIL, LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS,
and NODETAIL.
n
specifies the number of records to split by. The value for n starts at 1 and
is limited to 28 digits (15 significant digits).
Sample Syntax:
* WRITE RECORDS 1-5 TO PIPE1, RECORDS 6-10 TO PIPE2, RECORDS 11-15 TO
* PIPE3, RECORDS 16-20 TO PIPE4, RECORDS 21-25 TO PIPE1, RECORDS 26-30
* TO PIPE2, AND SO ON.
OUTFIL FNAMES=(PIPE1,PIPE2,PIPE3,PIPE4),SPLITBY=5
* SPLIT THE INCLUDED AND REFORMATTED OUTPUT RECORDS 100 AT A TIME
* BETWEEN TAPE1 AND TAPE2.
OUTFIL FNAMES=(TAPE1,TAPE2),SPLITBY=100,
INCLUDE=(8,2,ZD,EQ,27),OUTREC=(5X,1,75)
336
Splits the output records n records at a time for one rotation among the data
sets of this OUTFIL group until all of the output records have been written.
As an example, if SPLIT1R=10 is specified for an input data set with 35 records
and an OUTFIL group with three data sets:
v the first OUTFIL data set in the group will receive records 1-10.
v the second OUTFIL data set in the group will receive records 11-20.
v the third OUTFIL data set in the group will receive records 21-35.
The records are contiguous in each OUTFIL data set.
The SPLIT1R parameter cannot be used with any of the following parameters:
IFTRAIL, LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS,
and NODETAIL.
n
specifies the number of records to split by. The value for n starts at 1 and
is limited to 28 digits (15 significant digits).
Sample Syntax:
* WRITE RECORDS 1-20 TO PIPE1, RECORDS 21-40 TO PIPE2,
* RECORDS 41-60 TO PIPE3 AND RECORDS 61-85 TO PIPE4.
OUTFIL FNAMES=(PIPE1,PIPE2,PIPE3,PIPE4),SPLIT1R=20
* SPLIT THE INCLUDED AND REFORMATTED OUTPUT RECORDS ONCE
* CONTIGUOUSLY BETWEEN TAPE1 AND TAPE2.
OUTFIL FNAMES=(TAPE1,TAPE2),SPLIT1R=100,
INCLUDE=(8,2,ZD,EQ,27),OUTREC=(5X,1,75)
NULLOFL
NULLOFL=
RC0
RC4
RC16
specifies the action to be taken by DFSORT when there are no data records for
a data set associated with this OUTFIL statement, as indicated by a DATA
count of 0 in message ICE227I. OUTFIL report records have no affect on the
action taken as a result of this option.
RC0
specifies that DFSORT should issue message ICE174I, set a return code of
0, and continue processing when there are no data records for a data set
associated with this OUTFIL statement.
RC4
specifies that DFSORT should issue message ICE174I, set a return code of
4, and continue processing when there are no data records for the a data
set associated with this OUTFIL statement.
RC16
specifies that DFSORT should issue message ICE209A, terminate, and give
a return code of 16 when there are no data records for a data set associated
with this OUTFIL statement.
Default for NULLOFL: The NULLOFL installation default.
Chapter 3. Using DFSORT program control statements
337
Specifies the number of lines per page to be used for the reports produced for
this OUTFIL group. DFSORT uses ANSI carriage control characters to control
page ejects and the placement of the lines in your report, according to your
specifications.
The LINES parameter cannot be used with the IFTRAIL parameter.
n
specifies the number of lines per page. The value for n must be between 1
and 255. However, n--or the default for n if LINES is not specified--must
be greater than or equal to the number of lines needed for each of the
following:
v The HEADER1 lines
v The TRAILER1 lines
v The sum of all lines for HEADER2, TRAILER2, HEADER3s, TRAILER3s,
and the data lines and blank lines produced from an input record.
Sample Syntax:
OUTFIL FNAMES=RPT1,LINES=50
338
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit
)
to
&PAGE=(
edit
to
Specifies the report header to be used for the reports produced for this
OUTFIL group. The report header appears by itself as the first page of the
report. DFSORT uses ANSI carriage control characters to control page ejects
and the placement of the lines in your report, according to your specifications.
You can use BLKCCH1 to replace the '1' (page eject) for the ANSI carriage
control character in the first line of the report header with a blank, thus
avoiding forcing a page eject. You can use REMOVECC to remove the ANSI
carriage control characters from a report.
You can choose to include any or all of the following report elements in your
report header:
v Blanks, character strings, and hexadecimal strings
v Unedited input fields from the first OUTFIL input record
v Current date in a variety of different forms
v Current time in a variety of different forms
v Page number, converted to different numeric formats, or edited to contain
signs, decimal points, leading zeros or no leading zeros, and so on.
The HEADER1 parameter cannot be used with the IFTRAIL parameter.
The report header consists of the elements you select, in the order in which
you specify them, and in the columns or lines you specify.
c: specifies the column in which the first position of the associated report
element is to appear, relative to the start of the data in the report record.
Ignore the RDW (variable-length report records only) and carriage control
character when specifying c:. That is, 1: indicates the first byte of the data
in the report record for both fixed-length and variable-length report
records.
Unused space preceding the specified column is padded with EBCDIC
blanks. The following rules apply:
v c must be a number between 1 and 32752.
v c: must be followed by a report element, but must not precede / or n/.
Chapter 3. Using DFSORT program control statements
339
n'xx...x'
Character string. n repetitions of the character string constant
('xx...x') are to appear in the report record. n can range from 1 to
4095. If n is omitted, 1 is used. x can be any EBCDIC character. You
can specify 1 to 256 characters.
nC'xx...x' can be used instead of n'xx...x'.
If you want to include a single apostrophe in the character string,
you must specify it as two single apostrophes:
Required:
ONEILL
Specify:
ONEILL or CONEILL
nX'yy...yy'
Hexadecimal string. n repetitions of the hexadecimal string
constant (X'yy...yy') are to appear in the report record. n can range
from 1 to 4095. If n is omitted, 1 is used.
The value yy represents any pair of hexadecimal digits. You can
specify from 1 to 256 pairs of hexadecimal digits
/.../ or n/
Blank lines or a new line. A new report record is to be started in
the header with or without intervening blank lines. If /.../ or n/ is
specified at the beginning or end of the header, n blank lines are to
appear in the header. If /.../ or n/ is specified in the middle of the
header, n-1 blank lines are to appear in the header (thus, / or 1/
indicates a new line with no intervening blank lines).
Either n/ (for example, 5/) or multiple /'s (for example, /////)
can be used. n can range from 1 to 255. If n is omitted, 1 is used.
As an example, if you specify:
OUTFIL HEADER1=(2/,First line of text,/,
Second line of text,2/,
Third line of text,2/)
340
specifies the first byte of the input field relative to the beginning of the
OUTFIL input record. The first data byte of a fixed-length record has
relative position 1. The first data byte of a variable-length record has
relative position 5, because the first four bytes are occupied by the
RDW. All fields must start on a byte boundary, and no field can extend
beyond byte 32752. See OUTFIL statements notes on page 374 for
special rules concerning variable-length records.
specifies the length in bytes of the input field. The value for m must be
between 1 and 32752.
DATE
specifies that the current date is to appear in the report record in the form
'mm/dd/yy', where mm represents the month (01-12), dd represents the
day (01-31), and yy represents the last two digits of the year (for example,
95).
&DATE
can be used instead of DATE.
DATE=(abcd)
specifies that the current date is to appear in the report record in the form
'adbdc', where a, b, and c indicate the order in which the month, day, and
year are to appear and whether the year is to appear as two or four digits,
and d is the character to be used to separate the month, day and year.
For a, b, and c, use M to represent the month (01-12), D to represent the
day (01-31), Y to represent the last two digits of the year (for example, 05),
or 4 to represent the four digits of the year (for example, 2005). M, D, and
Y or 4 can each be specified only once. Examples: DATE=(DMY.) would
produce a date of the form 'dd.mm.yy', which on March 29, 2005, would
appear as '29.03.05'. DATE=(4MD-) would produce a date of the form
'yyyy-mm-dd', which on March 29, 2005, would appear as '2005-03-29'.
a, b, c, and d must be specified.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
specifies that the current date is to appear in the report record in the form
'abc', where a, b and c indicate the order in which the month, day, and
year are to appear and whether the year is to appear as two or four digits.
For a, b and c, use M to represent the month (01-12), D to represent the
day (01-31), Y to represent the last two digits of the year (for example, 02),
or 4 to represent the four digits of the year (for example, 2002). M, D, and
Y or 4 can each be specified only once. Examples: DATENS=(DMY) would
produce a date of the form 'ddmmyy', which on March 29, 2002, would
appear as '290302'. DATENS=(4MD) would produce a date of the form
'yyyymmdd', which on March 29, 2002, would appear as '20020329'.
a, b and c must be specified.
&DATENS=(abc)
can be used instead of DATENS=(abc).
341
342
343
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit )
to
&PAGE=(
edit
to
COUNT
COUNT15
COUNT=( edit
)
to
COUNT+n=( edit
to
COUNT-n=( edit
to
SUBCOUNT
SUBCOUNT15
SUBCOUNT=( edit
to
TOTAL=
(p,m,f
TOT=
MIN=
(p,m,f
)
)
)
)
,edit
,to
)
,edit
,to
MAX=
(p,m,f
)
,edit
,to
AVG=
(p,m,f
)
,edit
,to
Additional Parameters for TRAILER1
344
SUBTOTAL=
(p,m,f
SUBTOT=
,edit
SUB=
,to
SUBMIN= (p,m,f
)
,edit
,to
SUBMAX= (p,m,f
)
,edit
,to
SUBAVG= (p,m,f
)
,edit
,to
Specifies the report trailer to be used for the reports produced for this OUTFIL
group. The report trailer appears by itself as the last page of the report.
DFSORT uses ANSI carriage control characters to control page ejects and the
placement of the lines in your report, according to your specifications. You can
use BLKCCT1 to replace the '1' (page eject) for the ANSI carriage control
character in the first line of the report trailer with a blank, thus avoiding
forcing a page eject. You can use REMOVECC to remove the ANSI carriage
control characters from a report.
You can choose to include any or all of the following report elements in your
report trailer:
v Blanks, character strings, and hexadecimal strings
v Unedited input fields from the last OUTFIL input record
v Current date in a variety of different forms
v Current time in a variety of different forms
v Page number, converted to different numeric formats, or edited to contain
signs, decimal points, leading zeros or no leading zeros, and so on
v Any or all of the following statistics:
Count of data records in the report, converted to different numeric
formats, or edited to contain signs, decimal points, leading zeros or no
leading zeros, and so on. You can add a decimal number to the count
before converting or editing it (for example, add 1 to account for writing
a trailer record, or add 2 to account for writing a header and trailer
record).
Total, minimum, maximum, or average for each specified ZD, PD, BI, FI,
FL, CSF, FS, UFF, or SFF numeric input field in the data records of the
report, converted to different numeric formats, or edited to contain signs,
decimal points, leading zeros or no leading zeros, and so on.
The TRAILER1 parameter cannot be used with the IFTRAIL parameter.
The report trailer consists of the elements you select, in the order in which you
specify them, and in the columns or lines you specify.
c: See c: under HEADER1.
r
n'xx...x'
345
DATE
See DATE under HEADER1.
&DATE
can be used instead of DATE.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
See DATENS=(abc) under HEADER1.
&DATENS=(abc)
can be used instead of DATENS=(abc).
YDDD=(abc)
See YDDD=(abc) under HEADER1.
&YDDD=(abc)
can be used instead of YDDD=(abc).
YDDDNS=(ab)
See YDDDNS=(ab) under HEADER1.
&YDDDNS=(ab)
can be used instead of YDDDNS=(ab).
TIME
See TIME under HEADER1.
&TIME
can be used instead of TIME.
TIME=(abc)
See TIME=(abc) under HEADER1.
346
347
348
Format (f)
Length (m)
Digits (d)
ZD
1-15
15
ZD
16-31
31
PD
1-8
15
PD
9-16
31
BI
1-4
10
BI
5-8
20
FI
1-4
10
FI
5-8
20
FL
4 or 8
20
CSF or FS
1-15
15
Length (m)
Digits (d)
CSF or FS
16-32
31
UFF
1-15
15
UFF
16-44
31
SFF
1-15
15
SFF
16-44
31
p,m,f,edit or p,m,f,to
specifies the numeric input field for which the average is to be
produced and how the output field (that is, the average) is to be edited
or converted.
See p,m,f,edit or p,m,f,to under OUTREC for further details. However,
note that PD0, DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1,
TC2, TC3, TC4, TE1, TE2, TE3, TE4, TM1, TM2, TM3 and TM4 are not
allowed for AVG.
Chapter 3. Using DFSORT program control statements
349
350
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit
)
to
&PAGE=(
edit
to
Specifies the page header to be used for the reports produced for this OUTFIL
group. The page header appears at the top of each page of the report, except
for the report header page (if any) and report trailer page (if any). DFSORT
uses ANSI carriage control characters to control page ejects and the placement
of the lines in your report, according to your specifications. You can use
BLKCCH2 to replace the '1' (page eject) for the ANSI carriage control character
in the first line of the first page header with a blank, thus avoiding forcing a
Chapter 3. Using DFSORT program control statements
351
p,m
specifies that an unedited input field, from the first OUTFIL input record
for which a data record appears on the page, is to appear in the report
record. See p,m under HEADER1 for further details.
DATE
See DATE under HEADER1.
&DATE
can be used instead of DATE.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
See DATENS=(abc) under HEADER1.
&DATENS=(abc)
can be used instead of DATENS=(abc).
YDDD=(abc)
See YDDD=(abc) under HEADER1.
&YDDD=(abc)
can be used instead of YDDD=(abc).
YDDDNS=(ab)
See YDDDNS=(ab) under HEADER1.
&YDDDNS=(ab)
can be used instead of YDDDNS=(ab).
TIME
See TIME under HEADER1.
&TIME
can be used instead of TIME.
TIME=(abc)
See TIME=(abc) under HEADER1.
352
353
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit )
to
&PAGE=(
edit
to
COUNT
COUNT15
COUNT=( edit )
to
COUNT+n=( edit
to
COUNT-n=( edit
to
SUBCOUNT
SUBCOUNT15
SUBCOUNT=( edit
to
TOTAL=
(p,m,f
TOT=
MIN=
(p,m,f
)
)
)
)
,edit
,to
)
,edit
,to
MAX=
(p,m,f
)
,edit
,to
AVG=
(p,m,f
)
,edit
,to
(p,m,f
SUBTOTAL=
SUBTOT=
SUB=
SUBMIN= (p,m,f
)
,edit
,to
)
,edit
,to
SUBMAX=
(p,m,f
)
,edit
,to
SUBAVG=
(p,m,f
)
,edit
,to
Specifies the page trailer to be used for the reports produced for this OUTFIL
group. The page trailer appears at the very bottom of each page of the report
(as specified or defaulted by the LINES value), except for the report header
354
p,m
specifies that an unedited input field, from the last OUTFIL input record
for which a data record appears on the page, is to appear in the report
record. See p,m under TRAILER1 for further details.
DATE
See DATE under HEADER1.
&DATE
can be used instead of DATE.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
See DATENS=(abc) under HEADER1.
355
356
357
358
)
SKIP=
P
L
nL
,
HEADER3= ( field
)
,PAGEHEAD
,
TRAILER3= ( field
Specifies the section break processing to be used for the reports produced for
this OUTFIL group. A section break field divides the report into sets of
sequential OUTFIL input records with the same binary value for that field,
which result in corresponding sets of data records (that is, sections) in the
report. A break is said to occur when the binary value changes. Of course,
because a break can occur in any record, the data records of a section can be
split across pages in your report.
For each section break field you specify, you can choose to include any or all of
the following:
v A page eject between sections.
v Zero, one or more blank lines to appear between sections on the same page.
v A section header to appear before the first data record of each section and
optionally, at the top of each page. When a page header and section header
are both to appear at the top of a page, the section header will follow the
page header.
v A section trailer to appear after the last data record of each section. When a
page trailer and section trailer are both to appear at the bottom of a page,
the page trailer will follow the section trailer.
The SECTIONS parameter cannot be used with the IFTRAIL parameter.
DFSORT uses ANSI carriage control characters to control page ejects and the
placement of the lines in your report, according to your specifications.
If multiple section break fields are used, they are processed in first-to-last
order, in the same way they would be sorted by these fields. In fact, the input
data set is generally sorted by the section break fields, to group the records
with the same section break values together for the report. This sorting can be
done by the same application that produces the report or by a previous
application.
A break in section break field 1 results in a break in section break fields 2
through n. A break in section break 2 results in a break in section break fields 3
through n, and so on. The section headers appear before each section in
Chapter 3. Using DFSORT program control statements
359
p,m
specifies a section break field in the OUTFIL input records to be used to divide
the report into sections. Each set of sequential OUTFIL input records, with the
same binary value for the section break field, results in a corresponding set of
data records. Each such set of data records is treated as a section in the report.
A break is said to occur when the binary value changes.
p
specifies the first byte of the input field relative to the beginning of the
OUTFIL input record. The first data byte of a fixed-length record has
relative position 1. The first data byte of a variable-length record has
relative position 5, because the first four bytes are occupied by the RDW.
All fields must start on a byte boundary, and no field can extend beyond
byte 32752. See OUTFIL statements notes on page 374 for special rules
concerning variable-length records.
specifies the length in bytes of the input field. The value for m must be
between 1 and 256.
You can specify any, all or none of SKIP, HEADER3 and TRAILER3 after p,m.
If you do not specify SKIP, HEADER3 or TRAILER3 after p,m, SKIP=0L is used
as the default.
SKIP
SKIP=
P
L
nL
Specifies, for reports produced for this OUTFIL group, that either:
v Each section for the associated section break field is to appear on a new
page, or
360
specifies that one blank line is to appear between sections on the same
page. L is the same as 1L.
nL specifies that n blank lines are to appear between sections on the same
page. You can specify from 0 to 255 for n.
Sample Syntax:
OUTFIL FNAMES=(PRINT,TAPE),
SECTIONS=(10,20,SKIP=P,
42,10,SKIP=3L)
HEADER3
,
HEADER3= (
c:
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit
)
to
&PAGE=(
edit
to
Specifies the section header to be used with the associated section break field
for the reports produced for this OUTFIL group. The section header appears
before the first data record of each section. DFSORT uses ANSI carriage control
characters to control page ejects and the placement of the lines in your report,
according to your specifications.
You can choose to include any or all of the following report elements in your
section header:
v Blanks, character strings, and hexadecimal strings
v Unedited input fields from the first OUTFIL input record for which a data
record appears in the section
v Current date in a variety of different forms
Chapter 3. Using DFSORT program control statements
361
p,m
specifies that an unedited input field, from the first OUTFIL input record
for which a data record appears in the section, is to appear in the report
record. See p,m under HEADER1 for further details.
DATE
See DATE under HEADER1.
&DATE
can be used instead of DATE.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
See DATENS=(abc) under HEADER1.
&DATENS=(abc)
can be used instead of DATENS=(abc).
YDDD=(abc)
See YDDD=(abc) under HEADER1.
&YDDD=(abc)
can be used instead of YDDD=(abc).
YDDDNS=(ab)
See YDDDNS=(ab) under HEADER1.
&YDDDNS=(ab)
can be used instead of YDDD=(ab).
TIME
See TIME under HEADER1.
&TIME
can be used instead of TIME.
TIME=(abc)
See TIME=(abc) under HEADER1.
&TIME=(abc)
can be used instead of TIME=(abc).
TIMENS=(ab)
See TIMENS=(ab) under HEADER1.
&TIMENS=(ab)
can be used instead of TIMENS=(ab).
PAGE
specifies that the current page number is to appear in the OUTFIL report
362
PAGEHEAD
PAGEHEAD
Specifies that the section header to be used with the associated section break
field is to appear at the top of each page of the report, except for the report
header page (if any) and report trailer page (if any), as well as before each
section. If you do not specify PAGEHEAD, the section header appears only
before each section; so if a section is split between pages, the section header
appears only in the middle of the page. PAGEHEAD can be used when you
want HEADER3 to be used as a page header as well as a section header.
If PAGEHEAD is specified for a section break field for which HEADER3 is not
also specified, PAGEHEAD will not be used.
Sample Syntax:
OUTFIL FNAMES=STATUS2,
HEADER2=(10:Status Report for all departments,5X,
- ,&PAGE, -),
SECTIONS=(10,8,
HEADER3=(2/,10:Report for department ,10,8, on ,&DATE,2/,
10:
Number,25:Average Time,/,
10:Completed,25:
(in days),/,
10:---------,25:------------),
PAGEHEAD,SKIP=P),
OUTREC=(10:21,5,ZD,M10,LENGTH=9,
25:38,4,ZD,EDIT=(III.T),LENGTH=12,
132:X)
TRAILER3
363
r
p,m
DATE
&DATE
DATE=(abcd)
&DATE=(abcd)
DATENS=(abc)
&DATENS=(abc)
YDDD=(abc)
&YDDD=(abc)
YDDDNS=(ab)
&YDDDNS=(ab)
TIME
&TIME
TIME=(abc)
&TIME=(abc)
TIMENS=(ab)
&TIMENS=(ab)
PAGE
&PAGE
PAGE=( edit )
to
&PAGE=(
edit
to
COUNT
COUNT15
COUNT=( edit )
to
COUNT+n=( edit
to
COUNT-n=( edit
to
SUBCOUNT
SUBCOUNT15
SUBCOUNT=( edit
to
TOTAL=
(p,m,f
TOT=
MIN=
(p,m,f
)
)
)
)
,edit
,to
)
,edit
,to
MAX=
(p,m,f
)
,edit
,to
AVG=
(p,m,f
)
,edit
,to
(p,m,f
SUBTOTAL=
SUBTOT=
SUB=
SUBMIN= (p,m,f
)
,edit
,to
)
,edit
,to
SUBMAX=
(p,m,f
)
,edit
,to
SUBAVG=
(p,m,f
)
,edit
,to
Specifies the section trailer to be used with the associated section break field
for the reports produced for this OUTFIL group. The section trailer appears
after the last data record of each section. DFSORT uses ANSI carriage control
characters to control page ejects and the placement of the lines in your report,
364
p,m
specifies that an unedited input field, from the last OUTFIL input record
for which a data record appears in the section, is to appear in the report
record. See p,m under TRAILER1 for further details.
DATE
See DATE under HEADER1.
&DATE
can be used instead of DATE.
DATE=(abcd)
See DATE=(abcd) under HEADER1.
&DATE=(abcd)
can be used instead of DATE=(abcd).
DATENS=(abc)
See DATENS=(abc) under HEADER1.
&DATENS=(abc)
can be used instead of DATENS=(abc).
YDDD=(abc)
See YDDD=(abc) under HEADER1.
Chapter 3. Using DFSORT program control statements
365
366
367
368
Specifies that data records are not to be output for the reports produced for
this OUTFIL group. With NODETAIL, the data records are completely
processed with respect to input fields, statistics, counts, sections breaks, and so
on, but are not written to the OUTFIL data set and are not included in line
counts for determining the end of a page. You can use NODETAIL to
summarize the data records without actually showing them.
The NODETAIL parameter cannot be used with the IFTRAIL parameter.
Sample Syntax:
OUTFIL FNAMES=SUMMARY,NODETAIL,
HEADER2=( Date: ,DATENS=(DMY.),4X,Page: ,PAGE,2/,
10:Division,25:
Total Revenue,/,
10:--------,25:-----------------),
SECTIONS=(3,5,
TRAILER3=(10:3,5,
25:TOTAL=(25,4,FI,M19,
LENGTH=17))),
TRAILER1=(5/,10:Summary of Revenue ,4/,
12:Number of divisions reporting is ,
COUNT,/,
12:Total revenue is ,
TOTAL=(25,4,FI,M19))
369
OUTFIL FNAMES=RPT3,BLKCCT1
TRAILER1=(5:Grand Total is ,TOT=(21,10,ZD,M5))
,HD=YES
IFTRAIL allows you to update count and total values in an existing trailer
(last) record to reflect the actual data records in an OUTFIL data set. Whereas
TRAILER1 lets you build a new trailer record, IFTRAIL lets you update an
existing trailer record using the COUNT and TOTAL features of TRAILER1.
When you add, delete or modify input data records to create an OUTFIL data
set, you can use IFTRAIL to ensure that the trailer record has accurate updated
count and total values.
The count and total values are determined using the data records processed as
input to OUTFIL. If slash (/) is used in OUTFIL BUILD to produce multiple
output data records, the count and total values are determined using the data
370
The trailer record will not be treated as a data record; it will not be subject to
INCLUDE processing, and will not be used for the updated count or total
values.
Since HD=YES is specified, the header record will not be treated as a data
record; it will not be subject to INCLUDE processing, and will not be used for
the updated count or total values.
IFTRAIL
Allows you to update count and total fields in the trailer record of the
data sets for an OUTFIL group. You can use IFTRAIL to identify a
trailer record and indicate count and total fields to be updated in that
record. The identified trailer record will not be used to determine the
count or totals. If you specify HD=YES, the header (first) record will
not be used to determine the count or totals.
You cannot specify IFTRAIL with any of the following operands in an
OUTFIL statement: HEADER1, TRAILER1, HEADER2, TRAILER2,
NODETAIL, SECTIONS, LINES, SPLIT, SPLITBY, SPLIT1R, REPEAT,
FTOV, VTOF, VLTRIM, VLTRAIL or VLFILL.
You must specify the TRLID and TRLUPD operands. The HD=YES
operand is optional.
TRLID=(logexp)
Specifies the criteria to be tested to determine if a record is the trailer
record. When a record is found that meets the criteria, it will be treated
as the last record, and subsequent records will not be processed for the
OUTFIL group. Thus if you use TRLID=(1,1,CH,EQ,C'9') to identify the
trailer record and you have three records with '9' in position 1, the first
record with '9' in position 1 will be treated as the trailer record, and
records after that will not appear in the OUTFIL data sets.
See the discussion of INCLUDE statement in INCLUDE control
statement on page 96 for details of the logical expressions that you
can use. You can specify all of the logical expressions for TRLID in the
same way that you can specify them for the INCLUDE statement,
except that:
v You cannot specify FORMAT=f
v You cannot specify D2 format
v Locale processing is not used
371
COUNT+n=(edit)
COUNT+n=(to)
COUNT-n=(edit)
COUNT-n=(to)
TOTAL=(p,m,f,edit)
TOTAL=(p,m,f,to)
v TOT=(p,m,f,edit)
v TOT=(p,m,f,to)
The count and total values are determined using the data records
processed as input to OUTFIL.
If TOT or TOTAL is used, the specified p,m,f field from each data
record will be totalled, even if the trailer record is not found.
OUTFIL BUILD, OVERLAY or IFTHEN processing does NOT affect
the values that are totalled; the values in the original OUTFIL
input records are used for the totals.
372
the last (T***) record will not be identified as the trailer record
since it does not have 'TR' in positions 1-2. Thus, an 0C7 ABEND
will result when DFSORT attempts to total the invalid 1,4,ZD field
in the last (T***) record. The use of the correct condition for
identifying the trailer (T***) record would prevent this.
If slash (/) is used in OUTFIL BUILD to produce multiple output
data records, the count and total values are determined using the
data records processed as input to OUTFIL. For example, if you
use OUTFIL BUILD=(1,80,/,1,80) to create 6 OUTFIL output
records from 3 OUTFIL input records, the count is 3, not 6.
HD=YES
Specify HD=YES if you want the first record treated as a header record
rather than as a data record. With HD=YES, OUTFIL processing (for
example, INCLUDE, OMIT, BUILD, OVERLAY, and so on) will be
bypassed for the header record. The updated count and total values
will not include the header record.
If HD=YES is specified, the TRLID test will not be applied to the first
record.
Sample Syntax:
OUTFIL IFTRAIL=(HD=YES,
TRLID=(1,3,CH,EQ,CTRL),
TRLUPD=(11:COUNT=(M11,LENGTH=4),
21:TOT=(M11,LENGTH=6)))
373
374
DFSORT will then set the LRECL to 81 (1 byte for the ANSI carriage control
character plus 80 bytes for the length of the data records), and pad the data
records with blanks on the right.
If you don't want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them. For example, if you
specify:
OUTREC=(1,40,80:X),REMOVECC
DFSORT will set the LRECL to 80 instead of 81 and remove the ANSI carriage
control character from each record before it is written.
System errors can result if you print an OUTFIL report containing records longer
than your printer can handle.
v DFSORT uses appropriate ANSI carriage controls (for example, C'-' for triple
space) in header and trailer records when possible to reduce the number of
report records written. DFSORT always uses the single space carriage control (C'
') in data records. Although these carriage control characters may not be shown
when you view an OUTFIL data set (depending on how you view it), they will
be used if you print the report. If you are creating a report for viewing and want
blank lines to appear in headers and trailers, specify a line of blanks instead of
using n/. For example, instead of specifying:
OUTFIL FNAMES=RPT,
HEADER2=(2/,start of header,2/,next line)
which will result in blank lines for the printer, but not for viewing, specify:
OUTFIL FNAMES=RPT,
HEADER2=(X,/,X,/,start of header,/,X,/,next line)
If you don't want the ANSI carriage control characters to appear in the output
data set, use the REMOVECC parameter to remove them.
v For variable-length records, the first entry in the OUTREC, BUILD or IFTHEN
BUILD parameter must specify or include the unedited 4-byte record descriptor
word (RDW), that is, the first field must be 1,4 or 1,m with m greater than 4.
DFSORT sets the length of the reformatted record in the RDW.
If the first field in the data portion of the input record is to appear unedited in
the reformatted record immediately following the RDW, the entry in the
OUTREC, BUILD, or IFTHEN BUILD parameter can specify both RDW and data
field in one (1,m,...). Otherwise, the RDW must be specifically included in the
reformatted record (for example, 1,4,1,4,HEX).
For variable-length OUTFIL header or trailer records, you must not specify the
4-byte RDW at the beginning of the record.
v For variable-length records, OVERLAY, IFTHEN OVERLAY or IFTHEN PUSH
items must not overlay the RDW in bytes 1-4. You must ensure that 1:, 2:, 3: or
4: is not specified or defaulted for any OVERLAY or PUSH item. Note that the
default for the first OVERLAY or PUSH item is 1:, so you must override it.
v With FIELDS, BUILD or IFTHEN BUILD, the variable part of the input record
(that part beyond the minimum record length) can be included in the
reformatted record and, if included, must be the last part. For example:
OUTFIL BUILD=(1,8,20C*,9)
Chapter 3. Using DFSORT program control statements
375
v
v
With OVERLAY, the variable part of the input record must not be included in
the reformatted record.
For variable-length records, the FIELDS or BUILD parameter of the INREC and
OUTREC statement and the OUTREC or FIELDS parameter of the OUTFIL
statement must all specify position-only for the last part, or all not specify
position-only for the last part. OVERLAY or IFTHEN, and FIELDS, OUTREC or
BUILD, can differ with respect to position-only. See INREC statement notes on
page 148 for more details.
If there are no OUTFIL input records for an OUTFIL group, the headers and
trailers appear without any data records. Blanks will be used for any specified
unedited input fields, and zero values will be used for any specified statistics
fields.
If a variable-length OUTFIL input record is too short to contain a specified
unedited input field for a report header or trailer, blanks will be used for the
missing bytes. If a variable-length OUTFIL input record is too short to contain a
specified section break field or statistics field, zeros will be used for the missing
bytes, intentionally or unintentionally.
If a variable-length OUTFIL input record is too short to contain an OUTFIL
INCLUDE or OMIT compare field, the action DFSORT takes depends on the
settings for VLSCMP/NOVLSCMP and VLSHRT/NOVLSHRT. For details, see
the discussion of the VLSCMP and NOVLSCMP options in OPTION control
statement on page 173.
If a variable-length OUTFIL input record is too short to contain an OUTFIL
OUTREC or BUILD field, DFSORT will terminate unless the VLFILL=byte
parameter is specified.
If a variable-length OUTFIL input record is too short to contain an OUTFIL
OVERLAY or IFTHEN field, blanks will be used for the missing bytes.
If a variable-length OUTFIL output data record is longer than the LRECL of its
OUTFIL data set, the action DFSORT takes depends on the settings for
VLLONG/NOVLLONG. For details, see the discussion of the VLLONG and
NOVLLONG options in OPTION control statement on page 173. Note that
VLLONG can be used to truncate long OUTFIL data records, but has no effect
on long OUTFIL header or trailer records.
If an unedited page number overflows 6 digits, an edited page number
overflows 15 digits, a count or running count overflows 15 digits, or a total or
running total overflows 31 digits, the overflowing value will be truncated to the
number of digits allowed, intentionally or unintentionally.
v Multiple OUTFIL statements can be specified in the same and different sources.
If a ddname occurs more than once in the same source, the ddname is associated
with the first OUTFIL group in which it appears. For example, if the following is
specified in SYSIN:
OUTFIL FNAMES=(OUT1,OUT2),INCLUDE=(1,1,CH,EQ,CA)
OUTFIL FNAMES=(OUT3,OUT1),SAVE
OUT1 and OUT2 are processed as part of the first OUTFIL group, that is, with
INCLUDE. OUT3 is processed as part of the second OUTFIL group, that is, with
SAVE; but OUT1 is not because it is a duplicate ddname.
If a ddname occurs in more than one source, the ddname is associated with the
highest source OUTFIL group in which it appears. For example, if the following
is specified in DFSPARM:
OUTFIL FNAMES=(OUT1,OUT2),INCLUDE=(1,1,CH,EQ,CA)
376
OUT1 and OUT2 are processed as part of the DFSPARM OUTFIL group, that is,
with INCLUDE. OUT3 is processed as part of the SYSIN OUTFIL group, that is,
with SAVE; but OUT1 is not because it is an overridden ddname.
v OUTFIL statements cannot be passed to or returned from an EFS program. The
D2 format cannot be specified in the INCLUDE or OMIT parameter of an
OUTFIL statement.
v If SZERO is in effect, -0 is treated as negative and +0 is treated as positive for
edited or converted input fields, minimums, maximums, decimal constants and
the results of arithmetic expressions. If NOSZERO is in effect, -0 and +0 are
treated as positive for edited or converted input fields, minimums, maximums,
decimal constants, and the results of arithmetic expressions.
v If SZERO is in effect, -0 compares as less than +0 when numeric fields and
constants are used. If NOSZERO is in effect, -0 compares as equal to +0 when
numeric fields and constants are used.
Note: OPTION SZERO or OPTION NOSZERO is ignored for OUTFIL
INCLUDE=(logexp) or OMIT=(logexp), or for OUTFIL
IFTHEN=(WHEN=(logexp),...) unless the OPTION statement is found in a higher
source (for example, DFSPARM is a higher source than SYSIN) or before the
OUTFIL statement in the same source. For example, NOSZERO will be used in
both of the following cases:
Case 1:
//DFSPARM DD *
OPTION COPY,NOSZERO
/*
//SYSIN DD *
OUTFIL INCLUDE=(1,2,FS,EQ,+0)
/*
Case 2:
//SYSIN DD *
OPTION COPY,NOSZERO
OUTFIL IFTHEN=(WHEN=(1,2,FS,EQ,+0),OVERLAY=(28:CA)),
IFTHEN=(WHEN=NONE,OVERLAY=(28:CB))
/*
OUTFIL featuresexamples
Example 1
OPTION
OUTFIL
OUTFIL
OUTFIL
OUTFIL
OUTFIL
COPY
INCLUDE=(15,6,CH,EQ,CMSG005),FNAMES=M005
INCLUDE=(15,6,CH,EQ,CMSG022),FNAMES=M022
INCLUDE=(15,6,CH,EQ,CMSG028),FNAMES=M028
INCLUDE=(15,6,CH,EQ,CMSG115),FNAMES=M115
SAVE,FNAMES=UNKNOWN
This example illustrates how records can be distributed to different OUTFIL data
sets based on criteria you specify:
v Input records with MSG005 in bytes 15 through 20 will be written to the
OUTFIL data set associated with ddname M005.
v Input records with MSG022 in bytes 15 through 20 will be written to the
OUTFIL data set associated with ddname M022.
377
Example 2
SORT FIELDS=(18,5,ZD,D)
OUTFIL FNAMES=(V,VBU1,VBU2)
OUTFIL FNAMES=(F,FBU1),
CONVERT,OUTREC=(11,3,X,18,5,X,X0000000F)
OUTFIL FNAMES=VINF,OUTREC=(1,4,C*,5,20,C*,25)
This example illustrates how multiple sorted output data sets can be created and
how a variable-length record data set can be converted to a fixed-length record
data set:
v The first OUTFIL statement writes the variable-length input records to the
variable-length OUTFIL data sets associated with ddnames V, VBU1, and VBU2.
v The second OUTFIL statement reformats the variable-length input records to
fixed-length output records and writes them to the fixed-length OUTFIL data
sets associated with ddnames F and FBU1. CONVERT is used to indicate that a
variable-length data set is to be converted to a fixed-length data set; OUTREC is
used to describe how the variable-length input records are to be reformatted as
fixed-length output records.
v The third OUTFIL statement reformats the variable-length input records and
writes them to the variable-length OUTFIL data set associated with ddname
VINF. OUTREC is used to insert asterisks between fields. 1,4 represents the
RDW. 25 represents the variable part at the end of the input record.
Example 3
SORT FIELDS=(15,6,ZD,A)
OUTFIL FNAMES=USA,
HEADER2=(5:Parts Completion Report for USA,2/,
5:Printed on ,DATE,
at ,TIME=(12:),3/,
5:Part ,20:Completed,35:
Value ($),/,
5:------,20:---------,35:------------),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M12,LENGTH=9,
35:38,8,ZD,M18,LENGTH=12,
132:X)
OUTFIL FNAMES=FRANCE,
HEADER2=(5:Parts Completion Report for France,2/,
5:Printed on ,DATE=(DM4/),
at ,TIME,3/,
5:Part ,20:Completed,35:
Value (F),/,
5:------,20:---------,35:------------),
OUTREC=(5:15,6,ZD,M11,
20:3,4,ZD,M16,LENGTH=9,
35:38,8,ZD,M22,LENGTH=12,
132:X)
OUTFIL FNAMES=DENMARK,
HEADER2=(5:Parts Completion Report for Denmark,2/,
5:Printed on ,DATE=(DMY-),
at ,TIME=(24.),3/,
5:Part ,20:Completed,35: Value (kr),/,
5:------,20:---------,35:------------),
378
This example illustrates how reports for three different countries can be produced
from sorted fixed-length input records. The reports differ only in the way that
date, time, and numeric formats are specified:
1. The first OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in the United States.
2. The second OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in France.
3. The third OUTFIL statement produces a report that has the date, time, and
numeric formats commonly used in Denmark.
Of course, any one of the three reports can be produced by itself using a single
OUTFIL statement instead of three OUTFIL statements. (This may be necessary if
you are sorting character data according to a specified locale for that country.)
The FNAMES parameter specifies the ddname (USA, FRANCE, DENMARK)
associated with the fixed-length data set for that report.
The HEADER2 parameter specifies the page header to appear at the top of each
page for that report, which will consist of:
v A line of text identifying the report. Note that all English text in the report can
be replaced by text in the language of that country.
v A blank line (2/).
v A line of text showing the date and time. Note that variations of the DATE,
DATE=(abcd), TIME, and TIME=(abc) operands are used to specify the date and
time in the format commonly used in that country.
v Two blank lines (3/).
v Two lines of text showing headings for the columns of data. Note that the
appropriate currency symbol can be included in the text.
The OUTREC parameter specifies the three columns of data to appear for each
input record as follows:
v A 6-byte edited numeric value produced by transforming the ZD value in bytes
15 through 20 according to the pattern specified by M11. M11 is a pattern for
showing integers with leading zeros.
v A 9-byte (LENGTH=9) edited numeric value produced by transforming the ZD
value in bytes 3 through 6 according to the pattern for integer values with
thousands separators commonly used in that country. M12 uses a comma for the
thousands separator. M16 uses a blank for the thousands separator. M13 uses a
period for the thousands separator.
v A 12-byte (LENGTH=12) edited numeric value produced by transforming the
ZD value in bytes 38 through 45 according to the pattern for decimal values
with thousands separators and decimal separators commonly used in that
country. M18 uses a comma for the thousands separator and a period for the
decimal separator. M22 uses a blank for the thousands separator and a comma
for the decimal separator. M19 uses a period for the thousands separator and a
comma for the decimal separator.
Table 46 on page 271 shows the twenty-seven pre-defined edit masks (M0-M26)
from which you can choose.
Chapter 3. Using DFSORT program control statements
379
Part
-----000310
001184
029633
192199
821356
Completed
--------562
1,234
35
3,150
233
Value ($)
-----------8,317.53
23,456.78
642.10
121,934.65
2,212.34
Part
-----000310
001184
029633
192199
821356
Completed
--------562
1 234
35
3 150
233
Value (F)
-----------8 317,53
23 456,78
642,10
121 934,65
2 212,34
Part
-----000310
001184
029633
192199
821356
Completed
--------562
1.234
35
3.150
233
Value (kr)
-----------8.317,53
23.456,78
642,10
121.934,65
2.212,34
Example 4
SORT FIELDS=(3,10,A,16,13,A),FORMAT=CH
OUTFIL FNAMES=WEST,
INCLUDE=(42,6,CH,EQ,CWest),
HEADER1=(5/,18:
Western Region,3/,
18:Profit and Loss Report,3/,
18:
for ,&DATE,3/,
18:
Page,&PAGE),
OUTREC=(6:16,13,24:31,10,ZD,M5,LENGTH=20,75:X),
SECTIONS=(3,10,SKIP=P,
HEADER3=(2:Division: ,3,10,5X,Page:,&PAGE,2/,
6:Branch Office,24:
Profit/(Loss),/,
6:-------------,24:--------------------),
TRAILER3=(6:=============,24:====================,/,
6:Total,24:TOTAL=(31,10,ZD,M5,LENGTH=20),/,
6:Lowest,24:MIN=(31,10,ZD,M5,LENGTH=20),/,
6:Highest,24:MAX=(31,10,ZD,M5,LENGTH=20),/,
6:Average,24:AVG=(31,10,ZD,M5,LENGTH=20),/,
3/,2:Average for all Branch Offices so far:,
X,SUBAVG=(31,10,ZD,M5))),
380
This example illustrates how a report can be produced with a header and trailer
page and sections of columns of data, from a sorted subset of fixed-length input
records.
The FNAMES parameter specifies the ddname (WEST) associated with the
fixed-length data set for the report.
The INCLUDE parameter specifies the records to be selected for the report.
The HEADER1 parameter specifies the report header to appear as the first page of
the report, which will consist of five blank lines (5/) followed by four lines of text,
each separated by 2 blank lines (3/). The last two lines of text will show the date
(&DATE) and page number (&PAGE), respectively.
The OUTREC parameter specifies the two columns of data to appear for each
selected input record as follows:
v The character string from bytes 16 through 28 of the input record.
v A 20-byte (LENGTH=20) edited numeric value produced by transforming the
ZD value in bytes 31 through 40 according to the pattern specified by M5.
The SECTIONS parameter specifies the section break field (3,10), page ejects
between sections (SKIP=P), the header (HEADER3) to appear before each section
and the trailer (TRAILER3) to appear after each section. The section header will
consist of a line of text showing the page number, a blank line (2/) and two lines
of text showing the headings for the columns of data. The section trailer will
consist of a line of text separating the data from the trailer, lines of text showing
the total (TOTAL), minimum (MIN), maximum (MAX) and average (AVG) for the
data in the section as edited numeric values, two blank lines, and a line of text
showing the running average (SUBAVG) for all of the data records in the report up
to this point.
The TRAILER1 parameter specifies the report trailer to appear as the last page of
the report, which will consist of a line of text showing the page and date, four
blank lines (5/), a text line showing the count of data records in the report, a blank
line, a line of text, a blank line, and lines of text showing the total, minimum
maximum and average for all of the data in the report as edited numeric values.
75:X is used at the end of the OUTREC parameter to ensure that the data records
are longer than the report records. This will result in an LRECL of 76 for the
fixed-length OUTFIL data set (1 byte for the ANSI control character and 75 bytes
for the data).
The report might look as follows:
Chapter 3. Using DFSORT program control statements
381
Western Region
for
08/20/05
Page
Division:
Chips
Branch Office
------------Gilroy
Los Angeles
Morgan Hill
Oakland
San Francisco
San Jose
San Martin
=============
Total
Lowest
Highest
Average
Page:
Profit/(Loss)
-------------------554,843.42
(22,340.14)
987,322.32
234,124.32
(32,434.31)
1,232,133.35
889,022.03
====================
3,842,670.99
(32,434.31)
1,232,133.35
548,952.99
Division:
Ice Cream
Branch Office
------------Marin
Napa
San Francisco
San Jose
San Martin
=============
Total
Lowest
Highest
Average
Page:
548,952.99
Profit/(Loss)
-------------------542,341.23
857,342.83
922,312.45
(234.55)
1,003,467.30
====================
3,325,229.26
(234.55)
1,003,467.30
665,045.85
Division:
Pretzels
Branch Office
------------Marin
Morgan Hill
Napa
San Francisco
San Jose
San Martin
=============
Total
Lowest
Highest
Average
Page:
Profit/(Loss)
-------------------5,343,323.44
843,843.40
5,312,348.56
5,412,300.05
1,234,885.34
(2,343.82)
====================
18,144,356.97
(2,343.82)
5,412,300.05
3,024,059.49
382
597,325.02
1,406,236.51
Page
Date:
08/20/05
18
25,312,257.22
(32,434.31)
5,412,300.05
1,406,236.51
Example 5
SORT FIELDS=(6,5,CH,A)
OUTFIL FNAMES=STATUS,
HEADER2=(1:CPAGE ,&PAGE,C OF STATUS REPORT FOR ,&DATE,2/,
6:CITEM ,16:CSTATUS
,31:CPARTS,/,
6:C-----,16:C------------,31:C-----),
OUTREC=(1,4,
10:6,5,
20:14,1,CHANGE=(12,
C1,CSHIP,
C2,CHOLD,
C3,CTRANSFER),
NOMATCH=(C*CHECK CODE*),
37:39,1,BI,M10,
120:X)
This example illustrates how a report can be produced with a page header and
columns of data from sorted variable-length input records, using a lookup table.
The FNAMES parameter specifies the ddname (STATUS) associated with the
variable-length data set for the report.
The HEADER2 parameter specifies the page header to appear at the top of each
page, which will consist of a line of text showing the page number (&PAGE) and
date (&DATE), a blank line (2/), and two lines of text showing headings for the
columns of data.
The OUTREC parameter specifies the RDW and three columns of data to appear
for each input record as follows (remember that byte 5 is the first byte of data for
variable-length records):
v The character string from bytes 6 through 10 of the input record
v A character string produced by finding a match for byte 14 of the input record
in the table defined by CHANGE (lookup and change). NOMATCH indicates
the character string to be used if byte 14 does not match any of the entries in the
CHANGE table.
v An edited numeric value produced by transforming the BI value in byte 39
according to the pattern specified by M10.
With variable-length input records, you must account for the RDW when
specifying the c: values for OUTREC, but not for headers or trailers. The 1: used
for the first line of HEADER2 causes it to start in the first data byte (by contrast, 5:
must be used to specify the first OUTREC data byte for variable-length records).
Also, because 6: is used for the ITEM heading, 10: must be used for the ITEM data
to get the heading and data to line up in columns.
383
STATUS
-----------HOLD
SHIP
*CHECK CODE*
TRANSFER
SHIP
PARTS
----36
106
95
18
120
Example 6
OPTION
OUTFIL
OUTFIL
OUTFIL
COPY
FNAMES=(A1,A2,A3),SPLIT
FNAMES=(B1,B2,B3),SPLITBY=25
FNAMES=(C1,C2,C3),SPLIT1R=25
This example illustrates different ways to split 77 input records among three
OUTFIL data sets.
The first OUTFIL statement uses SPLIT to rotate the records among the three
OUTFIL data sets one record at a time. A1 will have records 1, 4, ...,76. A2 will
have records 2, 5, ...,77. A3 will have records 3, 6, ...,75. A1 will have 26 records. A2
will have 26 records. A3 will have 25 records. A1, A2 and A3 will each have
non-contiguous records.
The second OUTFIL statement uses SPLITBY=25 to rotate the records among the
three OUTFIL data sets 25 records at a time. B1 will have records 1-25 and 76-77.
B2 will have records 26-50. B3 will have records 51-75. B1 will have 27 records. B2
will have 25 records. B3 will have 25 records. B1 will have non-contiguous records.
B2 and B3 will have contiguous records.
The third OUTFIL statement uses SPLIT1R=25 to rotate the records once among the
three OUTFIL data sets 25 records at a time. C1 will have records 1-25. C2 will
have records 26-50. C3 will have records 51-77. C1 will have 25 records. C2 will
have 25 records. C3 will have 27 records. C1, C2 and C3 will have contiguous
records.
Example 7
OPTION
OUTFIL
OUTFIL
OUTFIL
OUTFIL
OUTFIL
COPY
FNAMES=RANGE1,ENDREC=1000000
FNAMES=RANGE2,STARTREC=1000001,ENDREC=2000000
FNAMES=RANGE3,STARTREC=2000001,ENDREC=3000000
FNAMES=RANGE4,STARTREC=3000001,ENDREC=4000000
FNAMES=(RANGE5,EXTRA),STARTREC=4000001
This example illustrates how specific ranges of output records can be written to
different output data sets. A typical application might be database partitioning.
The first 1 million records will be written to the data set associated with RANGE1,
the second million to RANGE2, the third million to RANGE3, and the fourth
million to RANGE4. The remaining records will be written to both the data set
384
Example 8
OPTION COPY,Y2PAST
OUTFIL FNAMES=Y4,
OUTREC=(1,19,
21,2,PD0,M11,C/,
22,2,PD0,M11,C/,
20,2,Y2P,
24,57)
transform mm
transform dd
transform yy to yyyy
This example illustrates how to transform an existing data set with a packed
decimal date field of the form P'yymmdd' (X'0yymmddC') in bytes 20-23 into a
new data set with a character date field of the form C'mm/dd/yyyy' in bytes
20-29. yy represents the two-digit year, yyyy represents the four-digit year, mm
represents the month, dd represents the day, and C represents a positive sign.
The input data set has an LRECL of 80 and the Y4 data set will have an LRECL of
86.
The Y2PAST=26 option sets the century window to be used to transform two-digit
years into four-digit years. If the current year is 2006, the century window will be
1980 to 2079. Using this century window, the input and output fields might be as
follows:
Input Field (HEX)
20
|
0020505F
0950823C
0980316C
0000316F
Example 9
OPTION COPY,Y2PAST=1996
OUTFIL FNAMES=SPCL,
OUTREC=(1,14, copy positions 1-14
15,6,Y2T, transform yy to yyyy - allow blanks
21,20)
copy positions 21 - 40
This example illustrates how to transform an existing data set with a character date
field of the form C'yymmdd' and blank special indicators in bytes 15-20, into a
new date set with a character date field of the form C'yyyymmdd' and blank
special indicators in bytes 15-22.
The input data set has an LRECL of 40 and the SPCL data set will have an LRECL
of 42.
The Y2PAST=1996 option sets the century window to 1996-2095. The century
window will be used to transform the two-digit years into four-digit years, but will
not be used for the special blank indicators.
The input records might be as follows:
385
960512
000628
951115
CA
CA
FL
CO
19960512
20000628
20951115
CA
CA
FL
CO
Example 10
OPTION COPY
OUTFIL FNAMES=ALL,OUTREC=(CUS ,1,10,C
CWW ,1,10,C
OUTFIL FNAMES=(US,WW),SPLIT,
OUTREC=(1,10,C is
1,10,C is
is in ,11,15,/,
is in ,26,20,2/)
in ,11,15,/,
in ,26,20)
This example illustrates how multiple OUTFIL output and blank records can be
produced from each OUTFIL input record. The input data set has an LRECL of 50
and contains the following three records:
Finance
San Francisco Buenos Aires
Research New York
Amsterdam
Marketing Los Angeles
Mexico City
The first OUTFIL statement creates the data set associated with ddname ALL. This
data set will have an LRECL of 40 (the length of the longest output record; the one
that includes the 26,20 input field). Each input record will result in two data
records followed by two blank records as follows:
ALL data set
US Finance
WW Finance
is in San Francisco
is in Buenos Aires
US Research
WW Research
is in New York
is in Amsterdam
US Marketing
WW Marketing
is in Los Angeles
is in Mexico City
The second OUTFIL statement creates the two data sets associated with ddnames
US and WW. These data sets will have an LRECL of 37 (the length of the longest
output record; the one that includes the 26,20 input field). Each input record will
result in two data records. SPLIT will cause the first data record to be written to
the US data set and the second data record to be written to the WW data set. Thus,
each input record will create one record in each OUTFIL data set as follows:
US data set
Finance
is in San Francisco
Research
is in New York
Marketing is in Los Angeles
WW data set
Finance
is in Buenos Aires
Research
is in Amsterdam
Marketing is in Mexico City
386
Example 11
SORT FIELDS=(6,3,CH,D)
OUTFIL FNAMES=SET60,BUILD=(1,60),VLFILL=C
OUTFIL FNAMES=VARFIX,VTOF,BUILD=(5,20,5X,28,20),VLFILL=C*
This example illustrates how variable-length records that are too short to contain
all OUTFIL BUILD fields can be processed successfully.
The input data set has RECFM=VB and LRECL=80. The records in this data set
have lengths that vary from 15 bytes to 75 bytes.
The first OUTFIL statement creates the data set associated with ddname SET60.
This data set will have RECFM=VB and LRECL=60. Every record in this data set
will have a length of 60. The 1,60 field truncates records longer than 60 bytes to 60
bytes. Because VLFILL=C' ' is specified, the 1,60 field pads records shorter than 60
bytes to 60 bytes using a blank (C' ') as the fill byte.
Note: Without VLFILL=byte, this OUTFIL statement would terminate with an
ICE218A message because some of the input records are too short to contain the
BUILD field.
The second OUTFIL statement creates the data set associated with ddname
VARFIX. This data set will have RECFM=FB and LRECL=45. VTOF changes the
variable-length input records to fixed-length output records according to the fields
specified by BUILD. VLFILL=C'*' allows short input records to be processed. Each
missing byte in an OUTFIL BUILD field is replaced with an asterisk (C'*') fill byte.
Note:
1. CONVERT can be used instead of VTOF.
2. VLFILL=C'*' overrides the default of VLFILL=X'40' for VTOF or CONVERT.
Example 12
OPTION COPY
OUTFIL OUTREC=(SEQNUM,4,BI,Z,8,5,ZD,TO=PD,Z,
31,2,PD,TO=FI,LENGTH=2),Z,
16,3,ZD,ADD,+1,TO=FI,LENGTH=2,Z,
(16,3,ZD,MAX,31,2,PD),MUL,+2,TO=ZD,LENGTH=4)
This example illustrates how a sequence number can be generated, how values in
one numeric format can be converted to another numeric format, and how
arithmetic expressions involving fields and decimal constants can be used.
The input data set has an LRECL of 50 and the SORTOUT data set will have an
LRECL of 19.
The OUTFIL statement creates output records with the following fields:
A binary sequence number in bytes 1-4 that starts at 1 and increments by 1.
X'00' in byte 5.
A PD field in bytes 6-8 containing the converted ZD field from input bytes 8-12
X'00' in position 9.
An FI field in bytes 10-11 containing the converted PD field from input bytes
31-32.
v X'00' in position 12.
v An FI field in bytes 13-14 containing the converted result of the ZD field from
input bytes 16-18 incremented by 1.
v
v
v
v
v
387
Example 13
SORT FIELDS=COPY
OUTFIL FNAMES=VAROUT1,FTOV
OUTFIL FNAMES=VAROUT2,FTOV,
OUTREC=(20,8,35,10)
OUTFIL FNAMES=VAROUT3,FTOV,VLTRIM=X40
This example illustrates several ways to convert a fixed-length record data set to a
variable-length record data set using the FTOV parameter of OUTFIL.
The input data set has an RECFM=FB and LRECL=60.
v The first OUTFIL statement converts the fixed-length input data set to a
variable-length OUTFIL data set associated with ddname VAROUT1. VAROUT1
will have RECFM=VB and LRECL=64. All of its records will be 64 bytes long
(4-byte RDW plus 60-byte input record).
v The second OUTFIL statement converts the fixed-length input data set to a
variable-length OUTFIL data set associated with ddname VAROUT2. OUTREC is
used to select two input fields for the output records, bytes 20-27 and bytes
35-44. VAROUT2 will have RECFM=VB and LRECL=22. All of its records will be
22 bytes long (4-byte RDW plus 8-byte input field plus 10-byte input field).
v The third OUTFIL statement converts the fixed-length input data set to a
variable-length OUTFIL data set associated with ddname VAROUT3. VAROUT3
will have RECFM=VB and LRECL=64. VLTRIM=X'40' is used to remove the
trailing blanks from the variable-length output records. The records can vary
from 5 bytes long to 64 bytes long depending on the number of trailing blanks
in each record.
Example 14
OPTION
OUTFIL
OUTFIL
OUTFIL
COPY
FNAMES=OUT1,OUTREC=(DATE1(/),X,TIME1(:),X,1,80)
FNAMES=OUT2,OUTREC=(DATE2P,TIME3P,1,80)
FNAMES=OUT3,OUTREC=(DATE3(.),X,TIME2,X,1,80)
This example illustrates several different ways to insert timestamps into your
records.
The input data set has RECFM=FB and LRECL=80.
The first OUTFIL statement creates the data set associated with ddname OUT1.
This data set will have LRECL=100. Each output record will have a timestamp
consisting of the date and time of the run in the form C'yyyy/mm/dd hh:mm:ss '
(20 bytes), followed by the original input record (80 bytes).
The second OUTFIL statement creates the data set associated with ddname OUT2.
This data set will have LRECL=86. Each output record will have a timestamp
consisting of the date of the run in the form P'yyyymm' (4 bytes) and the time of
the run in the form P'hh' (2 bytes), followed by the original input record (80 bytes).
The third OUTFIL statement creates the data set associated with ddname OUT3.
This data set will have LRECL=94. Each output record will have a timestamp
388
Example 15
OPTION COPY
OUTREC FIELDS=(1,4,11,4,DT1,7,4,TM1,60:X)
OUTFIL NODETAIL,
TRAILER1=(//,
3:Earliest SMF timestamp is ,
MIN=(5,14,ZD,EDIT=(TTTT/TT/TT TT:TT:TT)),/,
3:Latest SMF timestamp is
MAX=(5,14,ZD,EDIT=(TTTT/TT/TT TT:TT:TT)))
This example illustrates how the earliest and latest timestamps from a set of SMF
records can be displayed.
The OUTREC statement uses the DT1 format to convert the SMF date in input
bytes 11-15 to a Z'yyyymmdd' value in bytes 5-12, and uses the TM1 format to
convert the SMF time in input bytes 7-10 to a Z'hhmmss' value in bytes 13-18.
The OUTFIL statement uses the Z'yyyymmddhhmmss' value created by OUTREC
in bytes 5-18 to determine the minimum (earliest) and maximum (latest)
timestamp, and displays those timestamps in a trailer record in the form
C'yyyy/mm/dd hh:mm:ss'.
The report might look as follows:
Earliest SMF timestamp is
Latest SMF timestamp is
2001/01/09 10:27:04
2001/04/24 06:13:22
Example 16
SORT FIELDS=(1,20,BI,A)
OUTFIL FNAMES=FUPPER,OUTREC=(1,80,TRAN=LTOU)
OUTFIL FNAMES=FHEX,OUTREC=(1,80,HEX)
This example illustrates two types of conversion for fixed length records: lowercase
to uppercase conversion and hex conversion.
The input data set has RECFM = FB and LRECL = 80.
The first OUTFIL statement creates the data set associated with ddname FUPPER.
This data set will have RECFM = FB and LRECL = 80. All of the lowercase
EBCDIC characters (a-z) from byte 1 to byte 80 will be converted to uppercase
EBCDIC characters (A-Z). Other characters will remain unchanged. For example,
the characters 'san jose, ca 95193' will be converted to 'SAN JOSE, CA 95193'.
The second OUTFIL statement creates the data set associated with ddname FHEX.
This data set will have RECFM = FB and LRECL = 160 (2 * 80 data bytes). Each
byte from 1 to 80 will be converted to the two bytes representing its hex value. For
example, the three characters 'A12' will be converted to the six characters 'C1F1F2'.
Example 17
OPTION COPY
OUTFIL FNAMES=VUPPER,OUTREC=(1,4,5,TRAN=UTOL)
OUTFIL FNAMES=VHEX,OUTREC=(1,4,5,HEX)
389
Example 18
SORT FIELDS=(22,8,CH,A)
OUTFIL FNAMES=SAMP1,REMOVECC,HEADER1=(Sample 1,2/),
STARTREC=120,SAMPLE=(20,4),
OUTREC=(1,8,9,5,PD,ZD,C***,14,50)
OUTFIL FNAMES=SAMP2,REMOVECC,HEADER1=(Sample 2,2/),
SAMPLE=1000,ENDREC=5001
This example illustrates how to take different "samples" of sorted output records.
Sorted records 120, 121, 122, 123, 140, 141, 142, 143, and so on will be reformatted
as indicated by the OUTREC parameter and written to the output data set
associated with SAMP1. The heading 'Sample 1' will appear before the sample
output records.
Sorted records 1, 1001, 2001, 3001, 4001 and 5001 will be written to the output data
set associated with SAMP2. The heading 'Sample 2' will appear before the sample
output records.
Example 19
OPTION COPY
OUTFIL FNAMES=R500,REPEAT=500
OUTFIL FNAMES=R100,OUTREC=(SEQNUM,4,ZD,80XFF),REPEAT=100
This example illustrates how one record can be used to generate many records.
The first OUTFIL statement writes each output record 500 times to the data set
associated with R500. Each set of 500 records will be identical.
The second OUTFIL statement writes each reformatted output record 100 times to
the data set associated with R100. Each set of 100 records will be identical except
for the sequence number. The 100 records written from the first output record will
have sequence numbers 1-100, the 100 records written from the second output
record will have sequence numbers 101-200, and so on.
Example 20
OPTION COPY
OUTFIL OMIT=(56,6,CH,EQ,C******),
OVERLAY=(121:SEQNUM,8,ZD,56:56,6,TRAN=UTOL)
This example illustrates how you can use the OVERLAY parameter with OUTFIL
to add sequence numbers at the end of your records, and to convert uppercase
EBCDIC characters to lowercase EBCDIC characters in certain columns, without
affecting the rest of the record.
390
Example 21
OPTION COPY
OUTFIL FNAMES=RPT1,
HEADER2=(1:Type,9:Date,21:Time,/,
1:----,9:--------,21:------),
IFTHEN=(WHEN=(5,2,BI,EQ,X0001),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:8,4,DT1,25:15,4,TM1)),
IFTHEN=(WHEN=(5,2,BI,EQ,X0002),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:12,8,DC1,25:12,8,TC1)),
IFTHEN=(WHEN=(5,2,BI,EQ,X0003),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:17,8,DE1,25:17,8,TE1)),
IFTHEN=(WHEN=NONE,
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:Cn/a,25:Cn/a))
OUTFIL FNAMES=RPT2,
HEADER2=(1:Type,9:Date,21:Time,/,
1:----,9:-------,21:--------),
IFTHEN=(WHEN=(5,2,BI,EQ,X0001),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:8,4,DT3,25:15,4,TM4)),
IFTHEN=(WHEN=(5,2,BI,EQ,X0002),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:12,8,DC3,25:12,8,TC4)),
IFTHEN=(WHEN=(5,2,BI,EQ,X0003),
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:17,8,DE3,25:17,8,TE4)),
IFTHEN=(WHEN=NONE,
BUILD=(1,4,5:5,2,BI,M11,LENGTH=4,
13:Cn/a,25:Cn/a))
This example illustrates how you can use IFTHEN clauses to reformat different
records in different ways.
The input data set has RECFM=VB and consists of several different types of input
records as follows:
v Type1: Has X'0001' in positions 5-6, a 4-byte SMF date in positions 8-11 and a
4-byte SMF time in positions 15-18.
v Type2: Has X'0002' in positions 5-6 and an 8byte TOD date and time in
positions 1219.
v Type3: Has X'0003' in positions 5-6 and an 8byte ETOD date and time in
positions 1724.
391
Date
-------20040827
20040907
n/a
20040901
20040731
n/a
Time
-----124531
230603
n/a
061559
152201
n/a
The first IFTHEN clause operates only against Type1 records; it converts the SMF
date using DT1 and the SMF time using TM1. The second IFTHEN clause only
operates against Type2 records; it converts the TOD date using DC1 and the TOD
time using TC1. The third IFTHEN clause only operates against Type3 records; it
converts the ETOD date using DE1 and the ETOD time using TE1. The fourth
IFTHEN clause operates against all other types of records; it uses 'n/a' for the date
and time.
The second OUTFIL statement produces a report with RECFM=VBA and
LRECL=33 that looks like this:
Type
---0001
0003
0008
0002
0001
0004
Date
------2004240
2004251
n/a
2004245
2004213
n/a
Time
-------12453184
23060373
n/a
06155903
15220150
n/a
The first IFTHEN clause operates only against Type1 records; it converts the SMF
date using DT3 and the SMF time using TM4. The second IFTHEN clause operates
only against Type2 records; it converts the TOD date using DC3 and the TOD time
using TC4. The third IFTHEN clause operates only against Type3 records; it
converts the ETOD date using DE3 and the ETOD time using TE4. The fourth
IFTHEN clause operates against all other types of records; it uses 'n/a' for the date
and time.
Example 22
OPTION COPY
OUTFIL BUILD=(1,80,SQZ=(SHIFT=LEFT,PAIR=APOST,MID=C,))
This example illustrates how you can create FB output records with comma
separated values from FB input records containing fields in fixed positions.
The 80-byte FB input records might look like this:
John Lewis
Ted Blank
Marilyn Carlson
Rex Otis
-12.83 Research
+128.37 Manufacturing
-282.83 Technical Support
+2.83 Marketing
Note that the data has three fields in fixed positions. The first field is a character
string surrounded by apostrophes. The second field is a numeric value. The third
field is another character string surrounded by apostrophes.
392
We use OUTFIL BUILD to build the output records with comma separated values.
We use SQZ to squeeze out the blanks between the fields, shift the remaining
characters to the left and insert commas between the fields. SHIFT=LEFT shifts the
characters to the left. PAIR=APOST ensures that blanks within paired apostrophes
are not squeezed out (for example, we want to keep the blank in the 'John Lewis'
field.) MID=C',' inserts a comma for each group of blanks removed between the
fields (for example, between 'John Lewis' and -12.83).
Example 23
OPTION COPY
OUTFIL IFTHEN=(WHEN=INIT,
OVERLAY=(5:5,18,JFY=(SHIFT=LEFT,LEAD=C,TRAIL=C),
34:34,19,JFY=(SHIFT=LEFT,LEAD=C,TRAIL=C))),
IFTHEN=(WHEN=INIT,
BUILD=(1,4,5,60,SQZ=(SHIFT=LEFT,PAIR=APOST,MID=C,))),
VLTRIM=C
This example illustrates how you can create VB output records with comma
separated values from VB input records containing fields in fixed positions.
The 84-byte VB input records might look like this (4-byte RDW followed by data):
Length
45
50
54
51
Data
John Lewis
Ted Blank
Marilyn Carlson
Rex Otis
-12.83 Research
+128.37 Manufacturing
-282.83 Technical Support
+2.83 Marketing
Note that the data has three fields in fixed positions. The first field is a character
string. The second field is a numeric value. The third field is another character
string. (In the previous example, the character strings were surrounded by
apostrophes; in this example the apostrophes must be added around the character
strings.)
The 84-byte VB output records are in the form of comma separated values as
follows:
Length
34
39
49
32
Data
John Lewis,-12.83,Research
Ted Blank,+128.37,Manufacturing
Marilyn Carlson,-282.83,Technical Support
Rex Otis,+2.83,Marketing
We use OUTFIL IFTHEN to ensure that short records are padded on the right with
blanks. (OUTFIL BUILD would terminate due to the short records.) WHEN=INIT
reformats every record. OVERLAY surrounds the character strings with
apostrophes. BUILD builds the output records with comma separated values.
We use JFY to surround the character strings with apostrophes without removing
embedded blanks (for example, John Lewis is changed to 'John Lewis'). After the
first IFTHEN, the records look like this:
393
Data
John Lewis
Ted Blank
Marilyn Carlson
Rex Otis
-12.83
+128.37
-282.83
+2.83
Research
Manufacturing
Technical Support
Marketing
We then use SQZ to squeeze out the blanks between the fields, shift the remaining
characters to the left and insert commas between the fields. SHIFT=LEFT shifts the
characters to the left. PAIR=APOST ensures that blanks within paired apostrophes
are not squeezed out (for example, we want to keep the blank in the 'John Lewis'
field.) MID=C',' inserts a comma for each group of blanks removed between the
fields (for example, between 'John Lewis' and -12.83).
Finally, we use VLRTIM=C' ' to remove trailing blanks at the end of each VB
record by adjusting its length appropriately.
Example 24
OPTION COPY
OUTFIL REMOVECC,
HEADER1=(C<?xml version="1.0"?>,/,
3:C<booklist>),
BUILD=(5:C<book>,/,
7:1,20,JFY=(SHIFT=LEFT,LEAD=C<title>,TRAIL=C</title>,
LENGTH=36),/,
7:24,15,SQZ=(SHIFT=LEFT,LEAD=C<author>,MID=C, ,
TRAIL=C</author>,LENGTH=33),/,
5:C</book>),
TRAILER1=(3:C</booklist>)
This example illustrates how you can generate XML statements from FB input
records containing fields in fixed positions.
The 40-byte FB input records might look like this:
Modern Poetry
Intro to Computers
Marketing
Friedman
KR
Chatterjee CL
Maxwell
G
Note that the data has three character fields in fixed positions.
The 42-byte FB output records look like this:
<?xml version="1.0"?>
<booklist>
<book>
<title>Modern Poetry</title>
<author>Friedman, KR</author>
</book>
<book>
<title>Intro to Computers</title>
<author>Chatterjee, CL</author>
</book>
<book>
<title>Marketing</title>
<author>Maxwell, G</author>
</book>
</booklist>
We use OUTFIL HEADER1 to generate the xml and booklist starting tags that
precede the set of tags for each record. We use OUTFIL BUILD to generate the set
of tags for each record as follows:
v A constant is used to generate the book starting tag.
394
Example 25
OPTION COPY
OUTFIL HEADER2=(1:First,13:Initial,22:Last,37:Score,/,
1:10-,13:7-,22:11-,35:7-),
PARSE=(%00=(STARTAFT=CLAST-> ,ENDBEFR=C ,FIXLEN=11),
%01=(STARTAFT=CFIRST-> ,ENDBEFR=C ,FIXLEN=11),
%02=(STARTAFT=CINITIAL-> ,ENDBEFR=C ,FIXLEN=7),
%03=(STARTAFT=CSCORE-> ,FIXLEN=7)),
BUILD=(1:%01,13:%02,22:%00,
35:%03,SFF,EDIT=(SIIIT.T),SIGNS=(,-))
This example illustrates how you can create a report from FB input records with
variable position/length fields, such as keyword delimited values.
The 70-byte input records might look like this:
LAST-> Clark
FIRST-> Oscar
INITIAL-> D
SCORE-> +98.2
LAST-> Roberts FIRST-> Harriet
INITIAL->
SCORE-> -152.6
LAST-> Stein FIRST-> Gertrude INITIAL-> V SCORE-> +5.1
Note that each record has four variable fields each identified by a specific
keyword. The fields do not start and end in the same position in every record and
they have different lengths in different records.
The output report has RECFM=FBA and LRECL=42 and looks like this:
First
Initial Last
---------- ------- ----------Oscar
D
Clark
Harriet
Roberts
Gertrude
V
Stein
Score
------98.2
-152.6
5.1
In order to create a report like this from variable position/length fields, we use
HEADER2 to create the page header, and PARSE and BUILD to create a fixed
parsed field from each variable field. We use %00 to create an 11-byte fixed parsed
field with the extracted 'LAST-> ' value. We use %01 to create an 11-byte fixed
parsed field with the extracted 'FIRST-> ' value. We use %02 to create a 7-byte
fixed parsed field with the extracted 'INITIAL-> ' value. We use %03 to create a
7-byte fixed parsed field with the extracted 'SCORE-> ' value. Since the fourth field
(%03) is extracted as signed and padded on the right with blanks, we treat it as
SFF format in order to edit it.
Chapter 3. Using DFSORT program control statements
395
Example 26
INREC IFTHEN=(WHEN=INIT,
PARSE=(%1=(FIXLEN=10,STARTAFT=CFirst=",ENDBEFR=C"))),
IFTHEN=(WHEN=INIT,
PARSE=(%2=(FIXLEN=10,STARTAFT=CMiddle=",ENDBEFR=C"))),
IFTHEN=(WHEN=INIT,
PARSE=(%3=(FIXLEN=10,STARTAFT=CLast=",ENDBEFR=C"))),
IFTHEN=(WHEN=INIT,
PARSE=(%4=(FIXLEN=10,STARTAFT=CWife=",ENDBEFR=C")),
BUILD=(%1,13:%2,25:%3,37:%4))
SORT FIELDS=(25,10,CH,A,1,10,CH,A,13,10,CH,A)
OUTFIL HEADER2=(First,13:Middle,
25:CLast,37:Wife,/,10C-,13:10C-,
25:10C-,37:10C-)
This example illustrates how you can create a sorted report from FB input records
with keyword values that can occur in any order or not occur at all.
The 80-byte input records might look like this:
Last="Buchanan" First="James"
Wife="Louisa" First="John" Middle="Quincy" Last="Adams"
First="George" Last="Washington" Wife="Martha"
Last="Clinton" Wife="Hillary" Middle="Jefferson" First="William"
First="John" Wife="Abigail" Last="Adams"
Note that each record has up to four variable fields each identified by a specific
keyword (First, Middle, Last, Wife). In each record, the fields can be in any order,
do not start and end in the same position and can have different lengths.
We want to sort the records by last name, first name and middle name, and create
a report with fixed headings and values for the first name, middle name, last name
and wife's name that looks like this:
First
Middle
---------- ---------John
John
Quincy
James
William
Jefferson
George
Last
---------Adams
Adams
Buchanan
Clinton
Washington
Wife
---------Abigail
Louisa
Hillary
Martha
In order to extract and sort variable fields like these, we use a separate IFTHEN
PARSE clause for each keyword. This allows us to find a particular keyword
anywhere in the record or ignore it if it is not in the record. If we used PARSE
instead of IFTHEN PARSE, a missing keyword would cause any keywords that
followed to be ignored. But because each IFTHEN PARSE starts scanning at
position 1 by default, we can look for each keyword independently of the others. If
a keyword is missing, the parsed field is set to all blanks (for example, %2 and %4
are set to blanks for the James Buchanan record).
We use %1 to create a 10-byte fixed parsed field into which we extract the first
name. We use %2 to create a 10-byte fixed parsed field into which we extract the
middle name. We use %3 to create a 10-byte fixed parsed field into which we
extract the last name. We use %4 to create a 10-byte fixed parsed field into which
we extract the wife's name. We use BUILD to reformat the records to contain the
fixed parsed fields. Then we SORT on the fixed parsed fields. Finally, we use
OUTFIL to create the headings.
396
Example 27
OPTION COPY
OUTFIL FINDREP=(INOUT=(CAM,CIN THE MORNING,
CPM,CIN THE EVENING),MAXLEN=70)
This example illustrates how you can replace values in FB or VB records with
larger values and shift the rest of the bytes to the right.
The 40 byte FB input records might look like this:
COFFEE AT 12:28 AM, TOAST AT 06:15 PM
MILK AT 03:17 PM, BAGELS AT 05:03 PM
PUDDING AT 09:32 AM
We want to replace each instance of 'AM' with 'IN THE MORNING' and each
instance of 'PM' with 'IN THE EVENING' and shift the bytes after 'AM' or 'PM' to
the right. We use INOUT to indicate find and replace pairs. Since replacing the
smaller values with the larger values can cause the remaining bytes to be shifted
beyond the end of the 40 byte record, we use MAXLEN to set the output record to
70 bytes to allow for the expansion, overriding the default of using the input
length for the output record.
The 70 byte FB output records look like this:
COFFEE AT 12:28 IN THE MORNING, TOAST AT 06:15 IN THE EVENING
MILK AT 03:17 IN THE EVENING, BAGELS AT 05:03 IN THE EVENING
PUDDING AT 09:32 IN THE MORNING
Example 28
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,8:5)),
IFTHEN=(WHEN=GROUP,BEGIN=(8,5,CH,EQ,CPAGE:),
PUSH=(5:SEQ=3))
OUTFIL INCLUDE=(5,3,ZD,EQ,2,OR,5,3,ZD,EQ,3),
BUILD=(1,4,5:8)
This example illustrates how you can INCLUDE specific relative records from
groups of VB records. We insert a sequence number between the RDW and the
first data byte of each record. The sequence number restarts at 1 for the first record
in each group. We INCLUDE on the sequence number and then remove it.
The VB input records might look like this:
Len|Data
12|PAGE: 1
22|LINE 1 OF REPORT A
22|LINE 2 OF REPORT A
22|LINE 3 OF REPORT A
22|LINE 4 OF REPORT A
|...
12|PAGE: 2
23|LINE 66 OF REPORT A
23|LINE 67 OF REPORT A
23|LINE 68 OF REPORT A
23|LINE 69 OF REPORT A
|...
12|PAGE: 3
24|LINE 131 OF REPORT A
24|LINE 132 OF REPORT A
24|LINE 133 OF REPORT A
24|LINE 134 OF REPORT A
|...
397
Note that positions 5-7 are blank and the 'PAGE:' characters have been shifted over
to positions 8-12.
We use an IFTHEN WHEN=GROUP clause to put a 3-byte sequence number in
each record. BEGIN indicates a group starts with a record that has 'PAGE:' in
positions 8-12. PUSH overlays a 3-byte sequence number at positions 5-7 of each
record. The sequence number starts at 1 for the first record of a group and is
incremented by 1 for each subsequent record of the group. After the IFTHEN
GROUP clause is executed, the intermediate records look like this:
Len|Data
15|001PAGE: 1
25|002LINE 1 OF REPORT A
25|003LINE 2 OF REPORT A
25|004LINE 3 OF REPORT A
25|005LINE 4 OF REPORT A
|006...
15|001PAGE: 2
26|002LINE 66 OF REPORT A
26|003LINE 67 OF REPORT A
26|004LINE 68 OF REPORT A
26|005LINE 69 OF REPORT A
|006...
15|001PAGE: 3
27|002LINE 131 OF REPORT A
27|003LINE 132 OF REPORT A
27|004LINE 133 OF REPORT A
27|005LINE 134 OF REPORT A
|006...
Note that the records in each group are numbered starting with 001 for the first
record of each group. The records we want have sequence numbers 002 and 003.
We use an OUTFIL statement to only INCLUDE the records with sequence number
002 or 003, and to remove the sequence numbers so the included output records
will be identical to the input records. After the OUTFIL statement is executed, the
final output records look like this:
Len|Data
22|LINE 1 OF REPORT A
22|LINE 2 OF REPORT A
398
66 OF REPORT A
67 OF REPORT A
131 OF REPORT A
132 OF REPORT A
Example 29
OPTION COPY
OUTFIL FNAMES=OUT1,INCLUDE=(11,3,CH,EQ,CD51),ACCEPT=3
OUTFIL FNAMES=OUT2,STARTREC=2,ACCEPT=5
This example illustrates how you can stop processing OUTFIL input records for
various groups in different ways.
The input data set has these records:
HEADER 2010/06/30
FRANK
D51
ED
D52
VICKY
D51
MARTIN
D52
LILY
D50
MARC
D51
JUNE
D51
LUCY
D51
TRAILER
8
The first OUTFIL statement uses INCLUDE to extract the D51 records and
ACCEPT=3 to only write the first three D51 records to OUT1. Thus, OUT1 will
have these records:
FRANK
VICKY
MARC
D51
D51
D51
The second OUTFIL statement uses STARTREC=2 to skip the HEADER record and
ACCEPT=5 to only write the next five records to OUT2. Thus, OUT2 will have
these records:
FRANK
ED
VICKY
MARTIN
LILY
D51
D52
D51
D52
D50
Example 30
OPTION COPY
OUTFIL FNAMES=OUT1,
INCLUDE=(3,4,CH,EQ,Ckey1),
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,CT),
TRLUPD=(6:COUNT=(M11,LENGTH=4),
14:TOT=(10,4,ZD,TO=ZD,LENGTH=6)))
OUTFIL FNAMES=OUT2,
INCLUDE=(3,4,CH,EQ,Ckey2),
IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,CT),
TRLUPD=(6:COUNT=(M11,LENGTH=4),
14:TOT=(10,4,ZD,TO=ZD,LENGTH=6)))
This example illustrates how you can split an input file with a header, and a trailer
containing a count and total for the input data records, into two output files each
of which has the header and a trailer with accurate count and total for the
included data records.
The input data set has RECFM=FB and LRECL=80 with these input records:
Chapter 3. Using DFSORT program control statements
399
2010/07/06
key1
0100
key2
0200
key2
0118
key1
0150
key1
0025
key2
1000
key2
0310
X 0007 QR 001903
D52-007-321-7526
The first record is a header record with a date. The records with D in position 1
are data records; they have key1 or key2 in positions 3-6 and an amount field in
positions 10-13.
The trailer record is identified by a 'T' in position 1. Positions 6-9 contain a count
(0007) of the data records, and positions 14-19 contain a total (001903) for the
amount fields in the data records. In addition, there are other static fields in the
trailer record that must not be changed. Note that IFTRAIL with HD=YES does not
process the header or trailer records as data records, so they are not included in
the count or total.
The first OUTFIL statement writes the header record, data records with key1, and
trailer record, in the OUT1 data set. The IFTRAIL operand is used to identify the
trailer (TRLID), indicate the first record is a header (HD=YES), and update the
count and total in the trailer (TRLUPD) to reflect the input data records included
in this output data set.
OUT1 will have these records:
H
D
D
D
T
2010/07/06
key1
0100
key1
0150
key1
0025
X 0003 QR 000275
D52-007-321-7526
The second OUTFIL statement writes the header record, data records with key2,
and trailer record, in the OUT2 data set. The IFTRAIL operand is used to identify
the trailer (TRLID), indicate the first record is a header (HD=YES), and update the
count and total in the trailer (TRLUPD) to reflect the input data records included
in this output data set. Note that IFTRAIL with HD=YES does not process the
header or trailer records as data records, so they are not included in the count or
total.
OUT2 will have these records:
H
D
D
D
D
T
2010/07/06
key2
0200
key2
0118
key2
1000
key2
0310
X 0004 QR 001628
D52-007-321-7526
Example 31
OPTION Y2PAST=1990
SORT FIELDS=(1,6,Y2W,A)
OUTFIL REMOVECC,
HEADER1=(1:Input,15:NEXTDFRI,25:PREVDSUN,35:LASTDAYQ),
BUILD=(1:1,6,Y2W,TOJUL=Y4W(-),
15:1,6,Y2W,NEXTDFRI,TOJUL=Y4W(-),
25:1,6,Y2W,PREVDSUN,TOJUL=Y4W(-),
35:1,6,Y2W,LASTDAYQ,TOJUL=Y4W(-))
400
The SORT statement sorts by the C'mmddyy' date. We use 1,6,Y2W for the sort
field to match the C'mmddyy' date.
The OUTFIL statement writes a heading and performs four operations on each
date. It converts the input date to C'ddd-yyyy' form, gets the next Friday date in
C'ddd-yyyy' form, gets the previous Sunday date in C'ddd-yyyy' form, and gets
the end of the quarter date in C'ddd-yyyy' form. We use 1,6,Y2W for the input
field to match the C'mmddyy' date, and we use TOJUL=Y4W(-) to give us a
C'ddd-yyyy' output date.
SORTOUT will have these records:
Input
000-0000
340-1999
075-2000
001-2005
084-2005
047-2010
271-2010
306-2010
999-9999
Note that the '000000' and '999999' input values are treated as special indicators for
output.
401
PARSE=( definition
,
FIELDS=
BUILD=
( item
,
OVERLAY=( item
,
FINDREP=( item
,
IFTHEN=(clause)
IFOUTLEN=n
The OUTREC control statement allows you to reformat the input records after they
are sorted, merged or copied.
The OUTREC control statement supports a wide variety of parsing, editing, and
reformatting tasks, including:
v The use of fixed position/length fields or variable position/length fields. For
fixed fields, you specify the starting position and length of the field directly. For
variable fields, such as delimited fields, comma separated values (CSV), tab
separated values, blank separated values, keyword separated fields,
null-terminated strings (and many other types), you define rules that allow
DFSORT to extract the relevant data into fixed parsed fields, and then use the
parsed fields as you would use fixed fields.
v Insertion of blanks, zeros, strings, current date, future date, past date, current
time, sequence numbers, decimal constants, and the results of arithmetic
expressions before, between, and after the input fields in the reformatted
records.
v Sophisticated conversion capabilities, such as find and replace, hexadecimal
display, bit display, translation of EBCDIC letters from lowercase to uppercase or
uppercase to lowercase, translation of characters from EBCDIC to ASCII and
from ASCII to EBCDIC, translation of characters using the ALTSEQ translation
table, conversion of numeric values from one format to another, left-justify or
left-squeeze (remove leading blanks or all blanks and shift left), and right-justify
or right-squeeze (remove trailing blanks or all blanks and shift right).
v Sophisticated editing capabilities, such as control of the way numeric fields are
presented with respect to length, leading or suppressed zeros, thousands
separators, decimal points, leading and trailing positive and negative signs, and
so on.
Twenty-seven pre-defined editing masks are available for commonly used
numeric editing patterns, encompassing many of the numeric notations used
throughout the world. In addition, a virtually unlimited number of numeric
editing patterns are available via the user-defined editing masks.
v Transformation of SMF, TOD, and ETOD date and time values to more usable
forms.
v Various types of arithmetic operations for input date fields.
402
v OVERLAY: Reformat each record by specifying just the items that overlay
specific columns. Overlay lets you change specific existing columns without
affecting the entire record. Example:
OUTREC OVERLAY=(45:45,8,TRAN=LTOU)
v FINDREP: Reformat each record by doing various types of find and replace
operations. Example:
OUTREC FINDREP=(IN=CMr.,OUT=CMister)
You can choose to include any or all of the following items in your reformatted
OUTREC records:
v Fixed position/length fields or variable position/length fields. For fixed fields,
you specify the starting position and length of the field directly. For variable
fields, such as delimited fields, comma separated values (CSV), tab separated
values, blank separated values, keyword separated fields, null-terminated strings
(and many other types), you define rules that allow DFSORT to extract the
relevant data into fixed parsed fields, and then use the parsed fields as you
would use fixed fields.
v Blanks, binary zeros, character strings, and hexadecimal strings
v Current date, future date, past date and current time in various forms
v Unedited input fields aligned on byte, halfword, fullword, and doubleword
boundaries
v Replaced or removed strings.
v Hexadecimal or bit representations of binary input fields
v Characters translated from uppercase to lowercase, lowercase to uppercase,
ASCII to EBCDIC or EBCDIC to ASCII.
v Left-justified, right-justified, left-squeezed, or right-squeezed input fields.
403
PARSE
404
%n=
%nn=
%nnn=
%=
FIXLEN=m
ABSPOS=p
ADDPOS=x
SUBPOS=y
,
STARTAFT=string
STARTAFT=an
STARTAFT=BLANKS
STARTAT=string
STARTAT=an
STARTAT=BLANKS
STARTAT=NONBLANK
,
ENDBEFR=string
ENDBEFR=an
ENDBEFR=BLANKS
ENDAT=string
ENDAT=an
ENDAT=BLANKS
PAIR=APOST
PAIR=QUOTE
REPEAT=v
This operand allows you to extract variable position/length fields into fixed
parsed fields. Parsed fields (%n, %nn or %nnn) can be used where fixed
position/length fields (p,m) can be used in the BUILD (or FIELDS) or
OVERLAY operands as described later in this section.
Note: Although you can use %n (%0-%9), %nn (%00-%99) or %nnn
(%000-%999) for a parsed field, for convenience in this book %nn will be used
in general when referring to a parsed field. %n, %0n or %00n can be used
interchangeably for parsed field n (for example, %1, %01 or %001 for parsed
field 1). %nn or %0nn can be used interchangeably for parsed field nn (for
example, %12 or %012 for parsed field 12).
PARSE can be used for many different types of variable fields including
delimited fields, comma separated values (CSV), tab separated values, blank
separated values, keyword separated fields, null-terminated strings, and so on.
You can assign up to 1000 parsed fields (%0-%999) to the variable fields you
want to extract.
Note that if all of the fields in your records have fixed positions and lengths,
you don't need to use PARSE. But if any of the fields in your records have
variable positions or lengths, you can use PARSE to treat them as fixed parsed
fields in BUILD or OVERLAY. You can mix p,m fields (fixed fields) and %nn
fields (parsed fields) in BUILD and OVERLAY.
See PARSE under "OUTFIL Control Statements" for complete details.
Sample Syntax:
OUTREC PARSE=(%200=(ENDBEFR=C*,FIXLEN=3),
%201=(ENDBEFR=BLANKS,FIXLEN=6),
%202=(STARTAT=CMAX,FIXLEN=8),
%203=(STARTAFT=C(,ENDBEFR=C),FIXLEN=6),
405
FIELDS=
BUILD=
(
c:
s
p,m
,a
%nn
p
p,m
%nn
p
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
Specifies all of the items in the reformatted OUTREC record in the order in
which they are to be included. The reformatted OUTREC record consists of the
separation fields, edited and unedited input fields (p,m for fixed fields, or %nn
for parsed fields - see PARSE), edited decimal constants, edited results of
arithmetic expressions, and sequence numbers you select, in the order in which
you select them, aligned on the boundaries or in the columns you indicate.
406
unedited RDW
display RDW length in decimal
| separator
display input positions 5 to end
For fixed-length records, the first input and output data byte starts at position
1. For variable-length records, the first input and output data byte starts at
position 5, after the RDW in positions 1-4.
The BUILD or FIELDS parameter of the OUTREC statement differs from the
BUILD or OUTREC parameter of the OUTFIL statement in the following ways:
v The BUILD or FIELDS parameter of the OUTREC statement applies to all
input records; the BUILD or OUTREC parameter of the OUTFIL statement
only applies to the OUTFIL input records for its OUTFIL group.
v The BUILD or OUTREC parameter of the OUTFIL statement supports the
slash (/) separator for creating blank records and new records; the BUILD or
FIELDS parameter of the OUTREC statement does not.
c:
specifies the position (column) for a separation field, input field decimal
constant, arithmetic expression, or sequence number, relative to the start of
the reformatted output record. Unused space preceding the specified
column is padded with EBCDIC blanks. The following rules apply:
v c must be a number between 1 and 32752.
v c: must be followed by a separation field, input field, decimal constant,
or arithmetic expression.
v c must not overlap the previous input field or separation field in the
reformatted output record.
v For variable-length records, c: must not be specified before the first input
field (the record descriptor word) nor after the variable part of the input
record.
v The colon (:) is treated like the comma (,) or semicolon (;) for
continuation to another line.
See Table 29 on page 130 for examples of valid and invalid column
alignment.
s
407
ONEILL
Specify:
CONEILL
See Table 32 on page 131 for examples of valid and invalid character
string separation.
nX'yy...yy'
Hexadecimal string separation. n repetitions of the hexadecimal string
constant (X'yy...yy') are to appear in the reformatted output records. n
can range from 1 to 4095. If n is omitted, 1 is used.
The value yy represents any pair of hexadecimal digits. You can
specify from 1 to 256 pairs of hexadecimal digits.
See Table 33 on page 132 for examples of valid and invalid
hexadecimal string separation.
408
409
p,m,a
specifies that an unedited input field is to appear in the reformatted output
record.
p
specifies the first byte of the input field relative to the beginning of the
input record.13 The first data byte of a fixed-length record has relative
position 1. The first data byte of a variable-length record has relative
position 5, because the first four bytes are occupied by the RDW. All fields
must start on a byte boundary, and no field may extend beyond byte
32752. See OUTREC statement notes on page 424 for special rules
concerning variable-length records.
specifies the length of the input field. It must include the sign if the data is
signed and must be a whole number of bytes. See OUTREC statement
notes on page 424 for more information.
13. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and
INREC is not specified, p must refer to the record as reformatted by your E15 user exit.
410
specifies that the unedited part of the variable input record (that part beyond
the minimum record length), is to appear in the reformatted output record, as
the last field. p without m can only be used for variable-length records; not for
fixed-length records.
Attention: If 1,4,p is specified (only RDW and variable part of record), null
records containing only an RDW will result if the record length is less than p.
A value must be specified for p that is less than or equal to the minimum
record length (RECORD statement L4 value) plus 1 byte.
p,m,TRAN=keyword
Specifies that an input field is to be translated as indicated by the keyword.
See p,m,TRAN=keyword under OUTFIL OUTREC for details.
%nn,TRAN=keyword
Specifies that a parsed input field is to be translated as indicated by the
keyword. See %nn,TRAN=keyword under OUTFIL OUTREC for details.
p,TRAN=keyword
Specifies that the variable part of the input record is to be translated as
indicated by the keyword. See p,TRAN=keyword under OUTFIL OUTREC for
details.
p,m,HEX
Can be used instead of p,m,TRAN=HEX. See p,m,HEX under OUTFIL
OUTREC for details.
%nn,HEX
Can be used instead of %nn,TRAN=HEX. See %nn,HEX under OUTFIL
OUTREC for details.
p,HEX
Can be used instead of p,TRAN=HEX. See p,HEX under OUTFIL OUTREC for
details.
p,m,f,edit or (p,m,f),edit
specifies that an edited numeric input field is to appear in the reformatted
output record. You can edit BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, SFF, DC1,
DC2, DC3, DE1, DE2, DE3, DT1, DT2, DT3, TC1, TC2, TC3, TC4, TE1, TE2,
TE3, TE4, TM1, TM2, TM3 or TM4 fields using either pre-defined edit masks
(M0-M26) or specific edit patterns you define. You can control the way the
edited fields look with respect to length, leading or suppressed zeros,
thousands separators, decimal points, leading and trailing positive and
negative signs, and so on.
See p,m,f,edit under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(5:(21,8,ZD),M19,X,46,5,ZD,M13,
31:35,4,FL,SIGNS=(,,+,-),LENGTH=10,
51:8,4,PD,EDIT=(**II,IIT.TTXS),SIGNS=(,,+,-))
%nn,f,edit or (%nn,f),edit
specifies that an edited numeric parsed input field is to appear in the
reformatted output record. See PARSE for details of parsed fields. See
p,m,f,edit or (p,m,f),edit for further details.
p,m,f,to or (p,m,f),to
specifies that a converted numeric input field is to appear in the reformatted
output record. You can convert BI, FI, PD, PD0, ZD, FL, CSF, FS, UFF, SFF,
411
%nn,f,to or (%nn,f),to
specifies that a converted numeric parsed input field is to appear in the
reformatted output record. See PARSE for details of parsed fields. See p,m,f,to
or (p,m,f),to for further details.
deccon,edit or (deccon),edit
specifies that an edited decimal constant is to appear in the reformatted output
record. The decimal constant must be in the form +n or -n where n is 1 to 31
decimal digits. The sign (+ or -) must be specified. A decimal constant
produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified.
See deccon,edit under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(-5000,EDIT=(-T,TT.T),21:(+0),M11,LENGTH=7)
deccon,to or (deccon),to
specifies that a converted decimal constant is to appear in the reformatted
output record. The decimal constant must be in the form +n or -n where n is 1
to 31 decimal digits. The sign (+ or -) must be specified. A decimal constant
produces a signed, 31-digit zoned decimal (ZD) result to be converted as
specified.
See deccon,to under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(+1,PD,LENGTH=6,(-1),PD,LENGTH=6,
-50,TO=ZD,LENGTH=8)
arexp,edit or (arexp),edit
specifies that the edited result of an arithmetic expression is to appear in the
reformatted output record. The arithmetic expression can consist of input
fields, decimal constants, operators and parentheses. An arithmetic expression
produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified.
See arexp,edit under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(C**,27,2,FI,SUB,
83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
25:(((15,5,ZD,MUL,+2),ADD,+100),MAX,62,2,PD),M25,LENGTH=12)
arexp,to or (arexp),to
specifies that the converted result of an arithmetic expression is to appear in
the reformatted output record. The arithmetic expression can consist of input
fields, decimal constants, operators and parentheses. An arithmetic expression
produces a signed, 31-digit zoned decimal (ZD) result to be converted as
specified.
See arexp,to under OUTFIL OUTREC for details.
Sample Syntax:
412
p,m,Y2x or p,m,Y4x
Specifies that an input date field is to be edited. Real Y2x dates are edited
using the century window established by the Y2PAST option in effect. Y2x and
Y4x dates with special indicators are expanded appropriately (for example,
p,6,Y2T transforms C'000000' to C'00000000').
See "p,m,Y2x or p,m,Y4x" under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC BUILD=(21,3,Y2U,X,3,8,Y4W)
%nn,Y2x or %nn,Y4x
Specifies that a parsed input date field is to be edited. See PARSE for details of
parsed fields. See "p,m,Y2x or p,m,Y4x" for further details.
p,m,Y2x,edit or p,m,Y4x,edit
Specifies that the output for a p,m,Yxx input date field is to be edited
according to the edit parameters you specify. For example, if you specify:
OUTREC BUILD=(28,5,Y4V,EDIT=(TTTT-TT-TT)
413
%nn,Y2x,todate or %nn,Y4x,todate
Specifies that an input date field of one type is to be converted to a
corresponding output date field of another type. See PARSE for details of
parsed fields. See "p,m,Y2x,todate or p,m,Y4x,todate" for further details.
p,m,Y2x,dateop or p,m,Y4x,dateop
Specifies an arithmetic operation for an input date field. See "p,m,Y2x,dateop
or p,m,Y4x,dateop" under OUTFIL OUTREC for details.
%nn,Y2x,dateop or %nn,Y4x,dateop
Specifies an arithmetic operation for a parsed input date field. See
"%nn,Y2x,dateop or %nn,Y4x,dateop" under OUTFIL OUTREC for details.
p,m,Y2x(s) or p,m,Y4x(s)
Specifies that an input date field is to be edited with separators. s can be any
character except a blank. Real Y2x dates are edited using the century window
established by the Y2PAST option in effect. Y2x and Y4x dates with special
indicators are expanded appropriately (for example, p,8,Y4T(s) transforms
C'00000000' to C'0000/00/00').
See "p,m,Y2x(s) or p,m,Y4x(s)" under OUTFIL OUTREC for details.
Sample Syntax:
* Convert a Zdddccyy date to a Cddd/ccyy date.
OUTREC BUILD=(19,7,Y4W(/),X,
* Convert a Pccyymmdd date to a Cccyy-mm-dd date.
43,5,Y4V(-))
%nn,Y2x(s) or %nn,Y4x(s)
Specifies that a parsed input date field is to be edited with separators. See
PARSE for details of parsed fields. See "p,m,Y2x(s) or p,m,Y4x(s)" for further
details.
p,m,Y2xP
Specifies that an input date field is to be converted to a packed decimal output
date field. Real Y2x dates are edited using the century window established by
the Y2PAST option in effect. Y2x and Y4x dates with special indicators are
expanded appropriately (for example, p,6,Y2TP transforms C'000000' to
P'00000000').
See "p,m,Y2xP" under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC BUILD=(11,3,Y2XP,X,21,4,Y2WP)
%nn,Y2xP
Specifies that a parsed input date field is to be converted to a packed decimal
output date field. See PARSE for details of parsed fields. See "p,m,Y2xP" for
further details.
p,m,lookup or %nn,lookup
specifies that a character constant, hexadecimal constant, input field (p,m) or
parsed input field (%nn) from a lookup table is to appear in the reformatted
output record. You can use p,m,lookup or %nn,lookup to select a specified
character set constant (that is, a character or hexadecimal string) or set field
414
p,m,justify
specifies that a left-justified or right-justified input field is to appear in the
reformatted output record. For a left-justified field, leading blanks are removed
and the characters from the first nonblank to the last nonblank are shifted left,
with blanks inserted on the right if needed. For a right-justified field, trailing
blanks are removed and the characters from the last nonblank to the first
nonblank are shifted right, with blanks inserted on the left if needed.
Optionally:
v specific leading and trailing characters can be changed to blanks before
justification begins
v a leading string can be inserted
v a trailing string can be inserted
v the output length can be changed (it's equal to the input length by default)
See p,m,justify under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(1,10,
21,20,JFY=(SHIFT=LEFT),5X,
52,12,JFY=(SHIFT=RIGHT,PREBLANK=C+,LEAD=C$,TRAIL=C.00))
%nn,justify
specifies that a left-justified or right-justified parsed input field is to appear in
the reformatted output record. See PARSE for details of parsed fields. See
p,m,justify for further details.
p,m,squeeze
specifies that a left-squeezed or right-squeezed input field is to appear in the
reformatted output record. For a left-squeezed field, all blanks are removed
and the characters from the first nonblank to the last nonblank are shifted left,
with blanks inserted on the right if needed. For a right-justified field, all blanks
are removed and the characters from the last nonblank to the first nonblank
are shifted right, with blanks inserted on the left if needed. Optionally:
v specific characters can be changed to blanks before squeezing begins
v a leading string can be inserted
v a trailing string can be inserted
v a string (for example, a comma delimiter) can be inserted wherever a group
of blanks is removed between the first nonblank and the last nonblank.
v blanks can be kept as is between paired apostrophes ('AB CD EF') or paired
quotes ("AB CD EF")
Chapter 3. Using DFSORT program control statements
415
%nn,squeeze
specifies that a left-squeezed or right-squeezed parsed input field is to appear
in the reformatted output record. See PARSE for details of parsed fields. See
p,m,squeeze for further details.
seqnum
specifies that a sequence number is to appear in the reformatted output record.
The sequence numbers are assigned in the order in which the records are
received for OUTREC processing. You can create BI, PD, ZD, CSF, or FS
sequence numbers and control their lengths, starting values and increment
values. You can restart the sequence number at the start value each time a
specified input field (p,m) or parsed input field (%nn) changes.
See seqnum under OUTFIL OUTREC for details.
Sample Syntax:
OUTREC FIELDS=(SEQNUM,6,ZD,START=1000,INCR=50,RESTART=(21,5),1,60)
416
s
p,m
,a
%nn
p,m
%nn
,TRAN
LTOU
UTOL
ALTSEQ
ATOE
ETOA
HEX
UNHEX
BIT
UNBIT
p,m
,HEX
%nn
p,m,f
,edit
%nn,f
,to
(p,m,f)
(%nn,f)
deccon
,edit
(deccon)
,to
arexp
,edit
(arexp)
,to
p,m
,Y2x
%nn
,Y4x
,edit
,to
,todate
,dateop
,Y2x(s)
,Y4x(s)
,Y2xP
p,m
,lookup
%nn
p,m
,justify
%nn
p,m
,squeeze
%nn
seqnum
417
and input position 5 has 'A'. The second item (UTOL) would change 'A' to 'a'
and the third item (CHANGE) would change 'a' again to 'X'.
If you specify an OVERLAY item that extends the overlay record beyond the
end of the input record, the reformatted record length is automatically
increased to that length, and blanks are filled in on the left as needed. For
variable-length records, the RDW length is also increased to correspond to the
larger reformatted record length after all of the OVERLAY items are processed.
For example, if your input record has a length of 40 and you specify:
OUTREC OVERLAY=(16:CABC,51:5C*,35:15,2)
the output record is given a length of 55. Blanks are filled in from columns
41-50. For variable-length records, the length in the RDW is changed from 40
to 55 after all of the OVERLAY items are processed.
Missing bytes in specified input fields are replaced with blanks so the padded
fields can be processed.
The OVERLAY parameter of the OUTREC statement applies to all input
records whereas the OVERLAY parameter of the OUTFIL statement only
applies to the OUTFIL input records for its OUTFIL group.
See OUTREC FIELDS for details of the items listed in the OVERLAY syntax
diagram shown previously in this section. You can specify all of the items for
OVERLAY in the same way that you can specify them for BUILD or FIELDS
with the following exceptions:
v You cannot specify p or p,HEX or p,TRAN=keyword for OVERLAY.
v For p,m,H or p,m,F or p,m,D specified for OVERLAY, fields are aligned as
necessary without changing the preceding bytes.
v For variable-length records, you must not overlay positions 1-4 (the RDW)
for OVERLAY, so be sure to specify the first column (c:) as 5 or greater. If
you do not specify the first column, it will default to 1: which is invalid for
variable-length records with OVERLAY. Whereas FIELDS=(1,m,...) is
required, OVERLAY=(1,m) is not allowed since it would overlay the RDW.
Sample Syntax:
Fixed input records:
OUTREC OVERLAY=(21:21,4,ZD,TO=PD,LENGTH=4,
2:5,8,HEX,45:C*,32,4,C*,81:SEQNUM,5,ZD)
418
IN=incon,OUT=outcon
,
IN=( incon
,
,OUT=outcon
INOUT=( incon,outcon
)
,
STARTPOS=p
ENDPOS=q
DO=n
MAXLEN=n
OVERRUN=ERROR
OVERRUN=TRUNC
SHIFT=YES
SHIFT=NO
You can use FINDREP to find constants anywhere in a record and replace
them with other constants of the same or different lengths. You can find
character or hexadecimal input constants anywhere in your records and replace
them with character, hexadecimal or null output constants. As appropriate,
bytes can be shifted left or right, blank padding can be added for fixed-length
records, and the length can be changed for variable-length records.
Various options of FINDREP allow you to define one or more input constants
and a corresponding output constant, define one or more pairs of input and
output constants, start and end the find scan at specified positions, stop after a
specified number of constants are replaced, increase or decrease the length of
the output record, define the action to be taken if nonblank characters overrun
the end of the record, and specify whether output constants are to replace or
overlay input constants.
See FINDREP under "OUTFIL Control Statements" for complete details.
Sample Syntax:
OUTREC FINDREP=(INOUT=(CGoodbye,CBye,CHello,CHi))
419
IFTHEN=(
WHEN=INIT
,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
WHEN=GROUP ,BEGIN=(logexp) ,PUSH=(items)
,KEYBEGIN=(p,m)
,END=(logexp)
,RECORDS=n
WHEN=(logexp) ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=ANY ,PARSE=(definitions)
,BUILD=(items)
,HIT=NEXT
,OVERLAY=(items)
,FINDREP=(items)
WHEN=NONE ,PARSE=(definitions)
,BUILD=(items)
,OVERLAY=(items)
,FINDREP=(items)
420
421
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
A
B
B
C
A
C
B
D
1
1
2
1
2
2
3
1
0001
0001
0002
0001
0002
0002
0003
0003
Separate SEQNUM counters are kept for the 'A' record, for the 'B' record, and
for the NONE records.
The IFTHEN clauses of the OUTREC statement apply to all input records
whereas the IFTHEN clauses of the OUTFIL statement only apply to the
OUTFIL input records for its OUTFIL group.
WHEN=INIT clause
See "WHEN=INIT clause" under OUTFIL IFTHEN for details. Note that /
cannot be used to create blank records or new records.
Sample Syntax:
422
WHEN=GROUP clause
See "WHEN=GROUP clause" under OUTFIL IFTHEN for details.
Sample Syntax
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,40,SS,EQ,CJ82,OR,1,40,SS,EQ,CM72),
PUSH=(41:ID=5))
WHEN=(logexp) clause
See "WHEN=(logexp) clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with
OUTFIL, it cannot be used with OUTREC.
Sample Syntax:
OUTREC IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,LE,+2000),OVERLAY=(42:CType1 <= 2000),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X03),
BUILD=(1,21,42,13)),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,
18,4,ZD,GT,+2000),OVERLAY=(42:CType1 > 2000 ),HIT=NEXT),
IFTHEN=(WHEN=(1,3,CH,EQ,CT01,AND,6,1,BI,BO,X01),
BUILD=(1,25,42,13))
WHEN=ANY clause
See "WHEN=ANY clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with
OUTFIL, it cannot be used with OUTREC.
Sample Syntax:
OUTREC IFTHEN=(WHEN=(1,3,SS,EQ,CT01,T02,T03),
BUILD=(CGroup A,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=(1,3,SS,EQ,CT04,T05,T06),
BUILD=(CGroup B,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=(1,3,SS,EQ,CT07,T08,T09,T10),
BUILD=(CGroup C,X,1,80),HIT=NEXT),
IFTHEN=(WHEN=ANY,OVERLAY=(16:CGroup Found)
WHEN=NONE clause
See "WHEN=NONE clause" under OUTFIL IFTHEN for details. Note that
although / can be used to create blank records and new records with
OUTFIL, it cannot be used with OUTREC.
Sample Syntax:
OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,20,21:CDepartment,31:3X,21,60)),
IFTHEN=(WHEN=(5,2,CH,EQ,CD1),OVERLAY=(31:8,3)),
IFTHEN=(WHEN=(5,2,CH,EQ,CD2),OVERLAY=(31:12,3)),
IFTHEN=(WHEN=NONE,OVERLAY=(31:C***))
Overrides the OUTREC LRECL (or reformatted record length if the OUTREC
record is further modified) determined by DFSORT from your OUTREC
Chapter 3. Using DFSORT program control statements
423
specifies the length to use for the OUTREC LRECL (or for the reformatted
record length if the OUTREC record is further modified) . The value for n
must be between 1 and 32767, but must not be larger than the maximum
LRECL allowed for the RECFM, and must not conflict with the specified or
retrieved LRECL for the fixed-length output data set.
Sample Syntax:
OUTREC IFOUTLEN=70,
IFTHEN=(WHEN=(5,1,CH,EQ,C1,AND,8,3,ZD,EQ,+10),
BUILD=(1,40,CT01-GROUP-A,65)),
IFTHEN=(WHEN=(5,1,CH,EQ,C2,AND,8,3,ZD,EQ,+12),
BUILD=(1,40,CT02-GROUP-B,65))
Default for IFOUTLEN: The LRECL determined from the IFTHEN clauses.
424
v
v
v
With OVERLAY, the variable part of the input record must not be included in
the reformatted record.
If INREC with FIELDS or BUILD and OUTREC with FIELDS and BUILD are
specified, either both must specify position-only for the last part, or neither must
specify position-only for the last part. OVERLAY or IFTHEN, and FIELDS or
BUILD, can differ with respect to position-only. See INREC statement notes on
page 148 for more details.
If the reformatted record includes only the RDW and the variable part of the
input record, null records containing only an RDW may result.
The reformatted output records are in the format specified by OUTREC
regardless of whether INREC was specified.
Fields referenced in OUTREC statements can overlap each other or control fields.
v If input is variable records, the output is also variable. This means that each
record is given the correct RDW by DFSORT before output.
v When OUTREC is specified, your E35 user exit routine must refer to fields in the
reformatted output record.
v DFSORT issues a message and terminates processing if an OUTREC statement is
specified for a tape work data set sort or conventional merge application.
v When you specify OUTREC, VLSHRT is not used. If VLSHRT is specified, it is
ignored.
v If SZERO is in effect, -0 is treated as negative and +0 is treated as positive for
edited or converted input fields, decimal constants, and the results of arithmetic
expressions. If NOSZERO is in effect, -0 and +0 are treated as positive for edited
or converted input fields, decimal constants, and the results of arithmetic
expressions.
v If SZERO is in effect, -0 compares as less than +0 when numeric fields and
constants are used. If NOSZERO is in effect, -0 compares as equal to +0 when
numeric fields and constants are used.
Note: OPTION SZERO or OPTION NOSZERO is ignored for OUTREC
IFTHEN=(WHEN=(logexp),...) unless the OPTION statement is found in a higher
source (for example, DFSPARM is a higher source than SYSIN) or before the
OUTREC statement in the same source. For example, NOSZERO will be used in
both of the following cases:
Case 1:
//DFSPARM DD *
OPTION COPY,NOSZERO
/*
//SYSIN DD *
OUTREC IFTHEN=(WHEN=(1,2,FS,EQ,+0),OVERLAY=(22:CYes)),
IFTHEN=(WHEN=NONE,OVERLAY=(22:CNo ))
/*
Case 2:
Chapter 3. Using DFSORT program control statements
425
Example 1
OUTREC FIELDS=(11,32)
This statement specifies that the output record is to contain 32 bytes beginning
with byte 11 of the input record. This statement can be used only with fixed-length
input records, because it does not include the first 4 bytes.
Example 2
OUTREC FIELDS=(1,4,11,32,D,101)
This statement is for variable-length records of minimum length 100 bytes, and
specifies that the output record is to contain an RDW plus 32 bytes of the input
record starting at byte 11 (aligned on a doubleword boundary, relative to the start
of the record) plus the entire variable portion of the input record.
Example 3
OUTREC FIELDS=(1,42,D,101)
This statement is for variable-length records of minimum length 100 bytes, and
specifies that the output record should contain an RDW plus the first 38 data bytes
of the input record plus the entire variable portion of the input record.
The 'D' parameter has no effect because the first field is always placed at the
beginning of the output record.
Example 4
SORT FIELDS=(20,4,CH,D,10,3,CH,D)
OUTREC FIELDS=(7:20,4,C FUTURE ,20,2,10,3,1Z,1,9,13,7,
24,57,TRAN=LTOU,6XFF)
This example illustrates how a fixed-length input data set can be sorted and
reformatted for output. The SORTIN LRECL is 80 bytes.
The reformatted output records are fixed length with a record size of 103 bytes.
SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is
specified or available, it will automatically be set to the reformatted record length
of 103. The reformatted records look as follows:
Position
Contents
426
1-6
7-10
19-20
21-23
24
Binary zero
25-33
34-40
41-97
Example 5
SORT FIELDS=(12,4,PD,D)
RECORD TYPE=V,LENGTH=(,,,100)
OUTREC FIELDS=(1,7,5Z,5X,28,8,6X,101)
This example illustrates how a variable-length input data set can be sorted and
reformatted for output. The variable part of the input records is included in the
output records. The minimum input record size is 100 bytes and the maximum
input record size (SORTIN LRECL or maximum record size for VSAM) is 200
bytes.
The reformatted output records are variable-length with a maximum record size of
131 bytes. The reformatted records look as follows:
Position
Contents
1-4
5-7
8-12
Binary zeros
13-17
EBCDIC blanks
18-25
26-31
EBCDIC blanks
32-n
Example 6
MERGE FIELDS=(28,4,BI,A)
OUTREC BUILD=(1,4,5Z,5X,5,3,28,8,6Z,DATE3-1)
This example illustrates how input files can be merged and reformatted for output,
with yesterday's date included. The variable part of the input records is not to be
included in the output records. The SORTINnn LRECL is 50 bytes.
The reformatted output records are variable-length with a maximum record size of
38 bytes. The reformatted records look as follows:
Position
Contents
1-4
5-9
Binary zeros
Chapter 3. Using DFSORT program control statements
427
EBCDIC blanks
15-17
18-25
26-31
Binary zeros
32-38
Example 7
OPTION COPY,Y2PAST=1985
OUTREC FIELDS=(SEQNUM,8,ZD,START=1000,INCR=100,
11:8,4,PD,M12,
31:15,4,Y2V(/),
51:2,1,CHANGE=(3,
X01,CL92,X02,CM72,X03,CJ42),
NOMATCH=(C???))
This example illustrates how a sequence number can be generated, how numeric
and date values can be edited, and how a lookup table can be used.
The reformatted output records look as follows:
Position
Contents
1-8
1120
31-40
5153
Example 8
SORT FIELDS=(11,4,CH,D)
OUTREC FIELDS=(1,20,
(5,4,FI,ADD,3,2,FI,ADD,23,2,FI),DIV,+1000,
EDIT=(STTTTTTT),SIGNS=(,-),2X,
9,5,ZD,MIN,16,5,FS,TO=ZD,LENGTH=5,2X,
21,40)
This example illustrates how input records can be reformatted for output to
contain the results of arithmetic expressions involving input fields, decimal
constants, operators and parentheses.
The reformatted output records look as follows:
Position
Contents
428
1-20
21-28
29-30
EBCDIC blanks
36-37
EBCDIC blanks
38-77
Example 9
OPTION COPY
OUTREC IFTHEN=(WHEN=(3,2,SS,EQ,CFR,MX,GR),
OVERLAY=(11:DATE=(DM4.),TIME1(.))),
IFTHEN=(WHEN=(3,2,SS,EQ,CCN,US,EN),
OVERLAY=(11:DATE=(4MD/),TIME1(:)))
This example illustrates how you can use IFTHEN clauses with OUTREC to
reformat different records in different ways.
For records with 'FR', 'GR' or 'MX' in positions 3-4, positions 11-20 of the
reformatted output records are overlaid with a date of the form 'dd.mm.yyyy' and
positions 21-28 are overlaid with a time of the form 'hh.mm.ss'. The data before
positions 11-28 and after positions 11-28 are not affected.
For records with 'CN', 'US' or 'EN' in positions 3-4, positions 11-20 of the
reformatted output records are overlaid with a date of the form 'yyyy/mm/dd'
and positions 21-28 are overlaid with a time of the form 'hh:mm:ss'. The data
before positions 11-28 and after positions 11-28 are not affected.
Since an IFTHEN clause with WHEN=NONE is not specified, records without 'FR',
'GR', 'MX', 'CN', 'US' or 'EN' in positions 3-4 are not changed.
Example 10
OPTION COPY
OUTREC OVERLAY=(31:11,10,ZD,DIV,+1200,TO=PD,LENGTH=6,
37:11,10,ZD,MOD,+1200,TO=PD,LENGTH=4)
This example illustrates how you can use the OVERLAY parameter with OUTREC
to change certain columns in your records without affecting other columns.
Positions 31-36 of the reformatted input records are overlaid with a 6-byte PD
value equal to the quotient of the 10-byte ZD value at positions 11-20 divided by
+1200. Positions 37-40 of the reformatted input records are overlaid with a 4-byte
PD value equal to the remainder of the 10-byte ZD value at positions 11-20 divided
by +1200. The data before positions 31-40 and after positions 31-40 are not affected.
Example 11
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,
OVERLAY=(81:11,10,
11:81,10,ZD,DIV,+1200,TO=PD,LENGTH=6,
17:81,10,ZD,MOD,+1200,TO=PD,LENGTH=4)),
IFOUTLEN=80
429
Example 12
OPTION COPY
OUTREC OVERLAY=(11:11,16,JFY=(SHIFT=RIGHT,LEAD=C(,
TRAIL=C),LENGTH=18))
This example illustrates how you can right-justify fields within your records.
The 50-byte FB input records might look like this:
0001
0002
0003
0004
9-1-632-731
011-276-321-7836
753-218-307
528-314
Note that the second field has left-justified numeric values in various forms. We
want to right-justify these values and surround them with a left parenthesis and
right parenthesis.
The 50-byte FB output records look like this:
0001
0002
0003
0004
(9-1-632-731)
(011-276-321-7836)
(753-218-307)
(528-314)
We use OUTFIL OVERLAY to limit the changes to the second field. We use JFY to
right-justify the second field with surrounding parentheses. SHIFT=RIGHT shifts
the characters to the right. LEAD=C'(' adds a left parenthesis before the first
non-blank character. TRAIL=C')' adds a right parenthesis after the last non-blank
character. LENGTH=18 increases the output length by 2 bytes to allow for the
parentheses (overriding the default of 16 from the input length).
Example 13
OPTION COPY
OUTREC PARSE=(%01=(ABSPOS=2,FIXLEN=13,ENDBEFR=C","),
%=(ENDBEFR=C","),
%03=(FIXLEN=6,ENDBEFR=C","),
430
This example illustrates how you can reformat records containing variable
position/length fields, such as comma separated values.
The 80-byte input records might look like this:
"Buffy
"Bruce
"Clark
"Diana
Summers","F","+725.8","-27.3","Sunnydale"
Wayne","M","-5.3","-173.2","Gotham City"
Kent","M","+21.3","-15.8","Metropolis"
Prince","F","-16.4","+128.9","Gateway City"
Note that each record has five variable fields, each enclosed in quotes and
separated by a comma. The fields do not start and end in the same position in
every record and they have different lengths in different records.
The 42-byte output records should look like this:
Buffy
Bruce
Clark
Diana
Summers
Wayne
Kent
Prince
698.5
-178.5
5.5
112.5
Sunnydale
Gotham City
Metropolis
Gateway City
The first fixed-length output field corresponds to the first variable input field. The
second fixed-length output field corresponds to the total of the third and fourth
variable input fields. The third fixed-length output field corresponds to the fifth
variable input field.
In order to reformat the input records for output, we use PARSE and BUILD to
create the fixed parsed fields we need from the variable position/length fields; the
quotes around each value are removed. %00 is used for the first input field. % is
used to ignore the second input field. %03 and %04 are used for the third and
fourth input fields which are added together using SFF format. %05 is used for the
fifth input field.
Example 14
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,
PARSE=(%100=(FIXLEN=3,ENDBEFR=C.,REPEAT=3),
%103=(FIXLEN=3)),
BUILD=(%100,4:C.,5:%101,8:C.,9:%102,12:C.,13:%103)),
IFTHEN=(WHEN=(1,3,CH,EQ,C167,AND,13,3,CH,EQ,C99),
OVERLAY=(5:C113,9:C75 ,1:1,15,SQZ=(SHIFT=LEFT))),
IFTHEN=(WHEN=NONE,
BUILD=(1:1,15,SQZ=(SHIFT=LEFT)))
This example illustrates how you can modify variable position/length fields, such
as ftp addresses.
The 15-byte input records might look like this:
167.113.117.99
167.90.18.99
167.80.118.98
165.250.89.562
167.125.890.95
168.250.89.99
167.125.890.99
0.0.0.0
167.90.580.99
Chapter 3. Using DFSORT program control statements
431
In order to reformat the input records for output, we use IFTHEN clauses as
follows:
v IFTHEN WHEN=INIT clause: We PARSE the four variable numeric values into
four 3-byte fixed parsed fields using %100, %101, %102 and %103 respectively.
Note that we use REPEAT=3 with the %100 parsed field to repeat it for the %101
and %102 parsed fields. REPEAT=n is useful when you have several contiguous
parsed fields with the same operands).
We reformat the record with %100, a period, %101, a period, %102, a period and
%103. At this point, the reformatted records look like this:
167.113.117.99
167.90 .18 .99
167.80 .118.98
165.250.89 .562
167.125.890.95
168.250.89 .99
167.125.890.99
0 .0 .0 .0
167.90 .580.99
v IFTHEN WHEN=(logexp) clause: If the first fixed-length field is '167' and the
fourth fixed-length field is '99 ', we overlay the second fixed-length field with
'113' and the third fixed-length field with '75'. Then we squeeze the fields to the
left to remove the blanks.
v IFTHEN WHEN=NONE clause: If the first fixed-length field is not '167' or the
fourth fixed-length field is not '99 ', we squeeze the fields to the left to remove
the blanks.
Example 15
SORT FIELDS=(1,2,CH,A)
OUTREC FINDREP=(IN=C*,OUT=C )
This example illustrates how you can replace a character with another character
anywhere in FB or VB records.
The FB input records might look like this:
05 ***** JUNE ***************
02
* APRIL *
01* * * * DAISY * * * *
03BETTY ***********
432
Example 16
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,CHDR),
END=(1,3,CH,EQ,CTRL),PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C ),BUILD=(1,30)
This example illustrates how you can INCLUDE groups of FB records between a
header and a trailer. We add an ID after the end of each record to indicate whether
it's part of a group or not, INCLUDE on the ID, and then remove it.
The 30-byte FB input records might look like this:
C33
HDR
A01
B02
C03
TRL
R24
T02
HDR
D04
E05
TRL
F97
Not in a group
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Not in a group
Not in a group
Start Group 2
Group 2 record
Group 2 record
End Group 2
Not in a group
In the output data set we only want to include groups of records that start with
'HDR' and end with 'TRL'.
We use an IFTHEN WHEN=GROUP clause to put a non-blank character in each
record that is part of a group. BEGIN indicates a group starts with a record that
has 'HDR' in positions 1-3. END indicates a group ends with a record that has
'TRL' in positions 1-3. PUSH overlays a 1-byte ID character at position 31 in each
record of a group (after the end of the record). After the IFTHEN GROUP clause is
executed, the intermediate records look like this:
C33
HDR
A01
B02
C03
TRL
R24
T02
HDR
D04
E05
TRL
F97
Not in a group
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Not in a group
Not in a group
Start Group 2
Group 2 record
Group 2 record
End Group 2
Not in a group
1
1
1
1
1
2
2
2
2
Note that the records within a group have a non-blank character in position 31
whereas the records outside groups have a blank character in position 31. The ID
starts at 1 for the first group and is incremented by 1 for each subsequent group.
Since we are only allowing one character for the ID, when the ID counter gets to
10, a '0' will appear in position 31. That's fine since we are just looking for a
non-blank to indicate a record within a group, or a blank to indicate a record
outside of a group.
433
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Start Group 2
Group 2 record
Group 2 record
End Group 2
Example 17
OPTION COPY
OUTREC IFTHEN=(WHEN=INIT,BUILD=(1,4,6:5)),
IFTHEN=(WHEN=GROUP,BEGIN=(6,3,CH,EQ,CHDR),
END=(6,3,CH,EQ,CTRL),PUSH=(5:ID=1))
OUTFIL INCLUDE=(5,1,CH,NE,C ),BUILD=(1,4,5:6)
This example illustrates how you can INCLUDE groups of VB records between a
header and a trailer. It's similar to Example 16, but here the records are
variable-length. For the FB records, we could add the ID after the end of each
record and then remove it without changing the records. But we can't add the ID
at the end of each VB record because that would pad all of the records to a fixed
length. So, instead we insert the ID between the RDW and the first data byte of
each record, and later remove it.
The VB input records might look like this:
Len|Data
23|C33
23|HDR
25|A01
25|B02
25|C03
21|TRL
23|R24
23|T02
23|HDR
25|D04
25|E05
21|TRL
25|F97
Not in a group
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Not in a group
Not in a group
Start Group 2
Group 2 record
Group 2 record
End Group 2
Not in a group
In the output data set we only want to include groups of records that start with
'HDR' and end with 'TRL'.
We use an IFTHEN WHEN=INIT clause to reformat each record so it has room for
the ID byte between the RDW and the first data byte. After the WHEN=INIT
clause is executed, the intermediate records look like this:
Len|Data
24| C33
24| HDR
26| A01
26| B02
26| C03
22| TRL
24| R24
24| T02
24| HDR
434
Not in a group
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Not in a group
Not in a group
Start Group 2
D04
E05
TRL
F97
Group 2 record
Group 2 record
End Group 2
Not in a group
Note that position 5 is blank and the 'HDR' and 'TRL' characters have been shifted
over to positions 6-8.
We use an IFTHEN WHEN=GROUP clause to put a non-blank character in each
record that is part of a group. BEGIN indicates a group starts with a record that
has 'HDR' in positions 6-8. END indicates a group ends with a record that has
'TRL' in positions 6-8. PUSH overlays a 1-byte ID character at position 5 in each
record of a group. After the IFTHEN GROUP clause is executed, the intermediate
records look like this:
Len|Data
24| C33
24|1HDR
26|1A01
26|1B02
26|1C03
22|1TRL
24| R24
24| T02
24|2HDR
26|2D04
26|2E05
22|2TRL
26| F97
Not in a group
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Not in a group
Not in a group
Start Group 2
Group 2 record
Group 2 record
End Group 2
Not in a group
Note that the records within a group have a non-blank character in position 5
whereas the records outside groups have a blank character in position 5. The ID
starts at 1 for the first group and is incremented by 1 for each subsequent group.
Since we are only allowing one character for the ID, when the ID counter gets to
10, a '0' will appear in position 5. That's fine since we are just looking for a
non-blank to indicate a record within a group, or a blank to indicate a record
outside of a group.
We use an OUTFIL statement to only INCLUDE records with a non-blank in
position 5, and to remove the ID character so the included output records will be
identical to the input records. After the OUTFIL statement is executed, the final
output records look like this:
Len|Data
23|HDR
25|A01
25|B02
25|C03
21|TRL
23|HDR
25|D04
25|E05
21|TRL
Start Group 1
Group 1 record
Group 1 record
Group 1 record
End Group 1
Start Group 2
Group 2 record
Group 2 record
End Group 2
Example 18
SORT FIELDS=(1,12,CH,A)
OUTREC OVERLAY=(30:16,8,Y4T,TOGREG=Y4T)
OUTFIL INCLUDE=(30,1,CH,EQ,C*)
This example illustrates how to list records with dates outside of the valid range
(for example, a month not between 01-12).
435
20091021
20091101
00000000
20091325
20090931
20090731
The SORT statement sorts the records by the name in positions 1-12. After the
SORT statement is processed, the sorted records will look like this:
Betten
Boenig
Casad
Kolusu
Vezinaw
Yaeger
20091021
20091325
00000000
20090931
20091101
20090731
20091021
20091325
00000000
20090931
20091101
20090731
20091021
********
00000000
********
20091101
20090731
The OUTFIL statement selects the records that have an asterisk in position 30, that
is, the records with an invalid date. The Boenig record is invalid because mm is 13,
and the Kolusu record is invalid because mm is 09 but dd is 31 (September only
has 30 days). Note that the special indicator of all 0s for the Casad record is valid.
The output records would be as follows:
Boenig
Kolusu
20091325
20090931
********
********
Example 19
OPTION COPY,Y2PAST=1990
OUTREC IFTHEN=(WHEN=INIT,
BUILD=(1:1,8,UFF,TO=ZD,LENGTH=6,8:11,6,UFF,TO=ZD,LENGTH=5)),
IFTHEN=(WHEN=INIT,
BUILD=(1,6,Y2W,DATEDIFF,8,5,Y2T))
This example illustrates how you can calculate the difference in days between two
different types of date fields, each of which has separators.
The SORTIN data set has these input records with a C'mm/dd/yy' date field in
positions 1-8 and a C'yy/ddd' date field in positions 11-16:
03/05/07
12/13/07
02/19/08
09/01/08
11/22/09
436
07/052
08/193
08/365
09/001
09/015
01/121
09/015
09/322
08/050
The OUTREC statement calculates the number of days for date1-date2 and puts the
result in the output record in positions 1-8.
The first IFTHEN clause removes the / separators from date1 and date2 so we can
use them in DATEDIFF. After the first IFTHEN clause, the records look like this,
with the C'mmddyy' date in positions 1-6 and the C'yyddd' date in positions 8-12:
030507
121307
021908
090108
112209
072298
011509
091510
063010
07052
08193
08365
09001
09015
01121
09015
09322
08050
The second IFTHEN clause uses DATEDIFF to get the number of days between
date1 and date2. We use 1,6,Y2W to match the C'mmddyy' date and 8,5,Y2T to
match the C'yyddd' date.
SORTOUT will have these records:
+0000012
-0000211
-0000315
-0000122
+0000311
-0001014
+0000000
+0000301
+0000862
Note that when date1>=date2, the result is a positive value, and when
date1<date2, the result is a negative value.
437
F
V
D
LENGTH=( L1
TYPE =F,
, L2
L1
, L3
,
L2
L1
LENGTH=( L1
TYPE= V ,
D
, L2
L1
, L3
L2
L1
,
L2
L1
,
,
L2
L1
,
,
L1
,
L3
L2
L1
, L4
L3
,
L3
,
L2
, L5
L4
,
L3
, L6
L5
L4
,
L4
,
L5
, L7
L6
The RECORD control statement can be used to specify the type and lengths of the
records being processed, and the minimum and average record lengths for a
variable-length sort.
The RECORD control statement is required when:
v A user exit changes record lengths.
v A user exit supplies all of the input records.
v A Conventional merge or tape work data set sort uses VSAM input.
TYPE
TYPE=x
Can be used to specify the record type when input is VSAM, or an E15 or E32
exit supplies all of the input records. The record type can be:
v Fixed-length (F). The records are processed without an RDW, so the data
starts in position 1. Control statement positions should be specified
accordingly.
An RRDS can always be processed as fixed-length. A KSDS, ESDS or VRRDS
used for input should only be processed as fixed-length if all of its records
have a length equal to the maximum record size defined for the cluster.
Otherwise, input records which are shorter than the maximum record size
are padded with bytes that may or may not be zeros (that is, "garbage"
bytes).
438
439
L1
)
,
L2
L1
,
L1
,
L1
,
L2
,
L1
,
L3
,
L2
L4
L3
L2
L1
L1
L3
L2
,
L3
,
L2
,
,
L4
,
L3
L5
L4
,
,
L4
L6
L5
,
L5
L7
L6
440
This example illustrates how the RECORD statement can be used to indicate that
E15 and E35 exits change the record length. The record type (F) and input record
length (200) are obtained automatically from the RECFM and LRECL of the input
data set, respectively.
LENGTH
L2 specifies that the E15 exit passes back 175 byte records. L3 specifies that
the E35 exit passes back 180 byte records.
Example 2
MODS E15=(E15ONLY,1000,EXIT)
RECORD TYPE=V,LENGTH=60
Chapter 3. Using DFSORT program control statements
441
( p,m,f,s
,
( p,m,
FORMAT=f
f,
COPY
,
,
CKPT
DYNALLOC
=
d
(,n)
(d,n)
OFF
EQUALS
NOEQUALS
FILSZ=
x
Ex
Ux
SIZE=
y
Ey
Uy
SKIPREC=z
STOPAFT=n
Y2PAST=
s
f
The SORT control statement must be used when a sorting application is performed;
this statement describes the control fields in the input records on which the
program sorts. A SORT statement can also be used to specify a copy application.
User labels will not be copied to the output data sets.
442
Requires four facts about each control field in the input records: the position of
the field within the record, the length of the field, the format of the data in the
field, and the sequence into which the field is to be sorted. These facts are
communicated to DFSORT by the values of the FIELDS operand, represented
by p, m, f, and s.
The value for f can optionally be specified by the FORMAT=f parameter as
explained later in this section.
All control fields must be located within the first 32752 bytes of a record.
The maximum length of the collected control fields for which Blockset can be
used is 4088 bytes. However, the maximum length can be less than 4088 for
various situations, such as the use of certain formats (for example, PD), the
EQUALS option, and so on. If this maximum is exceeded, Blockset cannot be
used.
The FIELDS operand can be written in two ways.
The program examines the major control field first, and it must be specified
first. The minor control fields are specified following the major control field. p,
m, f, and s describe the control fields. The text that follows gives specifications
in detail.
443
specifies the first byte of a control field relative to the beginning of the
input record. 14
The first data byte of a fixed-length record has relative position 1. The first
data byte of a variable-length record has relative position 5. The first 4
bytes contain the record descriptor word. All control fields, except binary,
must begin on a byte boundary. The first byte of a floating-point field is
interpreted as a signed exponent; the rest of the field is interpreted as the
fraction.
Fields containing binary values are described in a bytes.bits notation as
follows:
1. First, specify the byte location relative to the beginning of the record
and follow it with a period.
2. Then, specify the bit location relative to the beginning of that byte.
Remember that the first (high-order) bit of a byte is bit 0 (not bit 1); the
remaining bits are numbered 1 through 7.
Thus, 1.0 represents the beginning of a record. A binary field beginning on
the third bit of the third byte of a record is represented as 3.2. When the
beginning of a binary field falls on a byte boundary (say, for example, on
the fourth byte), you can write it in one of three ways:
4.0
4.
4
1.0
1.
1
byte 3
bits 0 - 7
byte 2
bits 0 - 7
1.6
2.2
3.0 3.1
3.
3
specifies the length of the control field. Values for all control fields except
binary fields must be expressed in integer numbers of bytes. Binary fields
can be expressed in the notation bytes.bits. The length of a binary control
field that is an integer value (d) can be expressed in one of three ways:
14. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and
INREC is not specified, p must refer to the record as reformatted by your E15 user exit.
444
The number of bits specified must not exceed 7. A control field 2 bits long
would be represented as 0.2.
The total number of bytes occupied by all control fields must not exceed
4092 (or, when the EQUALS option is in operation, 4088 bytes). When you
determine the total, count a binary field as occupying an entire byte if it
occupies any part of it. For example, a binary field that begins on byte 2.6
and is 3 bits long occupies two bytes. All fields must be completely
contained within the first 32752 bytes of the record.
f
specifies the format of the data in the control field. Acceptable control field
lengths (in bytes) and available formats are shown in Table 60.
Description
CH
1 to 4092 bytes
Character
AQ
1 to 4092 bytes
ZD
1 to 256 bytes
PD
1 to 256 bytes
PD0
2 to 8 bytes
FI
1 to 256 bytes
Signed fixed-point
BI
Unsigned binary
FL
1 to 256 bytes
Signed hexadecimal
floating-point
15
AC
1 to 4092 bytes
ASCII character
CSF or FS
1 to 32 bytes
UFF
1 to 44 bytes
SFF
1 to 44 bytes
CSL or LS
2 to 256 bytes
CST or TS
2 to 256 bytes
CLO or OL
1 to 256 bytes
CTO or OT
1 to 256 bytes
ASL
2 to 256 bytes
AST
2 to 256 bytes
D1
1 to 4092 bytes
445
Description
Y2T
3 to 6 bytes
Y2U
2 or 3 bytes
Y2V
3 or 4 bytes
Y2W
3 to 6 bytes
Y2X
2 or 3 bytes
Y2Y
3 or 4 bytes
Y2C or Y2Z
2 bytes
Two-digit character or
zoned-decimal year data
Y2P
2 bytes
Two-digit packed-decimal
year data
Y2D
1 byte
Y2S
2 bytes
Two-digit character or
zoned-decimal year data with
special indicators
Y2B
1 byte
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
CSF, FS, UFF, SFF, Y2 and PD0 format fields can only be used if Blockset is
selected.
For Y2 format fields, real dates are collated using the century window
established by the Y2PAST option in effect, but the century window is not used
for special indicators. Thus the Y2 formats will collate real dates and special
indicators as follows:
v Y2T and Y2W:
Ascending:
BI zeros, blanks, CH/ZD zeros, lower century dates (for example,
19yy), upper century dates (for example, 20yy), CH/ZD nines, BI
ones.
Descending:
BI ones, CH/ZD nines, upper century dates (for example, 20yy),
lower century dates (for example, 19yy), CH/ZD zeros, blanks, BI
zeros.
v Y2U, Y2V, Y2X and Y2Y:
Ascending:
PD zeros, lower century dates (for example, 19yy), upper century
dates (for example, 20yy), PD nines.
446
specifies how the control field is to be ordered. The valid codes are:
A
ascending order
descending order
Specify E if you include an E61 user exit to modify control fields before the
program sorts them. After an E61 user exit modifies the control fields,
DFSORT collates the records in ascending order using the formats
specified. 16
For information on how to add a user exit, see Chapter 5, Using your own
user exit routines, on page 487.
Default: None; must be specified. See Appendix B, Specification/override of
DFSORT options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
FORMAT
16. With a conventional merge or a tape work data set sort, control fields for which E is specified are treated as binary byte format
regardless of the actual formats specified.
Chapter 3. Using DFSORT program control statements
447
FORMAT=f can be used to specify a particular format for one or more control
fields. f from FORMAT=f is used for p,m,s fields. f from FORMAT=f is ignored
for p,m,f,s fields. For example, the following are all equivalent:
SORT FIELDS=(5,5,ZD,A,12,6,PD,D,21,3,PD,A,35,7,ZD,A)
SORT FORMAT=ZD,FIELDS=(5,5,A,12,6,PD,D,21,3,PD,A,35,7,A)
SORT FIELDS=(5,5,ZD,A,12,6,D,21,3,A,35,7,ZD,A),FORMAT=PD
The permissible field formats are shown under the description of 'f' for fields.
If you have specified the COPY operand, FORMAT=f cannot be specified.
Default: None; FORMAT=f must be specified if any field is specified as p,m,s
rather than p,m,f,s. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
Note: DFSORT issues an informational message and ignores FORMAT=f if all
of the fields are specified as p,m,f,s.
FIELDS=COPY
FIELDS=COPY
=
d
(,n)
(d,n)
OFF
See the discussion of this option in OPTION control statement on page 173.
EQUALS or NOEQUALS
EQUALS
NOEQUALS
448
FILSZ=
SIZE=
x
Ex
Ux
y
Ey
Uy
See the discussion of this option in OPTION control statement on page 173.
STOPAFT
STOPAFT=n
See the discussion of this option in OPTION control statement on page 173.
Y2PAST
Y2PAST=
s
f
See the discussion of this option in OPTION control statement on page 173.
Note: CENTURY=value and CENTWIN=value can be used instead of
Y2PAST=value.
FIELDS=(2,5,FS,A),FILSZ=29483
FIELDS
The control field begins on the second byte of each record in the input data set,
is five bytes long, and contains floating sign data. It is to be sorted in
ascending order.
FILSZ
The data set to be sorted contains exactly 29483 records.
Example 2
SORT
FIELDS=(7,3,CH,D,1,5,FI,A,398.4,7.6,BI,D,99.0,230.2,
BI,A,452,8,FL,A),DYNALLOC=(3390,4)
449
Example 3
SORT
FIELDS=(3,8,ZD,E,40,6,CH,D)
FIELDS
The first four values describe the major control field. It begins on byte 3 of
each record, is 8 bytes long, and contains zoned decimal data that is modified
by your routine before sort examines the field.
The second field begins on byte 40, is 6 bytes long, contains character
(EBCDIC) data, and is sorted in descending sequence.
Example 4
SORT
FIELDS=(7025,4,A,5048,8,A),FORMAT=ZD,EQUALS
FIELDS
The major control field begins on byte 7025 of each record, is 4 bytes long,
contains zoned decimal data (FORMAT=ZD), and is to be sorted in ascending
sequence.
The second control field begins on byte 5048, is 8 bytes long, has the same data
format as the first field, and is also to be sorted in ascending order.
FORMAT
FORMAT=ZD is used to supply ZD format for the p,m,s fields and is
equivalent to specifying p,m,ZD,s for these fields.
With FORMAT=f, you can mix p,m,s and p,m,f,s fields when that's convenient
such as when all or most of the fields have the same format (although you can
always code p,m,f,s for all fields and not use FORMAT=f, if you prefer). For
example, the following are also valid uses of the FORMAT=f parameter:
SORT FORMAT=BI,FIELDS=(21,4,A,5,4,PD,A,31.3,1.4,A,52,20,A)
SORT FIELDS=(16,4,A,22,8,BI,D,3,2,A),FORMAT=FI
EQUALS
specifies that the sequence of equal collating records is to be preserved from
input to output.
450
Example 5
SORT
FIELDS=COPY
FIELDS
The input data set is copied to the output data set without sorting or merging.
Example 6
OPTION Y2PAST=1950
SORT FIELDS=(21,6,Y2T,A,13,3,Y2X,D)
Y2PAST
Sets a century window of 19502049.
FIELDS
Sorts on a C'yymmdd' (or Z'yymmdd') date in positions 21-26 in ascending
order, and on a P'dddyy' date in positions 13-15 in descending order. "Real"
dates are sorted using the century window of 1950-2049. Special indicators are
sorted correctly relative to the "real" dates.
p,m,f
,
p,m
FORMAT=f
,f
NONE
The SUM control statement specifies that, whenever two records are found with
equal sort or merge control fields, the contents of their summary fields are to be
added, the sum is to be placed in one of the records, and the other record is to be
deleted. If the EQUALS option is in effect the first record of summed records is
kept. If the NOEQUALS option is in effect, the record to be kept is unpredictable.
For further details, see SUM statement notes on page 453.
If the ZDPRINT option is in effect, positive summed ZD values are printable. If the
NZDPRINT option is in effect, positive summed ZD values are not printable. For
further details, see SUM statement notes on page 453.
The way in which DFSORT processes short SUM summary fields depends on
whether the VLSHRT or NOVLSHRT option is in effect. A short field is one where
the variable-length record is too short to contain the entire field; that is, the field
extends beyond the record. For details about sorting, merging and summing short
records, see the discussion of the VLSHRT and NOVLSHRT options in OPTION
control statement on page 173.
FIELDS
,
FIELDS= (
p,m,f
specifies the first byte of the field relative to the beginning of the input
record. 17 The first data byte of a fixed-length record has relative position 1.
Chapter 3. Using DFSORT program control statements
451
Description
BI
2, 4, or 8 bytes
Unsigned binary
FI
2, 4, or 8 bytes
Signed fixed-point
FL
4, 8, or 16 bytes
Signed hexadecimal
floating-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
FORMAT
FORMAT=f
17. If INREC is specified, p must refer to the record as reformatted by INREC. If your E15 user exit reformats the record, and
INREC is not specified, p must refer to the record as reformatted by your E15 user exit.
452
The permissible field formats are shown under the description of 'f' for fields.
Default: None. FORMAT=f must be specified if any field is specified as p,m
rather than p,m,f. See Appendix B, Specification/override of DFSORT
options, on page 863 for full override details.
Applicable Functions: See Appendix B, Specification/override of DFSORT
options, on page 863.
Note: DFSORT issues an informational message and ignores FORMAT=f if all of
the fields are specified as p,m,f.
453
Tip: You can also perform additional functions with ICETOOL's SELECT
operator that are not available with XSUM. See Chapter 7, Using ICETOOL, on
page 563 for complete details of ICETOOL's SELECT operator.
454
Example 2
SUM FIELDS=NONE
Example 3
SUM FIELDS=(41,8,49,4),FORMAT=ZD
OPTION ZDPRINT
These statements illustrate the use of the FORMAT operand and the ZDPRINT
option. The SUM statement designates two zoned decimal fields, one 8 bytes long
starting at byte 41, and the other 4 bytes long starting at byte 49. As a result of the
ZDPRINT option, the positive summed ZD values will be printable. Note,
however, that the ZDPRINT option does not affect ZD values which are not
summed due to overflow or unique keys. The next example shows how to use
OUTFIL to make all summary fields printable.
Example 4
SUM FIELDS=(41,8,49,4),FORMAT=ZD
OUTFIL OUTREC=(1,40,41,8,ZD,M11,49,4,ZD,M11,53,28)
These statements illustrate the use of the OUTFIL statement to ensure that all
positive ZD summary fields in the output data set are printable. Whereas the
ZDPRINT option affects only positive summed ZD fields, OUTFIL can be used to
edit positive or negative BI, FI, PD, or ZD values, whether they are summed or
not. OUTFIL can also be used to produce multiple output data sets, reports, and so
on. See OUTFIL control statements on page 223 for complete details about
OUTFIL processing.
Note: For purposes of illustration, this example assumes that the input records are
80 bytes long.
Example 5
* Add Z0 before the ZD SUM field to prevent overflow.
* Add P0 before the PD SUM field to prevent overflow.
INREC FIELDS=(1,10, Copy bytes before ZD SUM field
11:C0,12:11,4,
Add Z0 before ZD SUM field
16:15,6,
Copy bytes after ZD SUM field
22:X00,23:21,2, Add P0 before PD SUM field
25:23,5,
Copy SORT field
30:28,53)
Copy bytes after SORT field
* Sort on key in its new position.
SORT FIELDS=(25,5,CH,A)
* Sum on the expanded ZD and PD fields in
* their new positions.
SUM FIELDS=(11,5,ZD,22,3,PD)
455
456
If you don't specify a JOIN statement, only paired records from F1 and F2
are kept and processed by the main task as the joined records (inner join).
You can optionally specify a JOIN statement to have the main task keep
and process: unpaired F1 records as well as paired records (left outer join);
unpaired F2 records as well as paired records (right outer join); unpaired
F1 and F2 records as well as paired records (full outer join); only unpaired
F1 records; only unpaired F2 records, or only unpaired F1 and F2 records.
REFORMAT
You would normally specify a REFORMAT statement to indicate the F1
and/or F2 fields you want in the joined records. You can optionally specify
an indicator of where the key was found, and a FILL character to be used
for missing bytes. If a JOIN statement with ONLY is specified, the
REFORMAT statement is optional.
F1 and F2 can be any type of sequential or VSAM file supported by DFSORT for
SORTIN and can have different attributes (for example, F1 can have RECFM=FB
and LRECL=100 and F2 can have RECFM=VB and LRECL=254, or F1 can be a
VSAM ESDS and F2 can be a PDS member).
F1 will be sorted or copied by "subtask1". An E35 exit will be used to pass the
needed fields from the F1 records to the "main task" (an intermediate output data
set is not used or required). A subset of the DFSORT statements, such as
INCLUDE, OMIT, INREC, SUM and OPTION, will be available for processing the
F1 records.
F2 will be sorted or copied by "subtask2". An E35 exit will be used to pass the
needed fields from the F2 records to the "main task" (an intermediate output data
set is not used or required). A subset of the DFSORT statements, such as
INCLUDE, OMIT, INREC, SUM and OPTION, will be available for processing the
F2 records.
457
Overview
The "main task" will use an E15 to join the records passed from the E35 of
subtask1 and E35 of subtask2. The joined records will be processed as the input
records for a sort or copy application. Most of the control statements and options
available for a DFSORT sort or copy application will be available for processing the
joined records.
Note: Since a JOINKEYS application uses three tasks, it can require more storage
than a regular DFSORT application. You may need to use REGION=0M for some
JOINKEYS applications.
Subtask1 for F1
Messages: JNF1JMSG
Control: JNF1CNTL
<SKIPREC>
<E15>
<INCLUDE/OMIT>
<STOPAFT>
<INREC>
COPY or SORT (1)
<SUM>
E35 passes F1 fields
to main task's E15 (3)
Subtask2 for F2
Messages: JNF2JMSG
Control: JNF2CNTL
<SKIPREC>
<E15>
<INCLUDE/OMIT>
<STOPAFT>
<INREC>
COPY or SORT (2)
<SUM>
E35 passes F2 fields
to main task's E15 (4)
458
459
Here are the JCL and control statements for a JOINKEYS application which omits
certain records and normalizes keys for F1 and F2, and retains only sorted,
non-duplicate, unpaired records from F1. The F1 and F2 files are already in order
by the specified JOINKEYS FIELDS. DFSORT symbols are used for various fields
and constants.
//S2
EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
IN1_dept,11,3,ch
IN1_target,J82
IN1_normal_key,27,5,ZD
IN1_output,1,60
IN2_dept,14,3,ch
IN2_target,M25
IN2_PD_key,21,3,PD
IN2_normal_key,=,5,ZD
join_sort_key,45,8,UFF
//FIX DD DSN=F.INPUT,DISP=SHR
//VAR DD DSN=V.INPUT,DISP=SHR
//SORTOUT DD DSN=FIXOUT1,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//JNF1CNTL DD *
* Control statements for subtask1 (F1)
OMIT COND=(IN1_dept,EQ,IN1_target)
INREC OVERLAY=(IN1_normal_key:IN1_normal_key,TO=ZDF,LENGTH=5)
//JNF2CNTL DD *
* Control statements for subtask2 (F2)
OMIT COND=(IN2_dept,EQ,IN2_target)
INREC OVERLAY=(IN2_PD_key:IN2_PD_key,TO=ZDF,LENGTH=5)
//SYSIN DD *
* Control statements for JOINKEYS application
JOINKEYS F1=FIX,FIELDS=(IN1_normal_key,D),SORTED
JOINKEYS F2=VAR,FIELDS=(IN2_normal_key,D),SORTED
JOIN UNPAIRED,F1,ONLY
REFORMAT FIELDS=(F1:IN1_output)
* Control statements for main task (joined records)
SORT FIELDS=(join_sort_key,A)
SUM FIELDS=NONE
/*
460
461
JOINKEYS statements
,
JOINKEYS
462
FILE=F1
FILES=F1
F1=ddname
FILE=F2
FILES=F2
F2=ddname
, FIELDS= (
p,m,s
,
SORTED
, NOSEQCK
F
V
STOPAFT=n
TASKID=id
INCLUDE=
(logical expression)
ALL
NONE
OMIT=
(logical expression)
ALL
NONE
TYPE=
Two JOINKEYS statements are required for a JOINKEYS application; one for the F1
file and the other for the F2 file:
v FILE=F1 or F1=ddname must be used to indicate that the JOINKEYS statement
applies to the F1 input file. FILE=F1 associates the F1 file with a ddname of
SORTJNF1. You can use a different ddname for the F1 file by specifying
F1=ddname. For simplicity, we will use SORTJNF1 when referring to the
ddname for the F1 file.
v FILE=F2 or F2=ddname must be used to indicate that the JOINKEYS statement
applies to the F2 input file. FILE=F2 associates the F2 file with a ddname of
SORTJNF2. You can use a different ddname for the F2 file by specifying
F2=ddname. For simplicity, we will use SORTJNF2 when referring to the
ddname for the F2 file.
FILE=F1, FILES=F1 or F1=ddname
FILE=F1
FILES=F1
F1=ddname
Must be used for the JOINKEYS statement associated with the F1 file. FILE=F1
(or FILES=F1) specifies a ddname of SORTJNF1 for the F1 file. F1=ddname can
be used to specify any valid ddname for the F1 file. Do not use the same
ddname for the F1 file and the F2 file.
When FILE=F1, FILES=F1 or F1=ddname is specified, the other operands of the
JOINKEYS statement apply to the F1 file.
FILE=F2, FILES=F2 or F2=ddname
FILE=F2
FILES=F2
F2=ddname
Must be used for the JOINKEYS statement associated with the F2 file. FILE=F2
(or FILES=F2) specifies a ddname of SORTJNF2 for the F2 file. F2=ddname can
be used to specify any valid ddname for the F2 file. Do not use the same
ddname for the F1 file and the F2 file.
463
p,m,s
Must be specified to indicate the starting position, length and order (ascending
or descending) of the keys in the input file. The keys will be treated as binary,
so they must be "normalized". For example, if the keys are actually zoned
decimal, they must have all C and D signs, or all F and D signs. You can use
an INREC statement in JNF1CNTL and/or JNF2CNTL to normalize the keys
for the F1 file and/or F2 file, respectively, if appropriate.
Each pair of keys for the F1 and F2 files must match with respect to length and
order, but can start in different positions. For example, if the first key for the
F1 file is 5 bytes ascending and the second key for the F1 file is 3 bytes
descending, the first key for the F2 file must be 5 bytes ascending and the
second key for the F2 file must be 3 bytes descending.
If a variable-length record is too short to contain a key you specify, the short
key value will be compared using binary zeros for the missing bytes.
p
specifies the starting position of the key. The first data byte of a
fixed-length record is in position 1. The first data byte of a
variable-length record is in position 5 after the 4-byte RDW. p can be 1
to 32752 but all fields must be completely contained within the first
32752 bytes of the record.
specifies the length of the key. The total length of all keys must not
exceed 4080 bytes. All fields must be completely contained within the
first 32752 bytes of the record.
The length for each pair of F1 and F2 keys must match.
specifies the order of the key. Use A for ascending or D for descending.
File F1 is processed using the ddname IN1, the ascending key in positions
22-24 and the descending key in positions 55-63. File F2 is processed using the
ddname IN2, the ascending key in positions 15-17 and the descending key in
positions 1-9.
SORTED
SORTED
By default, DFSORT will sort the input file by the specified keys. If the records
of the input file are already in sorted order by the specified keys, you can use
the SORTED operand to tell DFSORT to copy the records rather than sort
them. This can improve performance. DFSORT will terminate if the copied
records are not in the order specified by the keys unless you specify the
NOSEQCK operand.
464
File F1 is copied using the ddname SORTJNF1 and the ascending key in
positions 22-24. The SORTJNF1 records will be checked for the correct key
order. File F2 is sorted using the ddname SORTJNF2 and the ascending key in
positions 15-17.
If you use the SORTED operand, statements and options only available for a
sort application, such as SUM, will be ignored for the subtask that copies the
input file.
NOSEQCK
NOSEQCK
If you specify the SORTED operand and know that the records of the input file
are already in sorted order by the specified keys, you can use the NOSEQCK
operand to tell DFSORT not to check the order of the records. This can
improve performance.
For example, if you specify:
JOINKEYS FILE=F1,FIELDS=(22,3,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(15,3,A),SORTED
File F1 is copied using the ddname SORTJNF1 and the ascending key in
positions 22-24. The SORTJNF1 records will be not be checked for the correct
key order. File F2 is copied using the ddname SORTJNF2 and the ascending
key in positions 15-17. The SORTJNF2 records will be checked for the correct
key order.
If the records are not actually in order by the specified keys and you use
NOSEQCK, the output may be incorrect.
The NOSEQCK operand is ignored if the SORTED operand is not specified.
TYPE
TYPE=
F
V
465
Can be used to specify the maximum number of records (n) you want the
subtask for the input file to accept for sorting or copying (accepted means read
from the input file and not deleted by INCLUDE or OMIT).
can be up to 28 digits with up to 15 significant digits.
The first 5 input records from SORTJNF1 and the first 10 input records from
SORTJNF2 will be processed.
You can use STOPAFT=n on the OPTION statement in JNF1CNTL (for the F1
file) or JNF2CNTL (for the F2 file) instead of specifying STOPAFT=n on the
JOINKEYS statement.
For example, instead of the STOPAFT operands in the JOINKEYS statements
shown previously, you could specify:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(32,4,A)
JOINKEYS FILE=F2,FIELDS=(32,4,A)
...
//JNF1CNTL DD *
OPTION STOPAFT=5
//JNF2CNTL DD *
OPTION STOPAFT=10
TASKID
TASKID=id
C1F1JMSG, C1F1CNTL and C1F1WKdd will be used for subtask1 (F1 file).
C1F2JMSG, C1F2CNTL and C1F2WKdd will be used for subtask2 (F2 file).
If you specify:
JOINKEYS F1=IN1,FIELDS=(1,10,A),TASKID=I1
JOINKEYS F2=IN2,FIELDS=(22,10,A),TASKID=I2
I1F1JMSG, I1F1CNTL and I1F1WKdd will be used for subtask1 (F1 file).
I2F2JMSG, I2F2CNTL and I2F2WKdd will be used for subtask2 (F2 file).
466
INCLUDE
OMIT
(logical expression)
ALL
NONE
Can be used to specify criteria for the records you want the subtask for the
input file to include or omit for sorting or copying. You can use the same
logical expressions, ALL or NONE in the same way as for the INCLUDE or
OMIT operand of the OUTFIL statement. See OUTFIL control statements on
page 223 for details.
For example, if you specify:
JOINKEYS FILE=F1,FIELDS=(35,8,A),
OMIT=(5,4,CH,EQ,CABCD)
JOINKEYS FILE=F2,FIELDS=(37,8,A),
INCLUDE=(1,20,SS,EQ,CNO)
Only records without 'ABCD' in positions 5-8 will be processed from file F1.
Only records with 'NO' somewhere in positions 1-20 will be processed from
file F2.
Although the INCLUDE and OMIT operands are available on the JOINKEYS
statement, it is recommended that you specify an INCLUDE or OMIT
statement in JNF1CNTL or JNF2CNTL instead for ease of use.
For example, instead of the OMIT and INCLUDE operands in the JOINKEYS
statements shown previously, you could specify:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(35,8,A)
JOINKEYS FILE=F2,FIELDS=(37,8,A)
...
//JNF1CNTL DD *
OMIT COND=(5,4,CH,EQ,CABCD)
//JNF2CNTL DD *
INCLUDE COND=(1,20,SS,EQ,CNO)
JOIN statement
,
JOIN UNPAIRED
F1
F2
ONLY
If you don't specify a JOIN statement for a JOINKEYS application, only paired
records from F1 and F2 are kept and processed by the main task as the joined
records. This is known as an inner join.
You can change which records are kept and processed by the main task as the
joined records by specifying a JOIN statement. You must specify the UNPAIRED
467
REFORMAT statement
,
,
REFORMAT FIELDS= (
F1:
F2:
p,m
F1:
F2:
)
p,m
,FILL=byte
468
469
F1:
F2:
p,m
F1:
F2:
p,m
Must be specified to indicate the starting position and length of each field from
the F1 file and/or the F2 file to be included in the joined records, and
optionally an indicator of where the key was found. The fields and indicator
will be included in the joined records in the order in which they are specified.
F1:
indicates the following fields up to the next Fn: or end of the FIELDS
operand are from the F1 file.
F2:
indicates the following fields up to the next Fn: or end of the FIELDS
operand are from the F2 file.
p,m
specifies the starting position and length of a fixed field. p specifies the
starting position of the field. The first data byte of a fixed-length
record is in position 1. The first data byte of a variable-length record is
in position 5 after the 4-byte RDW. p can be 1 to 32767. m specifies the
length of the field. m can be 1 to 32760. All fields must be completely
contained within the first 32767 bytes of the record.
For TYPE=V joined records, the indicator must appear in the fixed part
of the record, that is, after the RDW and before the position without
length fields. For example, the following is valid:
* Put indicator in position 5 of each joined record.
REFORMAT FIELDS=(F1:1,4,?,F1:11)
470
FILL
FILL=byte
The FILL operand can be used to override DFSORT's default fill byte of a
blank (X'40'). The fill byte is used in the following situations:
v A p,m (fixed) field is specified for a file (F1 or F2) with variable-length
records, and the field extends beyond the end of a record. Each missing byte
is replaced with the fill byte. For example, if a variable-length F1 record is 20
bytes long and the REFORMAT statement has:
REFORMAT FIELDS=(F1:1,30,41),FILL=C*
and an unpaired F2 record is found, the joined record will have 5 binary
zero bytes followed by bytes 1-10 from the F2 record.
v The REFORMAT statement has a p,m (fixed) field from the F2 file and a
joined record is being created from an unpaired F1 record. For example if
the following are specified:
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:21,5,F2:1,10),FILL=X00
and an unpaired F1 record is found, the joined record will have bytes 21-25
of the F1 record followed by 10 binary zero bytes. (Since UNPAIRED,F1,F2 is
specified, if an unpaired F2 record is found, the joined record will have 5
binary zero bytes followed by bytes 1-10 of the F2 record.)
byte
specifies the fill byte. Permissible values are C'x' and X'yy'.
C'x'
Character fill byte. x must be one EBCDIC character. If you want to use
an apostrophe as the fill byte, you must specify it as C''''.
X'yy'
471
DFSORT's normal syntax and continuation rules are used for the JOINKEYS,
JOIN and REFORMAT statements. See Chapter 3, Using DFSORT program
control statements, on page 81 for details.
472
This example illustrates how you can join paired records from two files using
multiple keys. In this case, neither file has duplicates. The paired records are the
records in F1 and F2 with matching keys (for example, key1=Roses and key2=Red).
Input file1 (F1) has RECFM=FB and LRECL=80. It contains the records shown for
SORTJNF1 in the JCL shown previously in this section. Input file2 (F2) has
RECFM=FB and LRECL=80. It contains the records shown for SORTJNF2 in the
JCL shown previously in this section.
The output file will have RECFM=FB and LRECL=42. It will contain the paired
records from the two files reformatted as follows:
Color
------Lilac
Orange
Yellow
Pink
Red
Yellow
Flower
-------------Daisies
Daisies
Daisies
Roses
Roses
Roses
Status
------SoldOut
SoldOut
InStock
SoldOut
InStock
Ordered
Per Pot
------12
6
2
4
3
6
The first JOINKEYS statement defines the ddname and keys for the F1 file.
FILE=F1 tells DFSORT that the ddname for the F1 file is SORTJNF1.
Chapter 4. Using a JOINKEYS application for joining two files
473
Extracted from
-----------------F1 positions 20-27
F1 positions 1-15
F2 positions 26-35
F1 positions 16-17
Since there is no JOIN statement, only paired records are joined by default.
The OPTION COPY statement tells DFSORT to copy the joined records. The
OUTFIL statement tells DFSORT to reformat the joined records, display a header at
the top of each page and remove the carriage control characters. Note that the
BUILD operand of the OUTFIL statement must reference the positions of fields in
the joined records.
Conceptually, JOINKEYS application processing proceeds as follows:
v Subtask1 sorts the SORTJNF1 (F1 file) records as directed by its JOINKEYS
statement. As a result, it passes the following records to the main task:
Daisies
Daisies
Daisies
Roses
Roses
Roses
Roses
12
06
02
09
04
03
06
Lilac
Orange
Yellow
Blue
Pink
Red
Yellow
v Subtask2 sorts the SORTJNF2 (F2 file) records as directed by its JOINKEYS
statement. As a result, it passes the following records to the main task:
Lilac
Orange
White
Yellow
Red
Pink
Red
Yellow
Daisies
Daisies
Daisies
Daisies
Lilies
Roses
Roses
Roses
SoldOut
SoldOut
InStock
InStock
InStock
SoldOut
InStock
Ordered
v The main task joins the records passed from subtask1 and subtask2 as directed
by the specified JOINKEYS and REFORMAT statements, resulting in the
following joined records:
474
SoldOut
SoldOut
InStock
SoldOut
InStock
Ordered
12
06
02
04
03
06
v Finally, the main task copies and reformats the joined records according to the
OUTFIL statement, and writes the resulting records to SORTOUT. Thus,
SORTOUT contains these records:
Color
------Lilac
Orange
Yellow
Pink
Red
Yellow
Flower
-------------Daisies
Daisies
Daisies
Roses
Roses
Roses
Status
------SoldOut
SoldOut
InStock
SoldOut
InStock
Ordered
Per Pot
------12
6
2
4
3
6
This example illustrates how you can join paired records from two files, both of
which have duplicate records. The result will be a cartesian join. The paired
records are the records in F1 and F2 with matching keys (for example, key=Cats).
Input file1 has RECFM=VB and LRECL=50. It contains the following records:
Len|Data
40|Eliot
40|Lloyd-Webber
48|Hart
48|Rodgers
47|Hammerstein
47|Rodgers
Cats
Cats
Pal Joey
Pal Joey
South Pacific
South Pacific
Musical
Musical
Musical,
Musical,
Musical,
Musical,
Comedy
Comedy
Drama
Drama
The output file will have RECFM=FB and LRECL=40. It will contain the paired
cartesian product of the two files sorted as follows:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
1982
2000
1949
1954
1940
1941
1982
2000
1940
1941
1949
1954
Eliot
Cats
Eliot
Cats
Hammerstein South Pacific
Hammerstein South Pacific
Hart
Pal Joey
Hart
Pal Joey
Lloyd-WebberCats
Lloyd-WebberCats
Rodgers
Pal Joey
Rodgers
Pal Joey
Rodgers
South Pacific
Rodgers
South Pacific
Chapter 4. Using a JOINKEYS application for joining two files
475
Extracted from
-----------------F2 positions 22-33
F1 positions 5-16
F2 positions 1-16
Note that since VBIN (F1) is a VB file, the starting position of its REFORMAT field
must take the RDW in positions 1-4 into account.
Since there is no JOIN statement, only paired records are joined by default. Since
there are duplicates in each input file, a cartesian join is performed.
The SORT FIELDS=(13,12,CH,A) statement tells DFSORT to sort the joined records
by a different key than the one used for the join of F1 and F2 records. Note that
the FIELDS operand of the SORT statement must reference the positions of fields
in the joined records.
Conceptually, JOINKEYS application processing proceeds as follows:
v Subtask1 copies the VBIN (F1 file) records as directed by its JOINKEYS
statement. As a result, it passes the following records to the main task:
Len|Data
40|Eliot
40|Lloyd-Webber
48|Hart
48|Rodgers
47|Hammerstein
47|Rodgers
Cats
Cats
Pal Joey
Pal Joey
South Pacific
South Pacific
Musical
Musical
Musical,
Musical,
Musical,
Musical,
Comedy
Comedy
Drama
Drama
v Subtask2 sorts the FBIN (F2 file) records as directed by its JOINKEYS statement.
As a result, it passes the following records to the main task:
Cats
Cats
Pal Joey
Pal Joey
South Pacific
South Pacific
Start:
End:
Start:
End:
Start:
End:
1982 50
2000
1940 22
1941
1949 13
1954
v The main task joins the records passed from subtask1 and subtask2 as directed
by the specified JOINKEYS and REFORMAT statements, resulting in the
following joined records:
Start:
End:
Start:
End:
476
1982
2000
1982
2000
Eliot
Cats
Eliot
Cats
Lloyd-WebberCats
Lloyd-WebberCats
1940
1941
1940
1941
1949
1954
1949
1954
Hart
Hart
Rodgers
Rodgers
Hammerstein
Hammerstein
Rodgers
Rodgers
Pal Joey
Pal Joey
Pal Joey
Pal Joey
South Pacific
South Pacific
South Pacific
South Pacific
v Finally, the main task sorts the joined records according to the SORT statement,
and writes the resulting records to SORTOUT. Thus, SORTOUT contains these
records:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
Start:
End:
1982
2000
1949
1954
1940
1941
1982
2000
1940
1941
1949
1954
Eliot
Cats
Eliot
Cats
Hammerstein South Pacific
Hammerstein South Pacific
Hart
Pal Joey
Hart
Pal Joey
Lloyd-WebberCats
Lloyd-WebberCats
Rodgers
Pal Joey
Rodgers
Pal Joey
Rodgers
South Pacific
Rodgers
South Pacific
This example illustrates how you can select only paired records from one of two
files. In this case, we will select the F1 records that have a match in F2 on the
specified keys (for example, key1=Development and key2=Master). The F1 records
are in comma delimited form so we will parse them to get the binary keys we
need.
Input file1 (F1) has RECFM=FB and LRECL=35. It contains the following records:
Marketing,William,Master
Development,John,Bachelor
Manufacturing,Louis,Master
Development,Carol,Master
Research,Angela,Master
Research,Anne,Doctorate
Development,Sara,Doctorate
Marketing,Joseph,Master
477
Input file2 (F2) has RECFM=FB and LRECL=30. It contains the following records:
Master
Development
Master
Manufacturing
Bachelor
Development
Doctorate Research
The output file will have RECFM=FB and LRECL=35. It will contain the paired F1
records, that is, the records from F1 that have a match in F2 for the specified keys
(the first and third fields):
Development,John,Bachelor
Development,Carol,Master
Development,Susan,Master
Manufacturing,Louis,Master
Manufacturing,Nick,Master
Research,Anne,Doctorate
Research,Howard,Doctorate
The first JOINKEYS statement defines the ddname and keys for the F1 file.
F1=MASTER tells DFSORT that the ddname for the F1 file is MASTER.
The control statements in JNF1CNTL will be used to process the F1 file before it is
sorted. The input records are in comma delimited form, so to use the first and
third fields as binary keys, while preserving the original data, we use an INREC
statement to parse out the fields we want and add them to the end of the record.
The parsed first key will be in positions 36-50 and the parsed second key will be in
positions 52-61. For example, the first reformatted record will look like this:
Marketing,William,Master
Marketing
Master
478
Development
Development
Development
Development
Manufacturing
Manufacturing
Manufacturing
Marketing
Marketing
Research
Research
Research
Bachelor
Doctorate
Master
Master
Bachelor
Master
Master
Master
Master
Doctorate
Doctorate
Master
v Subtask2 sorts the PULL (F2 file) records as directed by its JOINKEYS statement.
As a result, it passes the following records to the main task:
Bachelor
Development
Master
Development
Master
Manufacturing
Doctorate Research
v The main task joins the records passed from subtask1 and subtask2 as directed
by the specified JOINKEYS and REFORMAT statements, resulting in the
following joined records:
Development,John,Bachelor
Development,Carol,Master
Development,Susan,Master
Manufacturing,Louis,Master
Manufacturing,Nick,Master
Research,Anne,Doctorate
Research,Howard,Doctorate
v Finally, the main task copies the joined records to SORTOUT. Thus, SORTOUT
contains these records:
Development,John,Bachelor
Development,Carol,Master
Development,Susan,Master
Manufacturing,Louis,Master
Manufacturing,Nick,Master
Research,Anne,Doctorate
Research,Howard,Doctorate
479
This example illustrates how you can select only unpaired records from one of two
files. In this case, we will select the F2 records that do not have a match in F1 on
the specified keys (for example, key1=Molly and key2=2100). We will also omit
certain records from each input file and handle unnormalized keys.
Input file1 has RECFM=FB and LRECL=15. It contains the following records:
Molly
145
Molly
99999
Molly
2143
Jasmine 1292
Jasmine 5
Jasmine 28
Jasmine 99999
Input file2 has RECFM=VB and LRECL=35. It contains the following records:
Len|Data
30|Molly
145
31|Molly
2100
28|Molly
18
28|Jasmine 99999
28|Jasmine 5
30|Jasmine 28
29|Jasmine 103
31|Jasmine 99999
Thursday
Wednesday
Sunday
Monday
Sunday
Saturday
Tuesday
Wednesday
The output file will have RECFM=VB and LRECL=35. F1 records with 99999 in
positions 10-14 and F2 records with 99999 in positions 14-18 will be removed
before join processing. The output file will contain unpaired F2 records (that is,
records from F2 that do not have a match in F1 for the specified keys) as follows:
Len|Data
29|Jasmine 103
31|Molly
2100
28|Molly
18
Tuesday
Wednesday
Sunday
The first JOINKEYS statement defines the ddname and keys for the F1 file. F1=IN1
tells DFSORT that the ddname for the F1 file is IN1.
The control statements in JNF1CNTL will be used to process the F1 file before it is
sorted. The OMIT statement removes records that have 99999 in positions 10-14.
We want to use the numeric field as our key. However, the numeric field is
unnormalized since it is left aligned instead of right aligned, so sorting it as a
binary key will not work. To handle this, we use the INREC statement to reformat
the numeric field as ZD values in positions 9-13 (positive ZD values with the same
sign can be sorted as binary). For example, the first reformatted FB record will look
like this:
Molly
00145
Since we don't need the F1 records for output, we don't need to keep the original
left aligned numeric value.
480
145
Thursday
In this case, since the input is a VB file, we specify the RDW (1,4), then the
converted field, and then the rest of the record (5 without a length) in the INREC
statement.
FIELDS=(10,8,A,5,5,D) in the JOINKEYS statement (referring to the reformatted
INREC positions) tells DFSORT that the first key is in positions 10-17 ascending
and the second key is in positions 5-9 descending.
Note that since IN2 is a VB file, all of its starting positions must take the RDW in
positions 1-4 into account.
The JOIN statement tells DFSORT that the joined records should be the F2 records
that do not have a match in F1 on the specified keys.
The REFORMAT statement defines the fields to be extracted for the joined records
in the order in which they are to appear. We need the RDW (1,4) and the original
data which starts in position 10 of the reformatted F2 records. So we use
FIELDS=(F2:1,4,10). Since the last field (10) is a position without a length, it tells
DFSORT to create VB records. The joined records are created as follows from the
reformatted F2 records:
Joined Record Positions
----------------------1-4
5 to end
Extracted from
--------------------------------RDW (not extracted)
Reformatted F2 position 10 to end
01292
00028
00005
02143
00145
481
Tuesday
Saturday
Sunday
Wednesday
Thursday
Sunday
v The main task joins the records passed from subtask1 and subtask2 as directed
by the specified JOINKEYS, JOIN and REFORMAT statements, resulting in the
following joined records (unmatched F2 records):
Len|Data
29|Jasmine 103
31|Molly
2100
28|Molly
18
Tuesday
Wednesday
Sunday
v Finally, the main task copies the joined records, and writes them to SORTOUT.
Thus, SORTOUT contains these records:
Len|Data
29|Jasmine 103
31|Molly
2100
28|Molly
18
Tuesday
Wednesday
Sunday
This example illustrates how you can create three output files; with paired F1/F2
records, unpaired F1 records and unpaired F2 records. In this case:
v F1 records which do not have a match in F2 on the specified keys (for example,
key=David) will be written to the F1ONLY output file.
v F2 records which do not have a match in F1 on the specified keys (for example,
key=Karen) will be written to the F2ONLY output file.
v F1 and F2 records which have a match in F1 and F2 on the specified keys (for
example, key=Carrie) will be written to the BOTH output file.
482
F101
F102
F103
F104
F105
Input file2 has RECFM=FB and LRECL=20. It contains the following records:
No
Yes
Yes
No
Yes
Carrie
F201
Holly
F202
Karen
F203
Sri Hari F204
Vicky
F205
The F1ONLY file will have RECFM=FB and LRECL=14. It will contain the
unpaired F1 records as follows:
David
Frank
F102
F103
The F2ONLY file will have RECFM=FB and LRECL=20. It will contain the
unpaired F2 records as follows:
Yes
No
Karen
Sri Hari
F203
F204
The BOTH file will have RECFM=FB and LRECL=20. It will contain the paired F1
and F2 records as follows:
Carrie
F101
No
Carrie
F201
Holly
F104
Yes
Holly
F202
Vicky
F105
Yes
Vicky
F205
The first JOINKEYS statement defines the ddname and key for the F1 file. FILE=F1
tells DFSORT that the ddname for the F1 file is SORTJNF1. FIELDS=(1,10,A) tells
DFSORT that the key is in positions 1-10 ascending. Since SORTED is specified,
indicating that the records are already in order by the specified binary key,
DFSORT will copy the SORTJNF1 records. Since NOSEQCK is specified, DFSORT
will not check that the records are in order by the key. (Only use NOSEQCK if you
know for sure that the records are in order by the key.)
The second JOINKEYS statement defines the ddname and key for the F2 file.
FILE=F2 tells DFSORT that the ddname for the F2 file is SORTJNF2.
FIELDS=(7,10,A) tells DFSORT that the key is in positions 7-16 ascending. Since
SORTED is specified, indicating that the records are already in order by the
specified binary key, DFSORT will copy the SORTJNF2 records. Since NOSEQCK is
specified, DFSORT will not check that the records are in order by the key. (Only
use NOSEQCK if you know for sure that the records are in order by the key.)
The JOIN statement tells DFSORT that the joined records should include the
unpaired F1 and F2 records as well as the paired F1/F2 records.
The REFORMAT statement defines the fields to be extracted for the joined records
in the order in which they are to appear, and includes an indicator in the last
position that will be set to '1' if the key is found only in the F1 file, '2' if the key is
found only in the F2 file, or 'B' if the key is found in the F1 file and in the F2 file.
FIELDS=(F1:1,14,F2:1,20,?) tells DFSORT to create the joined records as follows:
Chapter 4. Using a JOINKEYS application for joining two files
483
Extracted from
----------------F1 positions 1-14
F2 positions 1-20
Indicator of where key was found
The OPTION COPY statement tells DFSORT to copy the joined records. The
OUTFIL statements use the indicator in position 35 to determine where to find the
F1 or F2 fields in the joined records and where to write the fields (F1ONLY,
F2ONLY or BOTH).
Conceptually, JOINKEYS application processing proceeds as follows:
v Subtask1 copies the SORTJNF1 (F1) records as directed by the JOINKEYS
statement. As a result, it copies the unchanged SORTJNF1 records to the main
task.
v Subtask2 copies the SORTJNF2 (F2) records as directed by the JOINKEYS
statement. As a result, it copies the unchanged SORTJNF2 records to the main
task.
v The main task joins the records passed from subtask1 and subtask2 as directed
by the specified JOINKEYS, JOIN and REFORMAT statements, resulting in the
following joined records (paired and unpaired):
Carrie
David
Frank
Holly
Vicky
F101No
F102
F103
F104Yes
Yes
No
F105Yes
Carrie
Holly
Karen
Sri Hari
Vicky
F201B
1
1
F202B
F2032
F2042
F205B
For F1 records without a match in F2 (for example, the F102 record), the
indicator in position 35 has a '1'. For F2 records without a match in F1 (for
example, the F203 record), the indicator in position 35 has a '2'. For F1 records
with a match in F2 (for example, the F101 and F201 records), the indicator in
position 35 has a 'B'.
v The first OUTFIL statement finds records with a '1' in position 35. These are the
F1 records without a match in F2. The F1 field is in positions 1-14 of the joined
record, so those positions are written to the F1ONLY file. Thus, F1ONLY
contains these records:
David
Frank
F102
F103
v The second OUTFIL statement finds records with a '2' in position 35. These are
the F2 records without a match in F1. The F2 field is in positions 15-34 of the
joined record, so those positions are written to the F2ONLY file. Thus, F2ONLY
contains these records:
Yes
No
Karen
Sri Hari
F203
F204
v The third OUTFIL statement finds records with 'B' in position 35. These are the
F1 and F2 records with a match. The F1 field is in positions 1-14 of the joined
record and the F2 field is in positions 15-34 of the joined record, so each joined
record is split into those two records and written to the BOTH file. The shorter
F1 record is padded with blanks on the right to the length of the F2 record.
Thus, BOTH contains these records:
484
F201
F202
F205
Note: If you only want one record per key in BOTH, you can have the BUILD for
FNAMES=BOTH specify the positions for just that record. For example,
BUILD=(1,14) for the F1 records or BUILD=(15,20) for the F2 records.
This example illustrates an alternate way to create three output files; with paired
F1/F2 records, unpaired F1 records and unpaired F2 records. It produces the same
output as Example 5. Whereas Example 5 uses an indicator in one position to
determine where the key was found, Example 6 uses a fill character in different
positions to determine where the key was found. Another drawback of the
Example 6 method is that you must use a FILL character that does not appear in
either input record. The Explanation for Example 6 is the same as for Example 5
up to the REFORMAT statement and then it differs as follows:
The REFORMAT statement defines the fields to be extracted for the joined records
in the order in which they are to appear. FIELDS=(F1:1,14,F2:1,20) tells DFSORT to
create the joined records as follows:
Joined Record Positions
----------------------1-14
15-34
Extracted from
----------------F1 positions 1-14
F2 positions 1-20
FILL=C'$' tells DFSORT to use $ as the fill character for the F1 field in an unpaired
F2 record and for the F2 field in an unpaired F1 record. We use the FILL character
to identify the unpaired records from each file; when used for this purpose, the
default of FILL=X'40' is usually not a good choice. You must select a FILL character
that will not appear in either input file.
The OPTION COPY statement tells DFSORT to copy the joined records. The
OUTFIL statements use the presence or absence of the $ fill character in certain
Chapter 4. Using a JOINKEYS application for joining two files
485
For F1 records without a match in F2 (for example, the F102 record), the F2 field
is filled with the FILL character. For F2 records without a match in F1 (for
example, the F203 record), the F1 field is filled with the FILL character. For F1
records with a match in F2 (for example, the F101 and F201 records), no FILL
characters are used.
v The first OUTFIL statement finds records with the FILL character in position 15.
These are the F1 records without a match in F2. The F1 field is in positions 1-14
of the joined record, so those positions are written to the F1ONLY file. Thus,
F1ONLY contains these records:
David
Frank
F102
F103
v The second OUTFIL statement finds records with the FILL character in position
1. These are the F2 records without a match in F1. The F2 field is in positions
15-34 of the joined record, so those positions are written to the F2ONLY file.
Thus, F2ONLY contains these records:
Yes
No
Karen
Sri Hari
F203
F204
v The third OUTFIL statement finds records without the FILL character in position
1 or position 15. These are the F1 and F2 records with a match. The F1 field is in
positions 1-14 of the joined record and the F2 field is in positions 15-34 of the
joined record, so each joined record is split into those two records and written to
the BOTH file. The shorter F1 record is padded with blanks on the right to the
length of the F2 record. Thus, BOTH contains these records:
Carrie
F101
No
Carrie
F201
Holly
F104
Yes
Holly
F202
Vicky
F105
Yes
Vicky
F205
Note: If you only want one record per key in BOTH, you can have the BUILD for
FNAMES=BOTH specify the positions for just that record. For example,
BUILD=(1,14) for the F1 records or BUILD=(15,20) for the F2 records.
486
487
488
INPUT/EXIT/OUTPUT LOGIC
FOR COPY APPLICATION
START
START
START
A
INPUT
PHASE
INPUT/EXIT/OUTPUT LOGIC
FOR MERGE APPLICATION
A
INPUT/
OUTPUT
PHASE
READ RECORD
FROM SORTIN
READ RECORD
FROM SORTIN
A
E15
E15
CHOOSE A
RECORD
MORE INPUT
RECORDS?
YES
A
E35
E35
NO
E15
WRITE
RECORD
TO SORTOUT
AND/OR
OUTFIL
DATA SETS
RETURNS
RC=8
SORT THE
RECORDS
MORE INPUT
RECORDS?
B
OUTPUT
PHASE
NO
E15
GET SORTED
RECORD
WRITE
RECORD
TO SORTOUT
AND/OR
OUTFIL
DATA SETS
YES
MORE INPUT
RECORDS?
NO
YES
READ
RECORD
FROM
SORTINnn
E35
A
RETURNS
RC=8
E35
WRITE
RECORD
TO SORTOUT
AND/OR
OUTFIL
DATA SETS
MORE SORTED YES
RECORDS?
E35
RETURNS
RC=8
EXIT
RETURNS
RC=8
EXIT
NO
E35
RETURNS
RC=8
EXIT
489
Sum records
Handle special I/O conditions
Determine action when intermediate storage is insufficient
Close data sets
Terminate DFSORT.
Figure 10 on page 489, Table 62 on page 491, and Table 63 on page 491 summarize
the functions of user exit routines and the exits and phases with which they can be
associated.
The following restrictions apply to the applications for which specific user exits
can be used:
v E11. E16, E17, E18 and E19 can be used for sort applications, but are ignored for
copy or merge applications.
v E15 can be used for sort or copy applications, but is ignored for merge
applications.
v E32 can be used for merge applications, but is ignored for copy or sort
applications.
v E61 can be used for sort or merge applications, but is ignored for copy
applications.
v E31, E35, E37, E38 and E39 can be used for sort, copy or merge applications.
490
Open/Initialize
N/A
Insert, Delete/Alter
Sum records
Handle special I/O conditions:
QSAM/BSAM and VSAM SORTIN
QSAM/BSAM SORTOUT
VSAM SORTOUT
N/A
Close/housekeeping
Terminate DFSORT
Note:
1. The SUM control statement can be used instead of your own routine to sum records.
2. Applies only to a tape work data set sort.
3. E39 can be used for SORTOUT, but not for OUTFIL data sets.
4. Applies only to a tape work data set sort or a Peerage/Vale sort without work data sets.
Table 63. Functions of Routines at Program User Exits (Copy and Merge)
Functions
Copy
Merge
Open/Initialize
N/A
Insert
Delete/alter
Sum records
Close/housekeeping
Terminate DFSORT
Note:
1. The SUM control statement can be used instead of your own routine to sum records.
491
Summing records
You can sum records for output by using the E35 user exit. However, you can also
use DFSORT's SUM program control statement to accomplish this without a user
exit. See SUM control statement on page 451.
492
Terminating DFSORT
You can write an exit routine to terminate DFSORT before all records have been
processed. You must associate these routines with the E15, E16, E32, and E35 user
exits.
493
Bit 32
Bits 33-39
Bits 40-63
24-bit
Address
31-bit
64-bit
Address
Address
494
Bit
Meaning when on
v User exits can return to DFSORT with either 24-bit, 31-bit, or 64-bit addressing
in effect. The return address that DFSORT placed in register 14 must be used.
Note: For a conventional merge or tape work data set sort application, user
exits:
must reside below 16MB virtual
must use 24-bit addressing mode
must not use a user exit address constant.
495
496
DFSORT places the address of a standard save area in this register. The
area can be used to save contents of registers used by your user exit. The
first word of the area contains the characters SM1 in its three low-order
bytes.
14
15
Contains the address of your user exit. This register can be used as a base
register for your user exit; your user exit can also use it to pass return
codes to DFSORT.
You can return control to DFSORT by performing a branch to the DFSORT return
point address in register 14 or by using a RETURN macro instruction. The
RETURN instruction can also be used to set return codes when multiple actions
are available at a user exit.
Your user exit must save all the general registers it uses. You can use the SAVE
macro instruction to do this. If you save registers, you must also restore them; you
can do this with the RETURN macro instruction.
Linkage examples
When calling your user exit, DFSORT places the return address in general register
14 and your routine's entry point address in general register 15. DFSORT has
already placed the register's save area address in general register 13. DFSORT then
makes a branch to your routine.
Your routine for the E15 user exit might incorporate the following assembler
instructions:
ENTRY E15
.
.
E15 SAVE
(5,9)
.
.
RETURN (5,9)
This coding saves and restores the contents of general registers 5 through 9. The
macro instructions are expanded into the following assembler language code:
ENTRY E15
.
.
E15 STM
5,9,40(13)
.
.
LM
5,9,40(13)
BR
14
If multiple actions are available at a user exit, your routine sets a return code in
general register 15 to inform DFSORT of the action it is to take. The following
macro instruction can be used to return to DFSORT with a return code of 12 in
register 15:
RETURN
RC=12
497
ENTRY E35
.
.
or
E35
CSECT
.
.
In all other circumstances, the user exit is not required to have an entry point that
has the same name as that of the associated program user exit.
E16
E17
E18
E19
E61
These user exits are discussed in sequence. To determine whether a particular user
exit can be used for your application, refer to Table 62 on page 491 and Table 63 on
page 491.
498
E15 user exit: passing or changing records for sort and copy
applications
If you write your E15 user exit in COBOL, see COBOL user exit routines on page
521 and COBOL E15 user exit: passing or changing records for sort on page 523.
The EXITCK option affects the way DFSORT interprets certain return codes from
user exit E15. To avoid ambiguity, this section assumes that the IBM default,
EXITCK=STRONG, was selected at your site. For complete information about E15
return codes in various situations with EXITCK=STRONG and EXITCK=WEAK,
see E15/E35 return codes and EXITCK on page 537.
DFSORT enters the E15 user exit routine each time a new record is brought into
the input phase. DFSORT continues to enter E15 (even when there are no input
records) until the user exit tells DFSORT, with a return-code of 8, not to return.
See Figure 10 on page 489 for logic flow details.
Some uses for the E15 user exit are:
v
v
v
v
Note:
1. If your E15 user exit is processing variable-length records, include a 4-byte
RDW at the beginning of each record you change or insert, before you pass it
back to DFSORT. The format of an RDW is described in z/OS DFSMS Using
Data Sets or System Programming Reference. (Alternatively, you can pad records
to the maximum length and process them as fixed-length.)
2. DFSORT uses the specified or defaulted value for L2 in the RECORD statement
to determine the length of the records your E15 user exit passes back to
DFSORT. For fixed-length records, be sure that the length of each record your
E15 user exit changes or inserts corresponds to the specified or defaulted L2
value. For variable-length records, be sure that the RDW of each record your
E15 user exit changes or inserts indicates a length that is less than or equal to
the specified or defaulted L2 value. Unwanted truncation or abends may occur
if DFSORT uses the wrong length for the records passed to it by your E15 user
exit.
For details of the L2 value, see RECORD control statement on page 438.
3. If you use the E15 user exit to pass all your records to DFSORT, you can omit
the SORTIN DD statement, in which case you must include a RECORD
statement in the program control statements.
499
500
Bytes 5 through 8
Contents
Bytes 1 through 8
X'00000000'
Bytes 9 through 16
X'00000000'
501
502
503
Byte 2
Byte 3
01
SYNAD field
02
EXLST field
03
00
04
00
00
Byte 4
EROPT code
EODAD field
00
00
00
SYNAD
Contains the location of yourread synchronous error routine. This routine is
entered only after the operating system has tried unsuccessfully to correct the
error. The routine must be assembled as part of your E18 user exit routine.
When the routine receives control, it must not store registers in the save area
pointed to by register 13.
EXLST
Contains the location of a list of pointers to routines that you want used to
check labels and accomplish other tasks not handled by data management. The
504
X'40'
X'20'
If you include this parameter in the DCB field list, you must place one of the
previous codes in byte 4 of the word. Bytes 2 and 3 of the word must contain
zeros.
When you use the EROPT option, the SYNAD field and the EODAD field must
contain the appropriate address in bytes 2 through 4. Or, if no routine is
available, bytes 2 and 3 must contain zeros, and byte 4 must contain X'01'. You
can use the assembler instruction DC AL3(1) to set up bytes 2 through 4.
EODAD
Contains the address of your end-of-file routine. If you specify EODAD, you
must include the end-of-file routine in your own routine.
A full description of these DCB fields is contained in z/OS DFSMS Macro
Instructions for Data Sets.
06
00
000000
If QSAM parameters are passed instead, they are accepted but ignored.
Either address entry can be omitted; if they both are included, they can be in any
order.
E18 password list: A password list included in your routine must have the
following format:
Two bytes on a halfword boundary:
505
8 bytes: ddname
8 bytes: Password
The last byte of the ddname field is destroyed by DFSORT. This list must not be
altered at any time during the program. MAINSIZE|SIZE=MAX must not be used
if this function is used.
E18 user exit list: The VSAM user exit list must be built using the VSAM EXLST
macro instruction giving the addresses of your routines handling VSAM user exit
functions. VSAM branches directly to your routines which must return to VSAM
via register 14.
Any VSAM user exit function available for input data sets can be used except
EODAD. If you need to do EODAD processing, write a LERAD user exit and
check for X'04' in the FDBK field of the RPL. This will indicate input EOD. This
field must not be altered when returning to VSAM because it is also needed by
DFSORT.
For details, see z/OS DFSMS Macro Instructions for Data Sets.
Figure 11 on page 507 shows an example of code your program can use to return
control to DFSORT.
506
ENTRY
E18
PARMLST
VSAMEXL
PWDLST
USYNAD
ULERAD
SER
LST
RTN
QSAMEOD
E18
.
.
LA
1,PARMLST
RETURN
CNOP
0,4
DC
X01
DC
AL3(SER)
DC
X02
DC
AL3(LST)
DC
X03
DC
X000080
EROPT CODE
DC
A(0)
DC
X04
DC
AL3(QSAMEOD)
DC
X05
DC
AL3(VSAMEXL)
DC
X06
DC
AL3(PWDLST)
DC
A(0)
.
.
EXLST SYNAD=USYNAD,LERAD=ULERAD
DC
H1
DC
CL8SORTIN
SORTIN DDNAME
DC
CL8INPASS
SORTIN PASSWORD
...
VSAM SYNCH ERROR RTN
...
VSAM LOGIC ERROR RTN
...
QSAM ERROR RTN
DC
X85,AL3(RTN) EXLST ADDRESS LIST1
...
EXLST ROUTINE
...
QSAM END OF FILE ROUTINE
507
Byte 2
Byte 3
01
SYNAD field
02
EXLST field
00
00
00
Byte 4
00
SYNAD
This field contains the location of your write synchronous error routine. This
routine is entered only after the operating system has unsuccessfully tried to
correct the error. It must be assembled as part of your own routine.
EXLST
The EXLST field contains the location of a list of pointers. These pointers point
to routines that are used to process labels and accomplish other tasks not
handled by data management. This list, and the routines to which it points,
must be included as part of your own routine.
A full description of these DCB fields can be found in z/OS DFSMS Macro
Instructions for Data Sets.
18. With a conventional merge or a tape work data set sort, control fields for which E is specified are treated as binary byte format
regardless of the actual format(s) specified.
508
Byte 2
Byte 3
Byte 4
00
00
00
00
The control field length allows you to write a more generalized modification
routine.
To alter the control field, change the control field image at the indicated address
(changing the address itself will have no effect).
The control field number is relative to all fields in the SORT or MERGE statement.
For example, if you specify:
SORT FIELDS=(4,2,CH,A,8,10,CH,E,25,2,BI,E)
509
510
Bytes 5 through 8
Bytes 9 through 12
Description
Bytes 1 through 8
X'00000000'
Bytes 9 through 16
Bytes 17 through 24
X'00000000'
511
512
513
Bytes 5 through 8
Bytes 9 through 12
Bytes 1 through 8
514
Contents
Description
X'00000000'
Description
Bytes 9 through 16
X'00000000'
Bytes 17 through 24
X'00000000'
515
516
ENTRY
E38
.
.
E38
LA
1,PARMLST
RETURN
CNOP
0,4
PARMLST DS
0H
DC
X05
DC
AL3(VSAMEXL)
DC
X06
DC
AL3(PWDLST)
DC
A(0)
.
.
VSAMEXL EXLST
SYNAD=USYNAD,LERAD=ULERAD
PWDLST
DC
H2
DC
CL8SORTIN01
SORTIN01 DDNAME
DC
CL8INPASS1
SORTIN01 PASSWORD
DC
CL8SORTIN02
SORTIN02 DDNAME
DC
CL8INPASS2
SORTIN02 PASSWORD
USYNAD
...
VSAM SYNCH ERROR RTN
ULERAD
...
VSAM LOGIC ERROR RTN
517
Sample E15 and E35 Routines using the 64-bit Parameter Lists
ENTRY
.
.
E39
LA
RETURN
CNOP
PARMLST DS
DC
DC
DC
DC
DC
.
.
VSAMEXL EXLST
PWDLST
DC
DC
DC
USYNAD
...
ULERAD
...
E39
1,PARMLST
0,4
0H
X05
AL3(VSAMEXL)
X06
AL3(PWDLST)
A(0)
SYNAD=USYNAD,LERAD=ULERAD
H1
CL8SORTOUT
SORTOUT DDNAME
CL8OUTPASS
SORTOUT PASSWORD
VSAM SYNCH ERROR RTN
VSAM LOGIC ERROR RTN
Sample E15 and E35 routines using the 64-bit parameter lists
Example 15. Sort with 64-bit parameter lists, E15, E35 and OUTFIL on page 839
in Chapter 11, Examples of DFSORT job streams, on page 819 shows, in
assembler language, how to use the 64-bit parameter lists for E15 and E35 exit
routines.
518
E15
CSECT
* IF A RECORD IS GREATER THAN 204 BYTES, TRUNCATE IT TO 204 BYTES.
* IF A RECORD IS LESS THAN 204 BYTES, PAD IT OUT TO 204 BYTES.
* ALL OF THE RESULTING RECORDS WILL BE 204 BYTES LONG
* (4 BYTES FOR THE RDW AND 200 BYTES OF DATA).
USING E15,12
SHOW BASE REG
STM 14,12,12(13)
SAVE ALL REGS EXCEPT 13
LA
12,0(0,15)
SET BASE REG
ST
13,SAVE15+4
SAVE BACKWARD POINTER
LA
14,SAVE15
SET FORWARD POINTER
ST
14,8(13)
IN SAVE AREA
LR
13,14
SET OUR SAVE AREA
LR
2,1
SAVE PARM LIST POINTER
L
3,0(,2)
LOAD ADDR OF RECORD
LTR 3,3
EOF
BZ
EOF
YES - DO NOT RETURN
LH
4,0(,3)
GET RDW
CH
4,CON204
IS RDW EQ 204
BE
ACCEPT
YES-ACCEPT IT
BL
PAD
LESS THAN 204-PAD
LH
4,CON204
LIMIT LENGTH TO 204
B
TRUNC
MORE THAN 204-TRUNCATE
PAD
DS
0H
PAD OR TRUNCATE
MVI DATA,X00
ZERO OUT THE BUFFER
MVC DATA+1(199),DATA
TRUNC
DS
0H
PAD OR TRUNCATE
BCTR 4,0
DECREASE RDW FOR EXECUTE
EX
4,MVPAD
MOVE RECORD INTO PAD/TRUNCATE BUFFER
MVC NEWRDW(2),CON204 SET NEW RDW TO 204
LA
3,BUFFER
POINT TO PADDED/TRUNCATED RECORD
ACCEPT DS
0H
SR
15,15
SET RC=0
LR
1,3
SET RECORD POINTER
B
GOBACK
EOF
LA
15,8
EOF - SET RC=8
GOBACK L
13,4(,13)
L
14,12(,13)
LM
2,12,28(13)
RESTORE REGS
BR
14
RETURN
MVPAD
MVC BUFFER(*-*),0(3) FOR EXECUTE
SAVE15 DS
18F
CON204 DC
H204
BUFFER DS
0H
NEWRDW DS
H
NEW RDW OF 204
DC
H0
DATA
DC
XL20000
BUFFER FOR PADDING/TRUNCATING
END
E16
CSECT
LA
BR
END
15,0
14
519
E35
CSECT
* IF A RECORD IS GREATER THAN 204 BYTES, TRUNCATE IT TO 204 BYTES.
* IF A RECORD IS LESS THAN 204 BYTES, PAD IT OUT TO 204 BYTES.
* ALL OF THE RESULTING RECORDS WILL BE 204 BYTES LONG
* (4 BYTES FOR THE RDW AND 200 BYTES OF DATA).
USING E35,12
SHOW BASE REG
STM 14,12,12(13)
SAVE ALL REGS EXCEPT 13
LA
12,0(0,15)
SET BASE REG
ST
13,SAVE15+4
SAVE BACKWARD POINTER
LA
14,SAVE15
SET FORWARD POINTER
ST
14,8(13)
IN SAVE AREA
LR
13,14
SET OUR SAVE AREA
LR
2,1
SAVE PARM LIST POINTER
L
3,0(,2)
LOAD ADDR OF RECORD
LTR 3,3
EOF
BZ
EOF
YES - DO NOT RETURN
LH
4,0(,3)
GET RDW
CH
4,CON204
IS RDW EQ 204
BE
ACCEPT
YES-ACCEPT IT
BL
PAD
LESS THAN 204-PAD
LH
4,CON204
LIMIT LENGTH TO 204
B
TRUNC
MORE THAN 204-TRUNCATE
PAD
DS
0H
PAD OR TRUNCATE
MVI DATA,X00
ZERO OUT THE BUFFER
MVC DATA+1(199),DATA
TRUNC
DS
0H
PAD OR TRUNCATE
BCTR 4,0
DECREASE RDW FOR EXECUTE
EX
4,MVPAD
MOVE RECORD INTO PAD/TRUNCATE BUFFER
MVC NEWRDW(2),CON204 SET NEW RDW TO 204
LA
3,BUFFER
POINT TO PADDED/TRUNCATED RECORD
ACCEPT DS
0H
SR
15,15
SET RC=0
LR
1,3
SET RECORD POINTER
B
GOBACK
EOF
LA
15,8
EOF - SET RC=8
GOBACK L
13,4(,13)
L
14,12(,13)
LM
2,12,28(13)
RESTORE REGS
BR
14
RETURN
MVPAD
MVC BUFFER(*-*),0(3) FOR EXECUTE
SAVE15 DS
18F
CON204 DC
H204
BUFFER DS
0H
NEWRDW DS
H
NEW RDW OF 204
DC
H0
DATA
DC
XL20000
BUFFER FOR PADDING/TRUNCATING
END
520
521
522
523
524
525
LINKAGE SECTION.
01 RECORD-FLAGS
PIC 9(8) BINARY.
88 FIRST-REC
VALUE 00.
88 MIDDLE-REC
VALUE 04.
88 END-REC
VALUE 08.
01 NEW-REC
PIC X(100).
01 RETURN-REC
PIC X(100).
01 UNUSED1
PIC 9(8) BINARY.
01 UNUSED2
PIC 9(8) BINARY.
01 UNUSED3
PIC 9(8) BINARY.
01 UNUSED4
PIC 9(8) BINARY.
01 UNUSED5
PIC 9(8) BINARY.
01 EXITAREA-LEN
PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 19. LINKAGE SECTION Code Example for E15 (Fixed-Length Records)
LINKAGE SECTION.
01 RECORD-FLAGS
PIC 9(8) BINARY.
88 FIRST-REC
VALUE 00.
88 MIDDLE-REC
VALUE 04.
88 END-REC
VALUE 08.
01 NEW-REC.
05 NREC OCCURS 1 TO 200 TIMES
DEPENDING ON NEW-REC-LEN
PIC X.
01 RETURN-REC.
05 RREC OCCURS 1 TO 200 TIMES
DEPENDING ON RETURN-REC-LEN PIC X.
01 UNUSED1
PIC 9(8) BINARY.
01 UNUSED2
PIC 9(8) BINARY.
01 NEW-REC-LEN
PIC 9(8) BINARY.
01 RETURN-REC-LEN
PIC 9(8) BINARY.
01 UNUSED3
PIC 9(8) BINARY.
01 EXITAREA-LEN
PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 20. LINKAGE SECTION Code Example for E15 (Variable-Length Record)
526
527
528
For the VLR example, Figure 20 on page 526, you would code:
PROCEDURE DIVISION USING RECORD-FLAGS, NEW-REC,
RETURN-REC, UNUSED1, UNUSED2,
NEW-REC-LEN, RETURN-REC-LEN,
UNUSED3, EXITAREA-LEN, EXITAREA.
529
530
531
LINKAGE SECTION.
01 RECORD-FLAGS
PIC 9(8) BINARY.
88 FIRST-REC
VALUE 00.
88 MIDDLE-REC
VALUE 04.
88 END-REC
VALUE 08.
01 LEAVING-REC
PIC X(100).
01 RETURN-REC
PIC X(100).
01 OUTPUT-REC
PIC X(100).
01 UNUSED1
PIC 9(8) BINARY.
01 UNUSED2
PIC 9(8) BINARY.
01 UNUSED3
PIC 9(8) BINARY.
01 UNUSED4
PIC 9(8) BINARY.
01 EXITAREA-LEN
PIC 9(4) BINARY.
01 EXITAREA.
05 EAREA OCCURS 1 TO 256 TIMES
DEPENDING ON EXITAREA-LEN PIC X.
Figure 22. LINKAGE SECTION Code Example for E35 (Fixed-Length Records)
Figure 23. LINKAGE SECTION Code Example for E35 (Variable-Length Records)
532
533
534
Note: If your routine changes record size, you must indicate the new size on
the RECORD statement.
20: Replace Record
If you want to replace the record leaving DFSORT:
v Move the replacement record to the return record field
v For VLR records, move the length to the return record length field
v Return with RETURN-CODE set to 20.
See E15/E35 return codes and EXITCK on page 537 for complete details of the
meanings of return codes in various situations.
For the VLR example, Figure 23 on page 532, you would code:
PROCEDURE DIVISION USING RECORD-FLAGS, LEAVING-REC,
RETURN-REC, OUTPUT-REC, UNUSED1,
LEAVING-REC-LEN, RETURN-REC-LEN,
OUTPUT-REC-LEN, EXITAREA-LEN, EXITAREA.
535
IDENTIFICATION DIVISION.
PROGRAM-ID.
CE15.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 RECORD-FLAGS
88 FIRST-REC
88 MIDDLE-REC
88 END-REC
01 NEW-REC.
05 NFILL1
05 NEW-DEPT
05 NFILL2
01 RETURN-REC.
05 RFILL1
05 RETURN-DEPT
05 RFILL2
536
IDENTIFICATION DIVISION.
PROGRAM-ID.
CE35.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INSERT-DONE PIC 9(1) VALUE 0.
01 K22-REC.
05 K22-MANAGER PIC X(20) VALUE "J. DOE".
05 K22-DEPT
PIC X(3) VALUE "K22".
05 K22-FUNC
PIC X(20) VALUE "ACCOUNTING".
05 K22-LATER PIC X(30) VALUE SPACES.
01 LEAVING-VAR-LEN PIC 9(8) BINARY.
LINKAGE SECTION.
01 RECORD-FLAGS
PIC 9(8) BINARY.
88 FIRST-REC
VALUE 00.
88 MIDDLE-REC
VALUE 04.
88 END-REC
VALUE 08.
01 LEAVING-REC.
05 LREC-MANAGER PIC X(20).
05 LREC-DEPT
PIC X(3).
05 LREC-FUNC
PIC X(20).
05 LREC-LATER OCCURS 1 TO 157 TIMES
DEPENDING ON LEAVING-VAR-LEN PIC X.
01 RETURN-REC.
05 RREC
OCCURS 1 TO 200 TIMES
DEPENDING ON RETURN-REC-LEN PIC X.
01 OUTPUT-REC.
05 OREC
OCCURS 1 TO 200 TIMES
DEPENDING ON OUTPUT-REC-LEN PIC X.
01 UNUSED1
PIC 9(8) BINARY.
01 LEAVING-REC-LEN
PIC 9(8) BINARY.
01 RETURN-REC-LEN
PIC 9(8) BINARY.
01 OUTPUT-REC-LEN
PIC 9(8) BINARY.
PROCEDURE DIVISION USING RECORD-FLAGS, LEAVING-REC,
RETURN-REC, OUTPUT-REC, UNUSED1, LEAVING-REC-LEN,
RETURN-REC-LEN, OUTPUT-REC-LEN.
IF END-REC
MOVE 8 TO RETURN-CODE
ELSE
IF INSERT-DONE EQUAL TO 1
MOVE 0 TO RETURN-CODE
ELSE
SUBTRACT 43 FROM LEAVING-REC-LEN
GIVING LEAVING-VAR-LEN.
IF LREC-DEPT GREATER THAN K22-DEPT
MOVE 1 TO INSERT-DONE
MOVE 43 TO RETURN-REC-LEN
MOVE K22-REC TO RETURN-REC
MOVE 12 TO RETURN-CODE
ELSE
MOVE 0 TO RETURN-CODE
END-IF
END-IF
GOBACK.
537
Meaning with
EXITCK=WEAK
Invalid
Do not return
Invalid
Do not return
Do not return
Do not return
12
Insert record
Insert record
16
Terminate DFSORT
Terminate DFSORT
20 (COBOL only)
Invalid
Do not return
All others
Invalid
Invalid
Table 73. E15 With a SORTIN Data Set Before End of Input
Meaning with EXITCK=STRONG or
EXITCK=WEAK
0
No action/record altered
Delete record
Do not return
12
Insert record
16
Terminate DFSORT
20 (COBOL only)
Alter/replace record
All others
Invalid
Table 74. E15 With a SORTIN Data Set After End of Input
Meaning with
EXITCK=STRONG
Meaning with
EXITCK=WEAK
Invalid
Do not return
Invalid
Do not return
Do not return
Do not return
12
Insert record
Insert record
16
Terminate DFSORT
Terminate DFSORT
20 (COBOL only)
Invalid
Do not return
All others
Invalid
Invalid
Table 75. E35 With a SORTOUT or OUTFIL Data Set Before End of Input
Meaning with EXITCK=STRONG or
EXITCK=WEAK
538
No action/record altered
Delete record
Do not return
Insert record
16
Terminate DFSORT
20 (COBOL only)
Alter/replace record
All others
Invalid
Table 76. E35 Without a SORTOUT or OUTFIL Data Set Before End of Input
Meaning with
EXITCK=STRONG
Meaning with
EXITCK=WEAK
Invalid
Delete record
Delete record
Delete record
Do not return
Do not return
12
Invalid
Delete record
16
Terminate DFSORT
Terminate DFSORT
20 (COBOL only)
Invalid
Delete record
All others
Invalid
Invalid
Table 77. E35 With a SORTOUT or OUTFIL Data Set After End of Input
Meaning with
EXITCK=STRONG
Meaning with
EXITCK=WEAK
Invalid
Do not return
Invalid
Do not return
Do not return
Do not return
12
Insert record
Insert record
16
Terminate DFSORT
Terminate DFSORT
20 (COBOL only)
Invalid
Do not return
All others
Invalid
Invalid
Table 78. E35 without a SORTOUT or OUTFIL Data Set After End of Input
Meaning with
EXITCK=STRONG
Meaning with
EXITCK=WEAK
Invalid
Do not return
Invalid
Do not return
Do not return
Do not return
12
Invalid
Do not return
16
Terminate DFSORT
Terminate DFSORT
20 (COBOL only)
Invalid
Do not return
All others
Invalid
Invalid
539
540
541
You can also use DFSPARM to provide different DFSORT control statements for
multiple invocations of DFSORT from a program. However, the control statements
must be located in temporary or permanent data sets and FREE=CLOSE must be
used. Here's an example of using DFSPARM to override the control statements for
a COBOL program with three SORT verbs:
//DFSPARM DD DSN=DP1,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP2,DISP=SHR,FREE=CLOSE
//DFSPARM DD DSN=DP3,DISP=SHR,FREE=CLOSE
DP1, DP2, and DP3 can contain any DFSORT control statements you like. The
statements in DP1 will be used for the first call to DFSORT, the statements in DP2
for the second and the statements in DP3 for the third.
For complete details on DFSPARM, see DFSPARM DD statement on page 76.
542
DC
DC
C SORT FIELDS=(10,15,CH,A)
C
This form, with a trailing blank separately defined, allows you to refer to the last
byte of the statement (SORT statement end address) by the name SORTEND.
INCLBEG
INCLEND
DC
DC
C INCLUDE COND=(5,3,CH,NE,CJ82)
C
543
544
Register 1
X '80'
Offset
(Hex) (Dec)
Byte 1
Byte 3 and 4
-2
-2
Unused
2
6
2
6
X'00'
X'00'
1,3
1,5
A
E
10
14
X'00'
X'00'
1,3
1,5
12
18
X'00'
16
22
X'00'
1A
1E
26
30
X'02'
X'00'
2,3
2,5
22
34
X'00'
26
38
X'01'
2A
42
X'03'
2E
46
X'04'
2,4
32
36
50
54
X'05'
X'00'
2,3
2,5
3A
3E
58
62
X'06'
X'00'
2,3
2,5
42
66
X'F6'
46
70
X'F7'
2
2
Unused
Notes
4A
74
X'FD'
4E
78
X'FE'
52
82
X'FF'
Message option
56
86
5A
5E
90
94
X'07'
X'00'
2,3
2,5
62
66
98
102
X'08'
X'00'
2,3
2,5
6A
6E
106
110
X'09'
X'00'
2,3
2,5
72
76
114
118
X'0A'
X'00'
2,3
2,5
7A
7E
122
126
X'0B'
X'00'
2,3
2,5
82
86
130
134
X'0E'
X'00'
2,3
2,5
8A
8E
138
142
X'0F'
X'00'
2,3
2,5
92
96
146
150
X'10'
X'00'
2,3
2,5
545
Required entry. Must appear in the relative position shown. The offset
shown is the actual offset of this entry.
2.
Optional entry. Can appear anywhere after the required entries. The
displayed offset is for identification purposes onlythe actual offset of this
entry can vary. Optional entries must be consecutive but can appear in any
order.
3.
4.
5.
Required entry. Contains the ending address for a control statement and
must immediately follow the entry containing the starting address for that
same control statement.
Explanation
-2 to -1
Unused.
0 to +1
The byte count. This 2-byte field contains the length in bytes of the
parameter list. This two byte field is not included when counting the
number of bytes occupied by the list.
The total length of the required entries is 24 (X'0018'). All optional entries
are four bytes long except those referring to control statement images
which are eight bytes each.
546
2-5
6-9
10-13
The starting address of the RECORD statement image, if any; otherwise, all
zeros. Must be in the last three bytes. The first byte must contain X'00'.
14-17
The ending address of the RECORD statement image, if any; otherwise, all
zeros. Must be in the last three bytes. The first byte must contain X'00'.
18-21
The address of the E15 or E32 routine that your program has placed in
main storage, if any; otherwise, all zeros. Must be in the last three bytes.
The first byte must contain X'00'.
22-25
The address of the E35 routine that your program has placed in main
storage, if any; otherwise, all zeros. Must be in the last three bytes. The
first byte must contain X'00'.
26-29
The starting address of the MODS statement image. Must be in the last
three bytes. The first byte must contain X'02'.
30-33
The ending address of the MODS statement. Must be in the last three
bytes. The first byte must contain X'00'.
Main storage value. The first byte must contain X'00'. The next three bytes
contain either the characters MAX or a hexadecimal value. You can use this
option to temporarily override the SIZE installation option. For full
override and applicability details, see Appendix B, Specification/override
of DFSORT options, on page 863. For an explanation of this value, see the
discussion of the MAINSIZE parameter in OPTION control statement on
page 173.
38-41
A reserved main storage value. The first byte must contain X'01'. The next
three bytes contain a hexadecimal value that specifies a number of bytes to
be reserved, where the minimum is 4K. For an explanation of this value,
see the explanation of the RESINV parameter in OPTION control
statement on page 173.
You can use this option to temporarily override the RESINV installation
option. For full override and applicability details, see Appendix B,
Specification/override of DFSORT options, on page 863.
42-45
Message ddname. The first byte must contain X'03'. The next three bytes
contain the address of an 8-byte DD statement name for the message data
set, padded with blanks on the right if necessary. The name can be any
valid DD statement name, but must be unique.
You can use this option to temporarily override the MSGDDN installation
option. For full override details, see Appendix B, Specification/override of
DFSORT options, on page 863. For details on the use of the message data
set, see z/OS DFSORT Messages, Codes and Diagnosis Guide.
46-49
Number of input files to a merge. This entry is needed only if the MERGE
statement is present without the FILES option and input to the merge is
supplied through the E32 user exit. The first byte must contain X'04'. The
next three bytes contain the number of files in hexadecimal. For full
override and applicability details, see Appendix B, Specification/override
of DFSORT options, on page 863.
50-53
The starting address of the DEBUG statement image. Must be in the last
three bytes. The first byte must contain X'05'.
54-57
The ending address of the DEBUG statement image. Must be in the last
three bytes. The first byte must contain X'00'.
58-61
The starting address of the ALTSEQ statement image. Must be in the last
three bytes. The first byte must contain X'06'.
62-65
The ending address of the ALTSEQ statement image. Must be in the last
three bytes. The first byte must contain X'00'.
66-69
70-73
User exit address constant. These 4 bytes are passed to E15 (at offset 4 in
the E15 parameter list), to E32 (at offset 8 in the E32 parameter list) or to
E35 (at offset 8 in the E35 parameter list) after DFSORT replaces the X'F7'
with X'00'.
Note: The user exit address constant must not be used for a Conventional
merge or tape work data set sort application.
74-77
X'FD' in the first byte (the VLSHRT option) specifies that DFSORT is to
continue processing if it finds a variable-length input record too short to
Chapter 6. Invoking DFSORT from a program
547
If the first byte contains X'FE', you can use the next three bytes to pass an
address of a 104-byte field save area where ESTAE information is saved.
These bytes must contain zeros if the ESTAE information is not saved.
If a system or user exit abend occurs, the DFSORT ESTAE recovery routine
will copy the first 104 bytes of the SDWA into this area before returning to
any higher level ESTAE recovery routines.
For more information on the DFSORT ESTAE recovery routine, see
Appendix E, DFSORT abend processing, on page 907
82-85
The message option. The first byte must contain X'FF'. The following three
bytes contain the characters NOF, (I), or (U). You can use this option to
temporarily override the MSGPRT installation option.
NOF
Messages and control statements are not printed. Critical messages are written
to the master console.
(I)
All messages except diagnostic messages (ICE800I to ICE999I) are printed.
Critical messages are also written to the master console. Control statements are
printed only if LIST is in effect.
(U)
Only critical messages are printed. They are also written to the master console.
Control statements are not printed (NOLIST is forced).
All messages are written to the message data set. For details on use of the message
data set, see z/OS DFSORT Messages, Codes and Diagnosis Guide For full override
and applicability details, see Appendix B, Specification/override of DFSORT
options, on page 863.
For compatibility reasons, the forms (NO, (AB, (AP, (AC, (CB, (CC, (CP, (PC, (SC,
and (SP are also accepted.
The following list shows the equivalent specifications for these aliases:
Table 79. Aliases for Message Option
548
MSGPRT
MSGCON
(NO
NONE
NONE
(AB
ALL
ALL
(AP
ALL
CRITICAL
(AC
NONE
ALL
(CB
CRITICAL
CRITICAL
(CC
NONE
CRITICAL
(CP
CRITICAL
CRITICAL
(PC
ALL
ALL
(SC
ALL
CRITICAL
(SP
86-89
MSGPRT
MSGCON
CRITICAL
ALL
90-93
The starting address of the SUM statement image. Must be in the last three
bytes. The first byte must contain X'07'.
94-97
The ending address of the SUM statement image. Must be in the last three
bytes. The first byte must contain X'00'.
98-101
The starting address of the INCLUDE or OMIT statement image. Must be
in the last three bytes. The first byte must contain X'08'.
102-105
The ending address of the INCLUDE or OMIT statement image. Must be
in the last three bytes. The first byte must contain X'00'.
106-109
The starting address of the OUTREC statement image. Must be in the last
three bytes. The first byte must contain X'09'.
110-112
The ending address of the OUTREC statement image. Must be in the last
three bytes. The first byte must contain X'00'.
114-116
The starting address of the INREC statement image. Must be in the last
three bytes. The first byte must contain X'0A'.
118-121
The ending address of the INREC statement image. Must be in the last
three bytes. The first byte must contain X'00'.
122-125
The starting address of the OUTFIL statement image. Must be in the last
three bytes. The first byte must contain X'0B'.
126-129
The ending address of the OUTFIL statement image. Must be in the last
three bytes. The first byte must contain X'00'.
549
550
Detailed specifications for each of the entries in the parameter list follow:
Byte
Explanation
0-3
551
Optional. The address of the E15 or E32 user exit routine that your
program has placed in main storage (for example, via LOAD), if any;
otherwise, all zeros.
f (bit 0) has the following meaning:
v 0 = Enter the user exit with 24-bit addressing in effect (AMODE 24).
v 1 = Enter the user exit with 31-bit addressing in effect (AMODE 31).
Note: If the Blockset or Peerage/Vale technique is not selected, the user
exit is always entered with 24-bit addressing in effect (AMODE 24).
8-11
Optional. The address of the E35 user exit routine that your program has
placed in main storage (for example, via LOAD), if any; otherwise, all
zeros.
f (bit 0) has the following meaning:
v 0 = Enter the user exit with 24-bit addressing in effect (AMODE 24).
v 1 = Enter the user exit with 31-bit addressing in effect (AMODE 31).
Note: If the Blockset or Peerage/Vale technique is not selected, the user
exit is always entered with 24-bit addressing in effect (AMODE 24).
12-15
Optional. This field will be passed to the E15, E32 or E35 user exit routines.
Note: The user exit address constant must not be used for a Conventional
merge or tape work data set sort application.
16-19
20-23
24-27
Optional. The address of the E18 user exit routine that your program has
placed in main storage (for example, via LOAD), if any; otherwise, all
zeros.
Note: This parameter is ignored for a merge application and for a tape
work data set sort application.
f (bit 0) has the following meaning:
v 0 = Enter the user exit with 24-bit addressing in effect (AMODE 24).
v 1 = Enter the user exit with 31-bit addressing in effect (AMODE 31).
Note: If the Blockset or Peerage/Vale technique is not selected, the user
exit is always entered with 24-bit addressing in effect (AMODE 24).
552
Optional. The address of the E39 user exit routine that your program has
placed in main storage (for example, via LOAD), if any; otherwise, all
zeros.
Note: This parameter is ignored for a conventional merge application and
for a tape work data set sort application.
f (bit 0) has the following meaning:
v 0 = Enter the user exit with 24-bit addressing in effect (AMODE 24).
v 1 = Enter the user exit with 31-bit addressing in effect (AMODE 31).
Note: If the Blockset or Peerage/Vale technique is not selected, the user
exit is always entered with 24-bit addressing if effect (AMODE 24).
32-35
Note: The list can be ended after any parameter. The last parameter in the list
must be followed by X'FFFFFFFF'.
Bits 0-31
Bit 32
Bits 33-39
Bits 40-63
24-bit
Address
31-bit
64-bit
Address
Address
553
554
Detailed specifications for each of the entries in the parameter list follow:
Chapter 6. Invoking DFSORT from a program
555
8
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
556
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
10-23
557
The address of the area containing the DFSORT control statements, if any;
otherwise, all zeros. Can be a 64-bit address, a clean 31-bit address or a
clean 24-bit address.
Refer to the previous section for the format of the control statement area.
Attention: The area must start with a two-byte length field. If zeros are
specified, all the required control statements must be provided in DFSORT
DD DFSPARM or SORTCNTL.
32-39
The address of the E15 or E32 user exit routine that the program has
placed in main storage (for example, via LOAD), if any; otherwise, all
zeros. Must be a clean 31-bit address or a clean 24-bit address.
40-47
The address of the E35 user exit routine that the program has placed in
main storage (for example, via LOAD), if any; otherwise, all zeros. Must be
a clean 31-bit address or a clean 24-bit address.
48-55
The 4-byte user exit address constant will be passed to the E15, E32 or E35
user exit routines.
Note: The user exit address constant must not be used for a Conventional
merge or tape work data set sort application.
56-63
64-71
72-79
The address of the E18 user exit routine that the program has placed in
main storage (for example, via LOAD), if any; otherwise, all zeros. Must be
a clean 31-bit address or a clean 24-bit address.
Note: This parameter is ignored for a merge application and for a tape
work data set sort application.
80-87
The address of the E39 user exit routine that the program has placed in
main storage (for example, via LOAD), if any; otherwise, all zeros. Must be
a clean 31-bit address or a clean 24-bit address.
Note: This parameter is ignored for a conventional merge application and
for a tape work data set sort application.
88-95
558
559
LA 1,PARLST
LOAD ADDR OF PARAM POINTER IN R1
ATTACH EP=SORT
INVOKE SORT
.
.
.
PARLST DC X80,AL3(ADLST)
POINTER FLAG/ADDRESS OF PARAM LIST
.
.
.
CNOP 2,4
ALIGN TO CORRECT BOUNDARY
ADLST DC AL2(LISTEND-LISTBEG) PARAM LIST LENGTH
LISTBEG DC A(SORTA)
BEGINNING ADDRESS OF SORT STMT
DC A(SORTZ)
END ADDRESS OF SORT STMT
DC A(RECA)
BEGINNING ADDR OF RECORD STMT
DC A(RECZ)
END ADDR OF RECORD STMT
DC A(MOD1)
ADDR OF E15 RTN
DC A(MOD2)
ADDR OF E35 RTN
DC CABC#
DDNAME CHARACTERS
DC F720000
OPTIONAL MAIN STORAGE VALUE
DC XFF
MESSAGE OPTION FLAG BYTE
DC C(U)
MESSAGE OPTION
LISTEND EQU *
SORTA DC C SORT FIELDS=(10,15,CH,A), SORT CONTROL STMT
DC CFILSZ=E4780
(CONTINUED)
SORTZ DC C
DELIMITER
RECA
DC C RECORD LENGTH=100,TYPE=F
RECORD CONTROL STMT
RECZ
DC C
DELIMITER
DS 0H
USING *,15
MOD1
(routine for E15 user exit)
.
.
USING *,15
MOD2
(routine for E35 user exit)
560
.
.
.
LA
R1,PL1
ST
R2,PL4
*
*
LINK EP=SORT
.
.
.
PL1
DC
A(CTLST)
ADDRESS OF CONTROL STATEMENTS
PL2
DC
A(E15)
ADDRESS OF E15 ROUTINE
PL3
DC
A(0)
NO E35 ROUTINE
PL4
DS
A
USER EXIT ADDRESS CONSTANT
PL5
DC
F-1
INDICATE END OF LIST
CTLST DS
0H
CONTROL STATEMENTS AREA
DC
AL2(CTL2-CTL1)
LENGTH OF CHARACTER STRING
CTL1
DC
C SORT FIELDS=(4,5,CH,A)
DC
C OPTION
DC
CRESINV=2048,FILSZ=E25000,MSGDDN=MSGOUT
DC
C OMIT COND=(5,8,EQ,13,8),FORMAT=FI
DC
C RECORD TYPE=F,LENGTH=80
CTL2
EQU *
OUT
DCB DDNAME=SYSOUT,... MYSORT USES SYSOUT
E15
DS
0H
E15 ROUTINE
.
.
.
BR
R14
RETURN TO SORT/MERGE
* MAPPING OF PARAMETER LIST PASSED TO E15 FROM SORT/MERGE
SRTLST DS
A
ADDRESS OF RECORD
GMA
DS
A
ADDRESS OF AREA GETMAINED BY
*
MYSORT
.
.
.
Copy restrictions
Copy applications cannot be done when DFSORT is invoked from a PL/I program.
If you invoke DFSORT from a COBOL program, the following restrictions apply:
v The OPTION COPY statement can be placed in either the COBOL IGZSRTCD
data set or the DFSORT SORTCNTL or DFSPARM data set.
Chapter 6. Invoking DFSORT from a program
561
562
ICETOOL/DFSORT relationship
ICETOOL is a batch front-end utility that uses the capabilities of DFSORT to
perform the operations you request.
Copyright IBM Corp. 1973, 2015
563
Overview
ICETOOL includes 17 operators that perform sort, merge, copy, statistical, report,
selection, and splice operations. Most of the operations performed by ICETOOL
require only simple JCL and operator statements. Some ICETOOL operations
require or allow you to specify complete DFSORT control statements (such as
SORT, MERGE, INCLUDE or OMIT, INREC, and OUTFIL) to take full advantage
of DFSORT's capabilities.
ICETOOL automatically calls DFSORT with the particular DFSORT control
statements and options required for each operation (such as DYNALLOC for
sorting).
ICETOOL also produces messages and return codes describing the results of each
operation and any errors detected. Although you generally do not need to look at
the DFSORT messages produced as a result of an ICETOOL run, they are available
in a separate data set if you need them.
ICETOOL can be called directly or from a program. ICETOOL allows operator
statements (and comments) to be supplied in a data set or in a parameter list
passed by a calling program. For each operator supplied in the parameter list,
ICETOOL puts information in the parameter list pertaining to that operation, thus
allowing the calling program to use the information derived by ICETOOL.
564
Overview
//outdd DD
Defines an output data set for a COPY, DATASORT, MERGE, RESIZE,
SELECT, SORT, SPLICE, or SUBSET operation.
//savedd DD
Defines an output data set for a SELECT or SUBSET operation.
//listdd DD
Defines a list data set for a DEFAULTS, DISPLAY, or OCCUR operation.
//countdd DD
Defines an output data set for a COUNT operation
//xxxxCNTL DD
Contains DFSORT control statements for a COPY, COUNT, DATASORT,
MERGE, RESIZE, SELECT, SORT, SPLICE or SUBSET operation.
565
Overview
be produced. The values printed can be limited to those for which the value
count meets specified criteria (for example, only duplicate values or only
non-duplicate values).
RESIZE
Creates a larger record from multiple shorter records, or creates multiple
shorter records from a larger record, that is, resizes fixed length records.
RANGE
Prints a message containing the count of values in a specified range for a
specified numeric field in a data set.
SELECT
Selects records from a data set for inclusion in an output data set based on
meeting criteria for the number of times specified numeric or character field
values occur (for example, only duplicate values or only non-duplicate values).
Records that are not selected can be saved in a separate output data set.
SORT
Sorts a data set to one or more output data sets.
SPLICE
Splices together specified fields from records that have the same specified
numeric or character field values (that is, duplicate values), but different
information. Specified fields from two or more records can be combined to
create an output record. The fields to be spliced can originate from records in
different data sets, so you can use SPLICE to do various "join" and "match"
operations.
STATS
Prints messages containing the minimum, maximum, average, and total for
specified numeric fields in a data set.
SUBSET
Selects records from a data set based on keeping or removing header records
(the first n records), relative records, or trailer records (the last n records).
Records that are not selected can be saved in a separate output data set.
UNIQUE
Prints a message containing the count of unique values for a specified numeric
or character field.
VERIFY
Examines specified decimal fields in a data set and prints a message
identifying each invalid value found for each field.
Restriction: You can perform a JOINKEYS application with the COPY and SORT
operators, but not with the other operators.
566
Overview
Using symbols
You can define and use a symbol for any field or constant in the following
ICETOOL operators: COUNT, DATASORT, DISPLAY, OCCUR, RANGE, SELECT,
SPLICE, STATS, SUBSET, UNIQUE, and VERIFY. You can also use symbols in the
DFSORT control statements you specify for an ICETOOL run. This makes it easy to
create and reuse collections of symbols (that is, mappings) representing
information associated with various record layouts. You can use system symbols
(for example, &JOBNAME.) in your symbol constants. See Chapter 8, Using
symbols for fields and constants, on page 731 for complete details.
Invoking ICETOOL
ICETOOL can be invoked in the following three ways:
v Directly (that is, not from a program) using the TOOLIN Interface
v From a program using the TOOLIN Interface
v From a program using the Parameter List Interface.
Chapter 7. Using ICETOOL
567
Overview
With the TOOLIN Interface, you supply ICETOOL statements in a data set defined
by the TOOLIN DD statement. ICETOOL prints messages in the data set defined
by the TOOLMSG DD statement.
With the Parameter List Interface, your program supplies ICETOOL statements in a
parameter list. ICETOOL prints messages in the data set defined by the TOOLMSG
DD statement and also puts information in the parameter list for use by your
program.
MODE STOP
VERIFY FROM(DATA1) ON(22,7,PD)
DISPLAY FROM(DATA1) LIST(SALARIES) TITLE(Employee Salaries) DATE TIME HEADER(Employee Name) HEADER(Salary) ON(1,20,CH)
ON(22,7,PD)
BLANK AVERAGE(Average Salary)
STATS FROM(DATA1) ON(22,7,PD)
RANGE FROM(DATA1) ON(22,7,PD) LOWER(20000)
RANGE FROM(DATA1) ON(22,7,PD) HIGHER(19999) LOWER(40000)
RANGE FROM(DATA1) ON(22,7,PD) HIGHER(40000)
OCCUR FROM(DATA1) LIST(SALARIES) TITLE(Employees Receiving Each Salary) DATE TIME HEADER(Salary) HEADER(Employee Count) ON(22,7,PD)
ON(VALCNT)
BLANK
Assume that you specify DD statements with the following ddnames for the
indicated data sets:
DATA1
A data set containing the name, salary, department, location and so on, of
each of your employees. The name field is in positions 1 through 20 in
character format and the salary field is in positions 22 through 28 in
packed decimal format.
SALARIES
A SYSOUT data set.
You can use the ICETOOL operators in Table 81 to do the following:
MODE STOP
If an error is found while processing one of the operators, subsequent
operators are not processed (that is, each operator is dependent on the
success of the previous operator).
VERIFY
Prints error messages in the TOOLMSG data set identifying any invalid
values in the packed decimal salary field.
DISPLAY
568
Overview
Prints a report with each employee's name and salary and the average for
all employee salaries in the SALARIES list data set.
STATS
Prints messages in the TOOLMSG data set showing the minimum,
maximum, average, and total of the individual salaries.
RANGE
The three RANGE operators print messages in the TOOLMSG data set
showing the number of salaries below $20,000, from $20,000 to $39,999, and
above $40,000.
OCCUR
Prints a report with each unique salary and the number of employees who
receive it in the SALARIES list data set.
* GROUP 1
MODE CONTINUE
COPY FROM(DATA1) TO(DATA2)
COPY FROM(MSTR1) TO(MSTR2)
SELECT FROM(DATA1) TO(SMALLDPT) ON(30,4,CH) LOWER(10)
UNIQUE FROM(MSTR1) ON(30,4,CH)
* GROUP 2
MODE STOP
COPY FROM(DATA1) TO(TEMP1) USING(NEW1)
COPY FROM(DATA1) TO(TEMP2) USING(NEW2)
COPY FROM(DATA1) TO(TEMP3) USING(NEW3)
SORT FROM(CONCAT) TO(FINALD,FINALP) USING(FINL)
Assume that you specify DD statements with the following ddnames for the
indicated data sets:
DATA1
A data set containing the name, salary, department, location, and so on, of each
of your employees. The department field is in positions 30 through 33 in
character format.
MSTR1
Master data set containing only the name and department of each of your
employees. The department field is in positions 30 through 33 in character
format.
DATA2, MSTR2, and SMALLDPT
Permanent data sets.
NEW1CNTL
A data set containing DFSORT control statements to INCLUDE employees in
department X100 and change the records to match the format of MSTR1.
NEW2CNTL
Same as NEW1CNTL but for department X200.
NEW3CNTL
Same as NEW1CNTL but for department X300.
569
Overview
TEMP1, TEMP2, and TEMP3
Temporary data sets.
FINLCNTL
A data set containing a DFSORT control statement to sort by department and
employee name.
CONCAT
A concatenation of the TEMP1, TEMP2, TEMP3, and MSTR1 data sets.
FINALD
A permanent data set.
FINALP
A SYSOUT data set.
You can use the ICETOOL operators in Table 82 on page 569 to do the following:
MODE CONTINUE
If an error is found while processing any of the group 1 operators,
subsequent group 1 operators are still processed; that is, group 1 operators
are not dependent on the success of the previous group 1 operators.
COPY
The two copy operators create backup copies of DATA1 and MSTR1.
SELECT
Creates a permanent output data set containing the name, salary,
department, location, and so on, of each employee in departments with
less than 10 people.
UNIQUE
Prints a message in the TOOLMSG data set showing the number of unique
departments.
MODE STOP
If an error is found while processing one of the group 2 operators,
subsequent group 2 operators are not processed; that is, each group 2
operator is dependent on the success of previous group 2 operators.
COPY
The three COPY operators create an output data set for the employees in
each department containing only name and department. Note that the
ddname requested by the USING(xxxx) operand is xxxxCNTL. For
example, USING(NEW1) requests ddname NEW1CNTL.
SORT
Sorts the three output data sets created by the COPY operators along with
the master name/department data set and creates permanent and SYSOUT
data sets containing the resulting sorted records.
You can combine both of these examples into a single ICETOOL job step.
570
TOOLMSG DD Statement
Defines the ICETOOL message data set for all operations. ICETOOL messages
and statements appear in this data set. ICETOOL uses RECFM=FBA,
LRECL=121 and the specified BLKSIZE for the TOOLMSG data set. If the
BLKSIZE you specify is not a multiple of 121, ICETOOL uses BLKSIZE=121. If
you do not specify the BLKSIZE, ICETOOL selects the block size as directed by
the SDBMSG installation option (see z/OS DFSORT Installation and
Customization).
The TOOLMSG DD statement must be present.
571
572
JCL restrictions
You should avoid using ddnames reserved for ICETOOL and DFSORT in
ICETOOL operands (FROM, TO, LIST, DISCARD, WRITE). In general, you should
also avoid supplying DD statements with ddnames reserved for DFSORT when
using ICETOOL because doing so can cause unpredictable results. Specifically:
v SORTCNTL should not be used as a ddname in ICETOOL operators nor should
it be supplied as a DD statement. A xxxxCNTL DD statement should only be
supplied when you specify a USING(xxxx) operand. xxxx must be four
characters that are valid in a ddname of the form xxxxCNTL. xxxx must not be
SYSx.
v SYSIN, SORTCNTL, SORTIN, SORTOUT, SORTINnn, and xxxxINnn (where xxxx
is specified in a USING operand) should not be used as ddnames in ICETOOL
operators nor supplied as DD statements.
v TOOLMSG, DFSMSG, SSMSG, SYMNAMES, SYMNOUT, TOOLIN, SYSUDUMP,
and SYSABEND should not be used as ddnames in ICETOOL operators.
v In general, xxxxWKdd ddnames should not be used as ddnames in ICETOOL
operators nor supplied as DD statements. However, if you want to override
dynamic allocation of work data sets for ICETOOL operators OCCUR and
UNIQUE, you can use SORTWKdd DD statements for that purpose. If you want
to override dynamic allocation of work data sets for ICETOOL operators
DATASORT, RESIZE, SELECT, SORT, SPLICE, and SUBSET, you can use
xxxxWKdd DD statements for that purpose in conjunction with the USING
operand.
v DFSPARM (or the ddname specified for the PARMDDN installation option)
should not be used as a ddname in ICETOOL operators. It should only be used
Chapter 7. Using ICETOOL
573
JCL Restrictions
as a DD statement to override DFSORT options for all operators, if appropriate.
Refer to DFSPARM DD statement on page 76 for details.
v xxxxOFdd (where xxxx is specified in a USING operand) is required as the
ddname when an OUTFIL statement in the xxxxCNTL data set specifies
FILES=dd. To avoid this requirement, use the FNAMES=ddname operand rather
than the FILES=dd operand in OUTFIL statements, and include a DD statement
for the specified ddname. See OUTFIL control statements on page 223 for
details of the FNAMES operand.
You should not use different DDs for a data set to be used for output and then
input in the same step, if that data set can be extended to a second or subsequent
volume, because that will result in incorrect output. See Data set notes and
limitations on page 13 for more information.
ICETOOL statements
Each operation must be described to ICETOOL using an operator statement.
Additionally, ICETOOL allows comment statements and blank statements. An
explanation of the general rules for coding ICETOOL statements is given later in
this section followed by a detailed discussion of each operator.
Any characters specified after the hyphen are ignored. Each operand must be
completely specified on one line.
A statement with an asterisk (*) in column 1 is treated as a comment statement. It
is printed with the other ICETOOL statements, but otherwise not processed. A
statement with blanks in columns 1 through 72 is treated as a blank statement. It is
ignored, because ICETOOL prints blank lines where appropriate.
574
COPY Operator
COPY operator
,
COPY
FROM(indd)
JKFROM
TO( outdd
USING(xxxx)
,
TO( outdd
VSAMTYPE(x)
USING(xxxx)
LOCALE(name)
LOCALE(CURRENT)
LOCALE(NONE)
SERIAL
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
Specifies the ddname of the input data set to be read by DFSORT for this
operation. An indd DD statement must be present and must define an input
data set that conforms to the rules for DFSORT's SORTIN data set.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
JKFROM
Specifies you are using a JOINKEYS application with this COPY operator to
copy the joined records. You must provide a USING(xxxx) operand. In
xxxxCNTL, you must provide a JOINKEYS statement with F1=ddname1 for the
F1 file and a JOINKEYS statement with F2=ddname2 for the F2 file, as well as
JOIN and REFORMAT statements as needed.
TO(outdd,...)
Specifies the ddnames of the output data sets to be written by DFSORT for this
operation. From 1 to 10 outdd names can be specified. An outdd DD statement
must be present for each outdd name specified. If a single outdd data set is
specified, DFSORT is called once to copy the indd data set to the outdd data
set, using SORTOUT processing; the outdd data set must conform to the rules
for DFSORT's SORTOUT data set. If multiple outdd data sets are specified and
Chapter 7. Using ICETOOL
575
COPY Operator
SERIAL is not specified, DFSORT is called once to copy the indd data set to
the outdd data sets, using OUTFIL processing; the outdd data sets must
conform to the rules for DFSORT's OUTFIL data sets.
TO and USING can both be specified. If USING is not specified, TO must be
specified. If TO is not specified, USING must be specified.
A ddname specified in the FROM operand must not also be specified in the
TO operand.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it must conform to the rules for DFSORT's SORTCNTL
data set.
TO and USING can both be specified. If USING is not specified, TO must be
specified. If TO is not specified, USING must be specified and the xxxxCNTL
data set must contain either one or more OUTFIL statements or a MODS
statement for an E35 routine that disposes of all records. Other statements are
optional.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
VSAMTYPE(x)
Specifies the record type for a VSAM input data set. x must be either F for
fixed-length record processing or V for variable-length record processing.
If VSAMTYPE(x) is specified, ICETOOL will pass a RECORD TYPE=x control
statement to DFSORT. (If you specify a RECORD TYPE=x statement in the
xxxxCNTL data set, it will override the one passed by ICETOOL.)
For complete information on record type processing for VSAM input, see
RECORD control statement on page 438.
LOCALE(name)
Specifies that locale processing is to be used and designates the name of the
locale to be made active during DFSORT processing. LOCALE(name) can be
used to override the LOCALE installation option. For complete details on
LOCALE(name), see the discussion of the LOCALE operand in OPTION
control statement on page 173.
LOCALE(CURRENT)
Specifies that locale processing is to be used, and the current locale active
when DFSORT is entered will remain the active locale during DFSORT
processing. LOCALE(CURRENT) can be used to override the LOCALE
installation option. For complete details on LOCALE(CURRENT), see the
discussion of the LOCALE operand in OPTION control statement on page
173.
LOCALE(NONE)
Specifies that locale processing is not to be used. DFSORT will use the binary
encoding of the code page defined for your data for collating and comparing.
LOCALE(NONE) can be used to override the LOCALE installation option. For
576
COPY Operator
complete details on LOCALE(NONE), see the discussion of the LOCALE
operand in OPTION control statement on page 173.
SERIAL
Specifies that OUTFIL processing is not to be used when multiple outdd data
sets are specified. DFSORT is called multiple times and uses SORTOUT
processing; the outdd data sets must conform to the rules for DFSORT's
SORTOUT data set. SERIAL is not recommended because the use of serial
processing (that is, multiple calls to DFSORT) instead of OUTFIL processing
can degrade performance and imposes certain restrictions as detailed later in
this section. SERIAL is ignored if a single outdd data set is specified.
DFSORT is called to copy the indd data set to the first outdd data set using the
DFSORT control statements in the xxxxCNTL data set if USING(xxxx) is
specified. If the first copy is successful, DFSORT is called as many times as
necessary to copy the first outdd data set to the second and subsequent outdd
data sets. Therefore, for maximum efficiency, use a disk data set as the first in
a list of outdd data sets on both disk and tape. If more than one outdd data set
is specified, DFSORT must be able to read the first outdd data set after it is
written in order to copy it to the other outdd data sets. Do not use a SYSOUT
or DUMMY data set as the first in a list of outdd data sets because:
v if the first data set is SYSOUT, DFSORT abends when it tries to copy the
SYSOUT data set to the second outdd data set.
v if the first data set is DUMMY, DFSORT copies the empty DUMMY data set
to the other outdd data sets, with the result that all outdd data sets are then
empty.
Copy examples
This section contains 2 copy examples.
Example 1
* Method 1
COPY FROM(MASTER) TO(PRINT,TAPE,DISK)
* Method 2
COPY FROM(MASTER) TO(DISK,TAPE,PRINT) SERIAL
This example shows two different methods for creating multiple output data sets.
Method 1 requires one call to DFSORT, one pass over the input data set, and
allows the output data sets to be specified in any order. The COPY operator copies
all records from the MASTER data set to the PRINT (SYSOUT), TAPE, and DISK
data sets, using OUTFIL processing.
Method 2 requires three calls to DFSORT, three passes over the input data set, and
imposes the restriction that the SYSOUT data set must not be the first TO data set.
The COPY operator copies all records from the MASTER data set to the DISK data
set and then copies the resulting DISK data set to the TAPE and PRINT (SYSOUT)
data sets. Because the first TO data set is processed three times (written, read,
read), placing the DISK data set first is more efficient than placing the TAPE data
set first. PRINT must not be the first in the TO list because a SYSOUT data set
cannot be read.
Example 2
* Method 1
COPY FROM(IN) TO(DEPT1) USING(DPT1)
COPY FROM(IN) TO(DEPT2) USING(DPT2)
COPY FROM(IN) TO(DEPT3) USING(DPT3)
Chapter 7. Using ICETOOL
577
COPY Operator
* Method 2
COPY FROM(IN) USING(ALL3)
This example shows two different methods for creating subsets of an input data
set. Assume that:
v The DPT1CNTL data set contains:
INCLUDE COND=(5,3,CH,EQ,CD01)
Method 1 requires three calls to DFSORT and three passes over the input data set:
v The first COPY operator copies the records from the IN data set that contain D01
in positions 5-7 to the DEPT1 data set.
v The second COPY operator copies the records from the IN data set that contain
D02 in positions 5-7 to the DEPT2 data set.
v The third COPY operator copies the records from the IN data set that contain
D03 in positions 5-7 to the DEPT3 data set.
Method 2 accomplishes the same result as method 1, but because it uses OUTFIL
statements instead of TO operands, requires only one call to DFSORT and one pass
over the input data set.
Example 3
COPY FROM(VSAMIN) TO(VSAMOUT) VSAMTYPE(V)
The COPY operator copies all records from the VSAMIN data set to the
VSAMOUT data set. The VSAM records are treated as variable-length.
578
COPY Operator
* Main task control statements for first COPY operator
* (operates on joined records).
INCLUDE COND=(8,1,CH,EQ,CY)
/*
//CTL2CNTL DD *
* JOINKEYS application control statements for second COPY operator.
JOINKEYS F1=IN1,FIELDS=(5,12,A),TASKID=T1
JOINKEYS F2=IN3,FIELDS=(9,12,A),TASKID=T2,SORTED
REFORMAT FIELDS=(F1:4,40,F2:7,20)
* Main task control statements for second COPY operator
* (operates on joined records).
OUTFIL FNAMES=OUT2,HEADER1=(Analysis Report),REMOVECC
/*
//T1F1CNTL DD *
* Control statements for subtask1 (F1=IN1) of both COPY operators.
* Subtask1 sorts/joins on 5,12,A automatically
* per JOINKEYS statement for TASKID=T1/F1=IN1.
INCLUDE COND=(21,3,CH,EQ,CJ82)
SUM FIELDS=NONE
/*
//T1F2CNTL DD *
* Control statements for subtask2 (F2=IN2) of first COPY operator.
* Subtask1 sorts/joins on 11,12,A automatically
* per JOINKEYS statement for TASKID=T1/F2=IN2.
OPTION SKIPREC=1
INCLUDE COND=(25,3,CH,EQ,CJ82)
/*
//T2F2CNTL DD *
* Control statements for subtask2 (F2=IN3) of second COPY operator.
* Subtask1 copies/joins on 9,12,A automatically
* per JOINKEYS statement for TASKID=T2/F2=IN3/SORTED.
INCLUDE COND=(5,3,CH,EQ,CJ82)
/*
COUNT operator
COUNT FROM(indd)
USING(xxxx)
VSAMTYPE(x)
LOCALE(name)
LOCALE(CURRENT)
LOCALE(NONE)
RC4
RC8
RC12
EMPTY
NOTEMPTY
HIGHER(x)
LOWER(y)
EQUAL(v)
NOTEQUAL(w)
SUB(q)
ADD(r)
WRITE(countdd)
TEXT('string')
DIGITS(d)
EDCOUNT(formatting)
WIDTH(n)
Prints a message containing the count of records in a data set. Can also be used to
subtract a value from the count or add a value to the count, to create an output
data set containing text and the count, or to set RC=12, RC=8, RC=4, or RC=0
based on meeting criteria for the number of records in a data set.
579
COUNT Operator
DFSORT is called to copy the indd data set to ICETOOL's E35 user exit. The
DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified. You
can use a DFSORT INCLUDE or OMIT statement in the xxxxCNTL data set to
count a subset of the input records.
If an INCLUDE or OMIT statement is specified in the xxxxCNTL data set, the
active locale's collating rules affect INCLUDE and OMIT processing as explained in
the Cultural Environment Considerations discussion in INCLUDE control
statement on page 96.
If EMPTY, NOTEMPTY, HIGHER(x), LOWER(y), EQUAL(v) or NOTEQUAL(w) is
not specified, ICETOOL prints a message containing the record count as
determined by its E35 user exit.
If EMPTY, NOTEMPTY, HIGHER(x), LOWER(y), EQUAL(v) or NOTEQUAL(w) is
specified, ICETOOL checks the record count as determined by its E35 user exit
against the specified criteria. If the criteria is met (for example, HIGHER(20) is
specified and the record count is 21 or more), ICETOOL sets the following return
code for the COUNT operator:
v RC=12 if RC12 is specified, or by default if RC8 and RC4 are not specified
v RC=8 if RC8 is specified
v RC=4 if RC4 is specified
If the criteria is not met (for example, HIGHER(20) is specified and the record
count is 20 or less), ICETOOL sets RC=0 for the COUNT operator. ICETOOL uses
DFSORT's STOPAFT option to process the minimum number of records required to
determine whether or not the criteria is met.
Note: Be sure to check the messages in TOOLMSG when you initially set up any
COUNT operators with criteria to make sure that RC=12 is not issued because of
syntax errors.
If SUB(q) is specified, ICETOOL subtracts q from the count, but does not reduce
the count below 0. If ADD(r) is specified, ICETOOL adds r to the count. SUB(q)
and ADD(r) are especially useful for dealing with data sets that contain header and
trailer records.
If WRITE(countdd) is specified, ICETOOL writes a record containing the count in
the countdd data set. TEXT('string') can be used to insert a string before the count
in the output record. DIGITS(n) or EDCOUNT(formatting) can be used to change
the appearance of the count in the output record. WIDTH(n) can be used to change
the length of the output record.
You must not supply your own DFSORT MODS statement because it would
override the MODS statement passed by ICETOOL for this operator.
Note: The record count is also printed for the DISPLAY, OCCUR, RANGE,
SELECT, STATS, UNIQUE, and VERIFY operators.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
580
COUNT Operator
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it:
1. Must conform to the rules for DFSORT's SORTCNTL data set.
2. Should generally be used only for an INCLUDE or OMIT statement or
comments statements.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(name)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(CURRENT)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(NONE)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
RC4
Can be used to set RC=4 for this COUNT operator if the record count meets
the specified criteria. RC4 can be specified only if EMPTY, NOTEMPTY,
HIGHER(x), LOWER(y), EQUAL(v), or NOTEQUAL(w) is specified. RC4
overrides the default of setting RC=12 for this COUNT operator if the record
count meets the specified criteria
RC8
Can be used to set RC=8 for this COUNT operator if the record count meets
the specified criteria. RC8 can be specified only if EMPTY, NOTEMPTY,
HIGHER(x), LOWER(y), EQUAL(v), or NOTEQUAL(w) is specified. RC8
overrides the default of setting RC=12 for this COUNT operator if the record
count meets the specified criteria.
RC12
Can be used to set RC=12 for this COUNT operator if the record count meets
the specified criteria. RC12 can be specified only if EMPTY, NOTEMPTY,
HIGHER(x), LOWER(y), EQUAL(v), or NOTEQUAL(w) is specified. RC12 is
equivalent to the default used when RC4 or RC8 is not specified.
EMPTY
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the input data set or subset is empty, or sets RC=0 for this
COUNT operator if the input data set or subset is not empty.
EMPTY is equivalent to EQUAL(0).
NOTEMPTY
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the input data set or subset is not empty, or sets RC=0 for
this COUNT operator if the input data set or subset is empty.
Chapter 7. Using ICETOOL
581
COUNT Operator
EMPTY is equivalent to NOTEQUAL(0).
HIGHER(x)
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the record count is higher than x, or sets RC=0 for this
COUNT operator if the record count is equal to or lower than x.
x must be specified as n or +n where n can be 0 to 562949953421310.
LOWER(y)
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the record count is lower than y, or sets RC=0 for this
COUNT operator if the record count is equal to or higher than y.
y must be specified as n or +n where n can be 0 to 562949953421310.
EQUAL(v)
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the record count is equal to v, or sets RC=0 for this
COUNT operator if the record count is not equal to v.
v must be specified as n or +n where n can be 0 to 562949953421310.
NOTEQUAL(w)
Sets RC=12 (or RC=8 if RC8 is specified, or RC=4 if RC4 is specified) for this
COUNT operator if the record count is not equal to w, or sets RC=0 for this
COUNT operator if the record count is equal to w.
w must be specified as n or +n where n can be 0 to 562949953421310.
SUB(q)
Subtracts q from the record count, but does not reduce the count below 0. The
resulting modified record count is displayed in the count message in
TOOLMSG. If WRITE(countdd) is specified, the modified record count is used
in the count record. If EMPTY, NOTEMPTY, HIGHER(x), LOWER(y),
EQUAL(v) or NOTEQUAL(w) is specified, the modified record count is used
to determine if the criteria is satisfied.
SUB(q) is especially useful for getting the count of just the data records for a
data set that contains header, data and trailer records.
q must be specified as n or +n where n can be 1 to 999.
ADD(r)
Adds r to the record count. The resulting modified record count is displayed in
the count message in TOOLMSG. If WRITE(countdd) is specified, the modified
record count is used in the count record. If EMPTY, NOTEMPTY, HIGHER(x),
LOWER(y), EQUAL(v) or NOTEQUAL(w) is specified, the modified record
count is used to determine if the criteria is satisfied.
ADD(r) is especially useful for getting the count of header, data and trailer
records for a data set that just contains data records to which you want to add
header and trailer records.
r must be specified as n or +n where n can be 1 to 999.
WRITE(countdd)
Specifies the ddname of the count data set to be produced by ICETOOL for
this operation. A countdd DD statement must be present. ICETOOL sets the
attributes of the count data set as follows:
v RECFM is set to FB.
v LRECL is set to one of the following:
582
COUNT Operator
If WIDTH(n) is specified, LRECL is set to n. Use WIDTH(n) if your count
record length and LRECL must be set to a particular value (for example,
80), or if you want to ensure that the count record length does not exceed
a specific maximum (for example, 20 bytes).
If WIDTH(n) is not specified, LRECL is set to the calculated required
record length. If your LRECL does not need to be set to a particular
value, you can let ICETOOL determine and set the appropriate LRECL
value by not specifying WIDTH(n).
v BLKSIZE is set to one of the following:
The BLKSIZE from the DD statement, DSCB, or label, if it is a multiple of
the LRECL used.
The LRECL if the BLKSIZE from the DD statement, DSCB, or label is not
a multiple of the LRECL used.
The system determined blocksize if the BLKSIZE is not available from the
DD statement, DSCB, or label.
TEXT('string')
Specifies a string to be printed starting in the first byte of the count record. The
count follows the string. TEXT can only be specified if WRITE(countdd) is
specified.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes ('').
To suppress printing of a string, do not specify TEXT('string') or specify
TEXT('') using two single apostrophes.
DIGITS(d)
Specifies d digits for the count in the output record, overriding the default of
15 digits. d can be 1 to 15. The count is written as d decimal digits with
leading zeros. DIGITS can only be specified if WRITE(countdd) is specified.
If you know that your count requires less than 15 digits, you can use a lower
number of digits (d) instead by specifying DIGITS(d). For example, if
DIGITS(10) is specified, 10 digits are used instead of 15.
If you use DIGITS(d) and the count overflows the number of digits used,
ICETOOL terminates the operation. You can prevent the overflow by specifying
an appropriately higher d value for DIGITS(d). For example, if DIGITS(5)
results in overflow, you can use DIGITS(6) instead.
EDCOUNT(formatting)
Specifies formatting items that indicate how the count in the output record is
to be formatted, overriding the default of 15 digits with leading zeros.
Formatting items can be specified in any order, but each item can only be
specified once. EDCOUNT can only be specified if WRITE(countdd) is
specified.
mask
See the discussion of mask under ON(p,m,f,formatting) in "DISPLAY
Operator" on page mask on page 601.
E'pattern'
specifies an edit pattern to be applied to the count. The pattern (1 to 24
characters) must be enclosed in single apostrophes. Each 9 in the pattern
(up to 15) is replaced by a corresponding digit from the count. Characters
other than 9 in the pattern appear as specified. To include a single
apostrophe (') in the pattern, specify two single apostrophes (''). F'string' or
a mask cannot be specified with E'pattern'.
Chapter 7. Using ICETOOL
583
COUNT Operator
When E'pattern' is specified for the count:
v If the number of significant digits in the count is less than the number of
9's in the pattern, 0's are filled in on the left. For example, 1234 is shown
as 001234 with EDCOUNT(E'999999').
v If the number of significant digits in the count is greater than the
number of 9's in the pattern, digits are truncated from the left. For
example, 1234567 is shown as *4567* with EDCOUNT(E'*9999*').
L'string
See the discussion of L'string' under ON(p,m,f,formatting) in "DISPLAY
Operator" on page L'string' on page 603
F'string'
See the discussion of F'string' under ON(p,m,f,formatting) in "DISPLAY
Operator" on page F'string' on page 603
T'string'
See the discussion of T'string' under ON(p,m,f,formatting) in "DISPLAY
Operator" on page T'string' on page 604
LZ See the discussion of LZ under ON(p,m,f,formatting) in "DISPLAY
Operator" on page LZ on page 604
Udd
specifies the number of digits to be used for the count. dd specifies the
number of digits and must be a two-digit number between 01 and 15. The
default number of digits (d) for the count is 15.
If you know that your count requires less than 15 digits, you can use a
lower number of digits (dd) instead by specifying Udd. For example, if
EDCOUNT(U09) is specified, 9 digits (from U09) is used instead of 15
(default for the count).
If you use Udd and the count overflows the number of digits used,
ICETOOL terminates the operation. You can prevent the overflow by
specifying an appropriately higher dd value for Udd. For example, if
EDCOUNT(U05) results in overflow, you can use EDCOUNT(U06) instead.
If E'pattern' is specified, Udd is ignored, because d is determined from the
pattern.
WIDTH(n)
Specifies the record length and LRECL you want ICETOOL to use for the count
data set. n can be from 1 to 32760. WIDTH can only be specified if
WRITE(countdd) is specified. ICETOOL always calculates the record length
required to write the count record and uses it as follows:
v If WIDTH(n) is specified and the calculated record length is less than or
equal to n, ICETOOL sets the record length and LRECL to n. ICETOOL pads
the count record on the right with blanks to the record length.
v If WIDTH(n) is specified and the calculated record length is greater than n,
ICETOOL issues an error message and terminates the operation.
v If WIDTH(n) is not specified, ICETOOL sets the record length and LRECL to
the calculated record length.
Use WIDTH(n) if your count record length and LRECL must be set to a
particular value (for example, 80), or if you want to ensure that the count
record length does not exceed a specific maximum (for example, 20 bytes).
Otherwise, you can let ICETOOL calculate and set the appropriate record
length and LRECL by not specifying WIDTH(n).
584
COUNT Operator
COUNT examples
Example 1
For this example, assume that the CTL1CNTL data set contains a DFSORT
INCLUDE statement.
COUNT FROM(IN1)
COUNT FROM(IN2) USING(CTL1)
The first COUNT operator prints a message containing the count of records in the
IN1 data set.
The second COUNT operator prints a message containing the count of records
included from the IN2 data set.
Example 2
COUNT FROM(INPUT1) EMPTY
Sets RC=12 if INPUT1 is empty (that is, INPUT1 has no records), or sets RC=0 if
INPUT1 is not empty (that is, INPUT1 has at least one record).
Example 3
For this example, assume that the CTL2CNTL data set contains a DFSORT
INCLUDE statement.
COUNT FROM(INPUT2) HIGHER(50000) RC4 USING(CTL2)
Sets RC=4 if more than 50000 records are included from INPUT2, or sets RC=0 if
50000 or less records are included from INPUT2.
Example 4
COUNT FROM(IN2) WRITE(CT2) TEXT(Count is ) EDCOUNT(A1,U10) WIDTH(80)
Prints a message containing the count of records in the IN2 data set. Writes an
80-byte record with the specified string and an edited count to the CT2 data set. If
IN2 contains 3286721 records, the 80-byte output record in CT2 would look like
this:
Count is
3,286,721
Example 5
COUNT FROM(IN3) WRITE(CT3) DIGITS(6) SUB(2)
Subtracts 2 from the count of records in the IN3 data set. Prints a message
containing the modified count. Writes a 6-byte record with the modified count to
the CT3 data set. If IN3 contains 8125 records, the 6-byte output record in CT3
would look like this:
008123
DATASORT operator
DATASORT FROM(indd) TO(outdd) USING(xxxx)
HEADER
FIRST
HEADER(u)
FIRST(u)
585
DATASORT Operator
TRAILER
LAST
TRAILER(v)
LAST(v)
VSAMTYPE(x)
Copies one or more header records and one or more trailer records to the output
data set in their original input record order, while sorting the data records between
the header and trailer records, using the DFSORT control statements in xxxxCNTL.
By definition, the header records are the first n records in the input data set, the
trailer records are the last n records in the input data set, and the data records
(also called detail records) are the records between the header and trailer records.
Thus, the first n records (header records) and last n records (trailer records) are
kept in place and the data records between them are sorted.
You must specify one header operand (HEADER, FIRST, HEADER(u) or FIRST(u)),
one trailer operand (TRAILER, LAST, TRAILER(v) or LAST(v)), or one header
operand and one trailer operand. If you specify a header operand without a trailer
operand, only the header records will be kept in place. If you specify a trailer
operand without a header operand, only the trailer records will be kept in place. If
you specify a header operand and a trailer operand, both the header records and
trailer records will be kept in place.
DFSORT is called to copy the header and trailer records and to sort the data
records. DFSORT uses its E15 and E35 exits to process the records as needed.
ICETOOL passes the EQUALS option to DFSORT to ensure that duplicates are
kept in their original input order.
You must supply a DFSORT SORT statement in the xxxxCNTL data set to indicate
the control fields for sorting the data records.
You can use additional DFSORT control statements in xxxxCNTL providing you
observe these rules:
v A SORT statement must be present
v MODS and OUTREC statements should not be present.
v A STOPAFT operand should not be present.
v Comment statements can be present.
v Header and trailer records will only be affected by the SKIPREC option and
OUTFIL statements. SKIPREC=n will remove the first n indd records, so the first
header record will be the n+1 indd record. OUTFIL statements will process the
header and trailer records in the normal way.
v Data records will be processed by INCLUDE, OMIT, INREC, SUM, OPTION and
OUTFIL statements in the normal way.
v If you use INREC to change the length of the data records, DFSORT will
preserve the header and trailer records by setting the TO data set LRECL to the
maximum of the input or reformatted record length. For fixed-length records,
DFSORT will pad the header and trailer records, or data records, on the right
with blanks as appropriate.
v You can further process the outdd records after DATASORT processing using an
OUTFIL statement like this:
OUTFIL FNAMES=outdd,...
586
DATASORT Operator
OUTFIL FNAMES=outdd,...
OUTFIL FNAMES=outdd1,...
For example, with TO(OUT1) you could further modify the OUT1 records after
DATASORT processing, with a statement like this:
OUTFIL FNAMES=OUT1,REMOVECC,
TRAILER1=(Record count ,COUNT=(M11,LENGTH=5))
ICETOOL requires extra storage for DATASORT processing, over and above what
is normally needed by ICETOOL and DFSORT, in order to save your header and
trailer records. The amount of storage needed depends on the number of header
and trailer records you specify, and the LRECL of the FROM data set. In most
cases, the needed storage can be obtained (above 16MB virtual). However, if
ICETOOL cannot get the storage it needs, it issues a message and terminates the
DATASORT operation. Increasing the REGION by the amount indicated in the
message may allow ICETOOL to run successfully.
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for a DATASORT operator, you can take one of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(,8)
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in "COPY Operator"
on page FROM(indd) on page 575.
TO(outdd)
Specifies the ddname of the output data set to be written by DFSORT for this
operation.
An outdd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's SORTOUT data set.
The ddname specified in the TO operand must not be the same as the ddname
specified in the FROM operand.
Refer to JCL restrictions on page 573 for more information.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx
An xxxxCNTL DD statement must be present. The xxxxCNTL data set must
contain a SORT statement. Other control statements are optional, but if
specified must conform to the rules for DFSORT's SORTCNTL data set, and
should be used as described for DATASORT operator on page 585.
HEADER or FIRST
Specifies one header record (the first record in the indd data set) is to be kept
in place.
Chapter 7. Using ICETOOL
587
DATASORT Operator
HEADER and FIRST are equivalent to HEADER(1) and FIRST(1).
HEADER(u) or FIRST(u)
Specifies u header records (the first u records in the indd data set) are to be
kept in place.
u must be specified as n or +n where n can be 1 to 1000000.
TRAILER or LAST
Specifies one trailer record (the last record in the indd data set) is to be kept in
place.
TRAILER and LAST are equivalent to TRAILER(1) and LAST(1).
TRAILER(v) or LAST(v)
Specifies v trailer records (the last v records in the indd data set) are to be kept
in place.
v must be specified as n or +n where n can be 1 to 1000000.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in "COPY Operator"
on page VSAMTYPE(x) on page 576.
DATASORT examples
Although the DATASORT operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
Example 1
DATASORT FROM(INPUT) TO(OUTPUT) HEADER TRAILER USING(CTL1)
This example shows how you can sort the data records between a header record
(first record) and a trailer record (last record).
The CTL1CNTL data set contains:
SORT FIELDS=(16,13,CH,A)
We want to keep the MM records in place and sort the other records by the CH
field in positions 16-28. We use HEADER and TRAILER to indicate the first and
last records should not be sorted. We use the SORT statement to SORT ascending
on positions 16-28.
The output records would look like this:
MM9999900510100823DDDDD FFFFF 004200806128
AAR
FIRST C 1134341444441
XXXXXXXXX
ATX
FOURTH
2830012906356
XXXXXXXXX
ATX
THIRD L 6297132201111
XXXXXXXXX
ATX
SECOND
7777777770111
XXXXXXXXX
MM9999900510100823DDDDD FFFFF 004
Note that we could use FIRST and LAST instead of HEADER and TRAILER.
588
DATASORT Operator
Example 2
DATASORT FROM(IN) TO(OUT) HEADER(2) TRAILER(3) USING(CTL2)
This example illustrates how you can sort the data records between header records
(first records) and trailer records (last records), and modify just the data records or
the header, data and trailer records.
The CTL2CNTL data set contains:
INREC IFTHEN=(WHEN=(24,2,CH,EQ,C23),
OVERLAY=(30:COld))
SORT FIELDS=(1,14,CH,A)
OUTFIL FNAMES=OUT,
IFTHEN=(WHEN=(24,2,CH,EQ,C23),
OVERLAY=(35:CFirst))
2008/04/23
2008/04/23
2008/04/24
2008/04/23
2008/04/24
2008/04/25
2008/04/25
2008/04/23
2008/04/23
2008/04/23
2008/04/23
We want to keep the two Header records and the three Trailer records in place and
sort the other records by the CH field in positions 1-14. We want to put 'Old' in
positions 30-32 of each data record (but not the Header or Trailer records) that has
'23' in positions 24-25. We want to put 'First' in positions 35-39 of each record
(Header, data and Trailer) that has '23' in positions 24-25.
We use HEADER(2) and TRAILER(3) to indicate the first two records and last three
records should not be sorted. We use the INREC statement to add 'Old' to data
records that have '23' in positions 24-25. INREC applies to the data records, but not
to the Header and Trailer records. We use the SORT statement to sort ascending on
positions 1-14. We use the OUTFIL statement to add 'First' to Header, data and
Trailer records that have '23' in positions 24-25. OUTFIL applies to all of the
records.
The output records would look like this:
Header 1
Header 2
Algebra
Calculus
Geography
Geometry
History
Trigonometry
Trailer 1
Trailer 2
Trailer 3
2008/04/23
2008/04/23
2008/04/23
2008/04/25
2008/04/25
2008/04/24
2008/04/23
2008/04/24
2008/04/23
2008/04/23
2008/04/23
Old
First
First
First
Old
First
First
First
First
Note that we could use FIRST(2) and LAST(3) instead of HEADER(2) and
TRAILER(3).
589
DEFAULTS Operator
DEFAULTS operator
DEFAULTS LIST(listdd)
LISTSDB
LISTNOSDB
Prints the DFSORT installation defaults report in a separate list data set.
DFSORT enables you to maintain separate sets of installation defaults for eight
different installation environments as follows:
v JCL (ICEAM1) - batch JCL directly invoked installation environment
v INV (ICEAM2) - batch program invoked installation environment
v
v
v
v
v
v
Each installation default has two or more possible values; DFSORT is shipped with
a set of IBM-supplied defaults that can be modified using ICEPRMxx members of
PARMLIB or the ICEMAC macro. The DEFAULTS operator provides an easy way
to determine the installation default values to be used at run-time. See z/OS
DFSORT Installation and Customization for a complete discussion of ICEPRMxx
members in PARMLIB, the ICEMAC macro, the eight installation environments,
and the installation default values.
DEFAULTS produces a three-part report showing:
1. The merged PARMLIB/ICEMAC installation default values for ICEAM1-4 and
ICETD1-4 that will be used at run-time.
2. The specified PARMLIB ICEPRMxx member option values for ICEAM1-4 and
ICETD1-4 (for reference).
3. The ICEMAC installation default values for ICEAM1-4 and ICETD1-4 (for
reference).
The format of the report produced by DEFAULTS varies depending on the defaults
selected, but the first part of the report might look like this conceptually:
590
DEFAULTS Operator
- p -
value
value
value
value
* IBM_value
value
value
value
value
.
.
.
Z/OS DFSORT V2R1
- p -
value
* IBM_value
value
value
* IBM_value
value
value
value
value
value
The merged PARMLIB/ICEMAC default value for each item is shown as it is set
for each of the eight installation environments. For any value that is different from
the IBM-supplied value, the IBM-supplied value is shown below it.
The control character occupies the first byte of each record. The title and headings
are always printed; p is the page number. The item name column occupies 10
bytes, each of the item value columns occupies 20 bytes, and 5 blanks appear
between columns.
Operand descriptions
The operands described in this section can be specified in any order.
LIST(listdd)
Specifies the ddname of the list data set to be produced by ICETOOL for this
operation. A listdd DD statement must be present. ICETOOL uses
RECFM=FBA, LRECL=121 and the specified BLKSIZE for the list data set. If
the BLKSIZE you specify is not a multiple of 121, ICETOOL uses
BLKSIZE=121. If you do not specify the BLKSIZE, ICETOOL selects the block
size as directed by LISTSDB or LISTNOSDB, if specified, or otherwise as
directed by installation option SDBMSG from ICEAM2 or ICEAM4 (see z/OS
DFSORT Installation and Customization).
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
LISTSDB or LISTNOSDB
Can be used to override the SDBMSG value for this LIST data set. LISTSDB
directs ICETOOL to select the system-determined optimum block size for the
LIST data set in the same way as for installation option SDBMSG=YES.
LISTNOSDB directs ICETOOL to select the block size for the LIST data set in
the same way as for installation option SDBMSG=NO. See the discussion of the
591
DEFAULTS Operator
LIST(listdd) operand previously in this section for more information on how
LISTSDB or LISTNOSDB affects the LIST data set block size.
Attention: LISTSDB has no effect for SYSOUT data sets (for example, //RPT1
DD SYSOUT=*), because the system-determined optimum block size is not
used for spool or dummy data sets.
DEFAULTS example
DEFAULTS LIST(OPTIONS)
Prints, in the OPTIONS data set, the DFSORT installation defaults report. The
OPTIONS output starts on a new page and might look as follows. The first few
items are shown with illustrative values for ICEAM1-4 and ICETD1-4 for each of
the three parts of the report.
592
DEFAULTS Operator
- 1 -
ABCODE
MSG
MSG
ALTSEQ
ARESALL
ARESINV
CFW
CHALT
SEE BELOW
0
NOT APPLICABLE
YES
YES
* NO
YES
YES
99
* MSG
SEE BELOW
0
0
YES
YES
* NO
YES
YES
SEE BELOW
0
NOT APPLICABLE
YES
NO
99
* MSG
SEE BELOW
0
0
YES
NO
YES
YES
YES
YES
CHECK
CINV
.
.
.
- 4 -
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
NONE
99
* MSG
SEE BELOW
0
0
YES
YES
* NO
YES
YES
MSG
MSG
MSG
SEE BELOW
0
0
YES
NO
SEE BELOW
0
0
YES
NO
SEE BELOW
0
0
YES
NO
YES
YES
YES
YES
YES
YES
CHECK
CINV
.
.
.
Z/OS DFSORT V2R1
- 7 -
2.01
ICEPRML
BASE
05/14/11
1
VALUE
---------------------------------------40000
YES
MEMBER
-------ICEPRM03
ICEPRM03
VALUE
---------------------------------------40000
YES
MEMBER
-------ICEPRM03
ICEPRM03
VALUE
---------------------------------------YES
MEMBER
-------ICEPRM03
593
DEFAULTS Operator
The title and appropriate heading lines appear at the top of each page. The
specified and IBM-supplied ALTSEQ tables are printed separately after the other
items.
DISPLAY operator
DISPLAY FROM(indd)
ON(p,m,f)
ON(p,m,f,formatting)
ON(p,m,HEX)
ON(VLEN)
ON(VLEN,formatting)
ON(NUM)
ON(NUM,formatting)
LIST(listdd)
TITLE('string')
TITLE('string1','string2')
TITLE('string1','string2','string3')
TLEFT
TFIRST
PAGE
DATE
DATE(abcd)
DATENS(abc)
YDDD(abc)
YDDDNS(ab)
TIME
TIME(abc)
TIMENS(ab)
BLANK
PLUS
NOCC
HEADER('string1')
HEADER('string1','string2')
HEADER('string1','string2','string3')
HEADER(NONE)
NOHEADER
LINES(n)
INDENT(n)
BETWEEN(n)
TBETWEEN(n)
TOTAL('string')
MAXIMUM('string')
MINIMUM('string')
AVERAGE('string')
COUNT('string')
EDCOUNT(formatting)
LIMIT(n)
VSAMTYPE(x)
WIDTH(n)
BREAK(p,m,f)
BREAK(p,m,f,formatting)
594
LONGLINE
BTITLE('string')
BTOTAL('string')
DISPLAY Operator
BMAXIMUM('string')
BMINIMUM('string')
BAVERAGE('string')
BCOUNT('string')
EDBCOUNT(formatting)
STATLEFT
UZERO
LISTSDB
Prints the values or characters of specified numeric fields (including SMF, TOD,
and ETOD date and time) or character fields in a separate list data set. Simple,
tailored, and sectioned reports can be produced. From 1 to 50 fields can be
specified, but the resulting list data set line length must not exceed the limit
specified by the WIDTH operand or 8192 bytes if LONGLINE is specified and
WIDTH is not specified, or 2048 bytes if LONGLINE and WIDTH are not specified.
The record number can be printed as a special field.
DFSORT is called to copy the indd data set to ICETOOL's E35 user exit. ICETOOL
uses its E35 user exit to print appropriate titles, headings and data in the list data
set.
You must not supply your own DFSORT MODS, INREC, or OUTREC statement,
because they would override the DFSORT statements passed by ICETOOL for this
operator.
Specifying formatting items or the PLUS or BLANK operand, which can
compress the columns of output data, can enable you to include more fields in
your report, up to a maximum of 50, if your line length is limited by the
character width your printer or display supports.
Simple report
You can produce a simple report by specifying just the required operands. For
example, if you specify FROM and LIST operands, and ON operands for 10-byte
character and 7-byte zoned decimal fields, the output in the list data set can be
represented as follows:
(p,m,f)
characters
.
.
.
(p,m,f)
sddddddddddddddd
.
.
.
A control character occupies the first byte of each list data set record. Left-justified
standard headings are printed at the top of each page to indicate the contents of
each column, followed by a line for each record showing the characters and
numbers in the fields of that record.
The fields are printed in columns in the same order in which they are specified in
the DISPLAY statement. All fields are left-justified. For numeric fields, leading
zeros are printed, a - is used for the minus sign, and a + is used for the plus sign.
By default, the first column of data starts immediately after the control character,
and three blanks appear between columns. The NOCC operand can be used to
suppress the control character. The INDENT operand can be used to change the
595
DISPLAY Operator
number of blanks before the first column of data. The BETWEEN operand can be
used to change the number of blanks between columns.
The standard column widths are as follows:
v Character data: the length of the character field, or 20 bytes if the field length is
less than 21 bytes
v Numeric data: 16 bytes, or 32 bytes if the numeric field is BI or FI with a length
greater than 4, PD with a length greater than 8, ZD, CSF, FS, UFF or SFF with a
length greater than 15, or FL.
v Record number: 15 bytes
HEADER operands can be used to change or suppress the headings. Formatting
items or the PLUS or BLANK operand can be used to change the appearance of
numeric fields in the report. PLUS, BLANK, and HEADER operands can be used
to change the width of the columns for numeric and character fields and the
justification of headings and fields.
The NOHEADER operand can be used to create list data sets containing only data
records. Data sets created in this way can be processed further by other operators
(for example, STATS or UNIQUE) using CH format for character values or FS
format for numeric values.
The TOTAL, MAXIMUM, MINIMUM, and AVERAGE operands can be used to
print statistics for numeric fields after the columns of data. Formatting items can
be used to suppress the statistics for selected numeric fields. The COUNT operand
can be used to print the record count after the columns of data.
Tailored report
You can tailor the output in the list data set using various operands that control
title strings, date, time, page number, headings, lines per page, field formats, total,
maximum, minimum, and average values for the columns of numeric data, and the
record count. The optional operands can be used in many different combinations to
produce a wide variety of report formats. For example, if you specify FROM, LIST,
BLANK, TITLE, PAGE, DATE, TIME, HEADER and AVERAGE operands, and ON
operands for 10-byte character and 7-byte zoned decimal fields, the output in the
list data set can be represented as follows:
title
- p -
header
---------characters
.
.
.
header
-------sd
.
.
.
average
mm/dd/yy
hh:mm:ss
sd
By default, a control character occupies the first byte of each list data set record.
The NOCC operand can be used to suppress the control characters. The title lines
(up to 3) are printed at the top of each page of the list data set. The first title line
contains the elements you specify (title strings, page number, date and time) in the
order in which you specify them. The second and third title lines contain the title
strings you specify. By default, eight blanks appear between title elements, the title
strings are centered with respect to each other, and the title lines appear on every
page. The TBETWEEN(n) operand can be used to change the number of blanks
596
DISPLAY Operator
between title elements. The TLEFT operand can be used to left-justify the title
strings with respect to each other. The TFIRST operand can be used to only print
the title lines on the first page. A blank line is printed after each title line.
Your specified headings (underlined) are printed after the title line on each page to
indicate the contents of each column, followed by a line for each record showing
the characters and numbers in the fields of that record. Your specified headings
can be one, two or three lines. Headings for character fields are left-justified and
headings for numeric fields are right-justified.
Your specified statistical lines (total, maximum, minimum, average, and count, and
their associated strings) are printed for selected numeric fields and the record
count, after the columns of data. The associated strings can be printed in the first
column or to the left of it.
The fields are printed in columns in the same order in which they are specified in
the DISPLAY statement. Character fields are left-justified and numeric fields are
right-justified. For numeric fields, leading zeros are suppressed, a - is used for the
minus sign, and a blank is used for the plus sign (you can specify PLUS rather
than BLANK if you want a + to be used for the plus sign).
Formatting items can be used to change the appearance of individual numeric
fields in the report with respect to separators, number of digits, decimal point,
decimal places, signs, leading zeros, division by 10, 100, 1000, 10000, 100000,
1000000, 1000000000, 1024, 1048576 (1024*1024), or 1073741824 (1024*1024*1024),
leading strings, floating strings, and trailing strings. Formatting items can also be
used to insert leading or trailing strings for character fields.
The column widths are dynamically adjusted according to the length of the
headings and the maximum number of bytes needed for the character or numeric
data.
Sectioned report
You can produce a sectioned report (simple or tailored) by including a BREAK
operand to indicate the break field used to divide the report into sections. Each set
of sequential input records (which you have previously sorted on the break field
and other fields, as appropriate), with the same value for the specified break field,
results in a corresponding set of data lines that is treated as a section in the report.
The break field is printed at the beginning of each section. Formatting items can be
used to change the appearance of numeric break fields, and to insert a string
before or after character or numeric break fields.
Optional break operands can be used to modify the break title for each section (the
break value is always printed as part of the break title) and to print statistics for
selected numeric fields and the count, in each section. For example, if you add
BTITLE, BREAK, BCOUNT, BMAXIMUM, and BMINIMUM to the operands for
the tailored report discussed previously, each section of the output in the list data
set starts on a new page and can be represented as follows:
597
DISPLAY Operator
title
btitle
- p -
mm/dd/yy
hh:mm:ss
bvalue
header
---------characters
.
.
.
bcount
header
-------sd
.
.
.
d
bmaximum
sd
bminimum
sd
The final page showing the overall statistics starts on a new page and can be
represented as follows:
title
- p -
header
----------
header
--------
average
mm/dd/yy
hh:mm:ss
sd
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
Specifies the ddname of the input data set to be read by DFSORT for this
operation. An indd DD statement must be present and must define an input
data set that conforms to the rules for DFSORT's SORTIN data set. In addition,
the LRECL of the data set must be at least 4.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used for this operation. '(p,m,f)' is used for the standard column heading (see
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), HEADER(NONE) and NOHEADER for
alternative heading options).
By default, three blanks appear between columns. You can change the space
between columns with BETWEEN(n).
p specifies the first byte of the field relative to the beginning of the input record. p
is 1 for the first data byte of a fixed-length record and 5 for the first data byte of a
variable-length record as illustrated in the following (RRRR represents the 4-byte
record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3 4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as shown in the following.
598
DISPLAY Operator
Format Code
Length
Description
BI
1 to 8 bytes
Unsigned binary
FI
1 to 8 bytes
Signed fixed-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
FL
4 or 8 bytes
Signed hexadecimal
floating-point converted to
signed integer
CH
1 to 4000 bytes
Character
CSF or FS
UFF
SFF
DT1
4 bytes
DT2
4 bytes
DT3
4 bytes
DC1
8 bytes
DC2
8 bytes
DC3
8 bytes
DE1
8 bytes
DE2
8 bytes
DE3
8 bytes
TM1
4 bytes
TM2
4 bytes
TM3
4 bytes
TM4
4 bytes
TC1
8 bytes
TC2
8 bytes
TC3
8 bytes
TC4
8 bytes
TE1
8 bytes
599
DISPLAY Operator
Format Code
Length
Description
TE2
8 bytes
TE3
8 bytes
TE4
8 bytes
600
DISPLAY Operator
ON(p,m,f,formatting)
Specifies the position, length, and format of a numeric or character field to be
used for this operation and how the data for this field is to be formatted for
printing. The BLANK operand is automatically in effect.
See ON(p,m,f) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
NOST
Ndd
Udd
/x
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once. Any formatting item can be specified for a
numeric field, but only L'string' and T'string' can be specified for a character
field.
The column width is dynamically adjusted to accommodate the maximum
bytes to be inserted as a result of all formatting items specified.
mask
specifies an edit mask to be applied to the numeric data for this field.
Thirty-nine pre-defined edit masks are available, encompassing many of the
numeric notations throughout the world with respect to separators, decimal
point, decimal places, signs, and so forth. ICETOOL edits the data according to
the selected mask. If other formatting items are specified but mask is not, the
default mask of A0 is applied to the data.
E'pattern' cannot be specified with a mask.
The attributes of each group of masks is shown in Table 84.
Table 84. Attributes of Edit Masks
Separators
Decimal Places
Positive Sign
Negative Sign
A0
No
blank
A1-A5
Yes
blank
B1-B6
Yes
blank
C1-C6
Yes
blank
D1-D6
Yes
blank
E1-E4
Yes
blank
()
F1-F5
Yes
blank
()
G1-G6
Yes
blank
Table 85 on page 602 describes the available masks and shows how the values
12345678 and -1234567 would be printed for each mask. In the pattern:
Chapter 7. Using ICETOOL
601
DISPLAY Operator
v d is used to represent a decimal digit (0-9)
v w is used to represent a leading sign that will be blank for a positive value
or - for a negative value
v x is used to represent a trailing sign that will be blank for a positive value or
- for a negative value
v y is used to represent a leading sign that will be blank for a positive value
or ( for a negative value
v z is used to represent a trailing sign that will be blank for a positive value or
) for a negative value
Table 85. Edit Mask Patterns
Pattern
12345678
-1234567
A0
wddddddddddddddddddddddddddddddd
12345678
-1234567
A1
wd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd
12,345,678
-1,234,567
A2
wd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd
12.345.678
-1.234.567
A3
wd ddd ddd ddd ddd ddd ddd ddd ddd ddd ddd
12 345 678
-1 234 567
A4
wd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd
12'345'678
-1'234'567
A5
d ddd ddd ddd ddd ddd ddd ddd ddd ddd dddx
B1
wddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd.d
1,234,567.8
-123,456.7
B2
wddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd,d
1.234.567,8
-123.456,7
B3
wddd ddd ddd ddd ddd ddd ddd ddd ddd ddd,d
1 234 567,8
-123 456,7
B4
wddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd.d
1'234'567.8
-123'456.7
B5
wddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd,d
1'234'567,8
-123'456,7
B6
ddd ddd ddd ddd ddd ddd ddd ddd ddd ddd,dx
C1
wdd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd.dd
123,456.78
-12,345.67
C2
wdd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd,dd
123.456,78
-12.345,67
C3
wdd ddd ddd ddd ddd ddd ddd ddd ddd ddd,dd
123 456,78
-12 345,67
C4
wdd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd.dd
123'456.78
-12'345.67
C5
wdd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd,dd
123'456,78
-12'345,67
C6
D1
wd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd.ddd
12,345.678
-1,234.567
D2
wd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd,ddd
12.345,678
-1.234,567
D3
12 345,678
-1 234,567
D4
wd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd.ddd
12'345.678
-1'234.567
D5
wd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd,ddd
12'345,678
-1'234,567
D6
12 345,678
1 234,567-
E1
yd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,dddz
12,345,678
(1,234,567)
E2
yd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.dddz
12.345.678
(1.234.567)
E3
yd ddd ddd ddd ddd ddd ddd ddd ddd ddd dddz
12 345 678
(1 234 567)
E4
yd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'dddz
12'345'678
(1'234'567)
F1
ydd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd.ddz
123,456.78
(12,345.67)
F2
ydd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd,ddz
123.456,78
(12.345,67)
F3
ydd ddd ddd ddd ddd ddd ddd ddd ddd ddd,ddz
123 456,78
(12 345,67)
F4
ydd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd.ddz
123'456.78
(12'345.67)
602
12 345 678
1 234 567,8
123 456,78
1 234 567-
123 456,7-
12 345,67-
DISPLAY Operator
Table 85. Edit Mask Patterns (continued)
Pattern
12345678
123'456,78
-1234567
F5
ydd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd,ddz
G1
wddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd,ddd.dddd
1,234.5678
-123.4567
G2
wddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd.ddd,dddd
1.234,5678
-123,4567
G3
1 234,5678
-123,4567
G4
wddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd.dddd
1'234.5678
-123.4567
G5
wddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd'ddd,dddd
1'234,5678
-123,4567
G6
1 234,5678
(12'345,67)
123,4567-
603
DISPLAY Operator
The string (1 to 10 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes ('').
E'pattern' cannot be specified with F'string'.
T'string'
specifies a trailing string to appear at the end of the character or numeric data
column for this field. For example, 'DFSORT ' is shown as '**DFSORT ***' with
ON(1,8,CH,L'**',T'***').
The string (1 to 10 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes ('').
LZ specifies that leading zeros are to be printed when the specified edit mask is
applied to the numeric data for this field, overriding the default of suppressing
leading zeros. For example, +123 is shown as 123 with ON(21,6,FS,A0), but as
000123 with ON(21,6,FS,A0,LZ).
LZ is useful for formatting numeric data, such as account numbers, for which
leading zeros must be printed.
Leading zeros are always printed for E'pattern' regardless of whether or not LZ
is specified.
NOST
specifies that requested statistics (TOTAL, MAXIMUM, MINIMUM, AVERAGE,
BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE) are not to be printed for
this numeric field.
Ndd or Udd
specifies the number of digits to be used for the numeric field. Ndd or Udd
can be used to change the column width for numeric fields, and to prevent
overflow for totals. dd specifies the number of digits and must be a two-digit
number between 01 and 31.
The default number of digits (d) for a numeric field is the maximum number
of digits for that field. For example, d is 5 for ON(1,5,ZD). If you know that
your numeric field requires less than d digits, you can use a lower number of
digits (dd) instead by specifying Udd, thus reducing the column width if it is
determined by d. For example, ON(1,5,ZD,U03) reduces d from 5 to 3. If you
want your numeric field to be displayed with more than d digits, you can use
a higher number of digits (dd) instead by specifying Ndd or Udd, thus
increasing the column width if it is determined by d. For example,
ON(1,5,ZD,U10) increases d from 5 to 10.
The default number of digits (d) for a total is 15 if the numeric field is BI or FI
with a length up to 4, PD with a length up to 8, or ZD, CSF, FS, UFF or SFF
with a length up to 15. The default number of digits (d) for a total is 31 if the
numeric field is BI or FI with a length greater than 4, PD with a length greater
than 8, or ZD, CSF, FS, UFF or SFF with a length greater than 15.
If you know that your total requires less than d digits, you can use a lower
number of digits (dd) instead by specifying Ndd or Udd for the ON field, thus
reducing the column width if it is determined by d. For example,
ON(1,18,ZD,U18) with TOTAL reduces d from 31 to 18. If you know that your
total can overflow d digits, you can use a higher number of digits (dd) instead
by specifying Ndd or Udd, thus preventing overflow and increasing the
column width if it is determined by d. For example, ON(1,15,ZD,U17) with
TOTAL increases d from 15 to 17.
604
DISPLAY Operator
Either Ndd or Udd can be used to set d greater than the maximum for a
numeric field, but only Udd can be used to set d less than the maximum for a
numeric field.
For Udd:
dd is used for d. For example:
If
v
v
v
605
DISPLAY Operator
If E'pattern' is specified, Ndd is ignored, because d is determined from the
pattern.
/x specifies division of the numeric data for this field before formatting. x
indicates the division factor to be used as described later in this section. The
resulting values are rounded down to the nearest integer. Statistics (TOTAL,
MAXIMUM, MINIMUM, AVERAGE, BTOTAL, BMAXIMUM, BMINIMUM,
BAVERAGE) and column widths reflect the divided numbers.
/D
/C
/K
/DK
/CK
/M
/G
/KB
/MB
/GB
ON(p,m,HEX)
Specifies the position and length of a character field to be used for this
operation and printed in hexadecimal format (00-FF for each byte). '(p,m,HEX)'
is used for the standard column heading. See HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3'),
HEADER(NONE), and NOHEADER for alternative heading options.
See ON(p,m,f) for a discussion of p.
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. A field can be 1 to 2000 bytes.
ON(VLEN)
Equivalent to specifying ON(1,2,BI); a two-byte binary field starting at position
1. For variable-length records, ON(VLEN) represents the record-length for each
record. ' RECORD LENGTH' is used for the standard column heading. See
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), HEADER(NONE), and NOHEADER for
alternative heading options.
ON(VLEN,formatting)
Equivalent to specifying ON(1,2,BI,formatting); a two-byte binary field starting
606
DISPLAY Operator
at position 1, and how the data for this field is to be formatted for printing.
The BLANK operand is automatically in effect.
See ON(VLEN) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
NOST
Ndd
Udd
/x
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once.
The column width is dynamically adjusted to accommodate the maximum
bytes to be inserted as a result of all formatting items specified.
See ON(p,m,f,formatting) for a discussion of formatting.
ON(NUM)
Specifies that the record number is to be printed. The record number starts at 1
and is incremented by 1 for each record printed in the list data set. 'RECORD
NUMBER' is used for the standard column heading. See HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3'),
HEADER(NONE), and NOHEADER for alternative heading options.
ON(NUM,formatting)
Specifies that the record number is to be printed, and how the record number
is to be formatted for printing. The BLANK operand is automatically in effect.
See ON(NUM) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
Udd
607
DISPLAY Operator
mask
See ON(p,m,f,formatting) for a discussion of mask.
E'pattern'
specifies an edit pattern to be applied to the record number. The pattern (1
to 24 characters) must be enclosed in single apostrophes. Each 9 in the
pattern (up to 15) is replaced by a corresponding digit from the numeric
value. Characters other than 9 in the pattern appear as specified. To
include a single apostrophe (') in the pattern, specify two single
apostrophes ('').
F'string' or a mask cannot be specified with E'pattern'.
When E'pattern' is specified for the record number:
v If the number of significant digits in a record number is less than the
number of 9's in the pattern, 0's are filled in on the left. For example,
1234 is shown as 001234 with ON(NUM,E'999999').
v If the number of significant digits in a record number is greater than the
number of 9's in the pattern, digits are truncated from the left. For
example, 1234567 is shown as *4567* with ON(NUM,E'*9999*').
L'string'
See ON(p,m,f,formatting) for a discussion of L'string'.
F'string'
See ON(p,m,f,formatting) for a discussion of F'string'.
T'string'
See ON(p,m,f,formatting) for a discussion of T'string'.
LZ See ON(p,m,f,formatting) for a discussion of LZ.
Ndd or Udd
Specifies the number of digits to be used for the record number when
determining the column width. dd specifies the number of digits and must
be a two-digit number between 01 and 15.
The default number of digits (d) for the record number is 15. If you know
that your record numbers require less than 15 digits, you can use a lower
number of digits (dd) instead by specifying Ndd or Udd thus reducing the
column width if it is determined by d. For example, if ON(NUM,N09) or
ON(NUM,U09) is specified, 9 digits (from N09 or U09) is used instead of
15 (default for record number).
If you use Ndd or Udd and the number of records overflows the number
of digits used, ICETOOL terminates the operation. You can prevent the
overflow by specifying an ppropriately higher dd value for Ndd or Udd.
For example, if ON(NUM,N05) results in overflow, you can use
ON(NUM,N06) instead.
If E'pattern' is specified, Ndd or Udd is ignored, because d is determined
from the pattern.
LIST(listdd)
Specifies the ddname of the list data set to be produced by ICETOOL for
this operation. A listdd DD statement must be present. ICETOOL sets the
attributes of the list data set as follows:
v If NOCC is not specified, RECFM is set to FBA. If NOCC is specified,
RECFM is set to FB.
v LRECL is set to one of the following:
608
DISPLAY Operator
If WIDTH(n) is specified, LRECL is set to n. Use WIDTH(n) if your
LRECL must be set to a particular value (for example, if you use
DISP=MOD to place several reports in the same data set).
If WIDTH(n) is not specified and NOCC is not specified, LRECL is set
to 121 or to the calculated required line length if it is greater than 121
characters.
If WIDTH(n) is not specified and NOCC is specified, LRECL is set to
120 or to the calculated required line length if it is greater than 120
characters.
If your LRECL does not need to be set to a particular value, you can let
ICETOOL determine and set the appropriate LRECL value by not
specifying WIDTH(n).
v BLKSIZE is set to one of the following:
The BLKSIZE from the DD statement, DSCB, or label, if it is a
multiple of the LRECL used.
The LRECL if the BLKSIZE from the DD statement, DSCB, or label is
not a multiple of the LRECL used.
The block size as directed by LISTSDB or LISTNOSDB if specified, or
otherwise as directed by the SDBMSG installation option from
ICEAM2 or ICEAM4 (see z/OS DFSORT Installation and Customization),
if the BLKSIZE is not available from the DD statement, DSCB, or
label.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
TITLE('string')
Specifies printing of a title string in a title line. The title string is of the
form:
string
609
DISPLAY Operator
By default, the title strings in the title lines are centered with respect to
each other. TLEFT can be used to left-justify the title string in the title lines
with respect to each other.
By default, the title lines are printed on every page. TFIRST can be used to
only print the title lines on the first page.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). Blanks at the start of the string move the text to the right. Blanks at the
end of the string increase the spacing between the string and the next title
element.
TITLE('string1','string2')
Specifies printing of a two part title string in a title line. The title string is
of the form:
string1string2
610
DISPLAY Operator
report (overriding the default of having the title lines appear on every
page of the report). See TITLE('string') for additional informaton on title
lines.
PAGE
Specifies printing of the page number in the first title line. The page
number is printed in the form - p - where p is in decimal with no leading
zeros. The page number is 1 for the first page and is incremented by 1 for
each subsequent page. See TITLE('string') for additional information on the
first title line.
DATE
Specifies printing of the date in the first title line. The date is printed in the
form mm/dd/yy where mm is the month, dd is the day, and yy is the
year. DATE is equivalent to specifying DATE(MDY/). See TITLE('string')
for additional information on the first title line.
DATE(abcd)
Specifies printing of the date in the first title line. The date is printed in the
form 'adbdc' according to the specified values for abc and d. For example,
on March 29, 2002, DATE(4MD-) would produce '2002-03-29' and
DATE(MDY.) would produce '03.29.02'. See TITLE('string') for additional
information on the first title line.
abc can be any combination of M, D, and Y or 4 (each specified once)
where M represents the month (01-12), D represents the day (01-31), Y
represents the last two digits of the year (for example, 02), and 4 represents
the four digits of the year (for example, 2002).
d can be any character and is used to separate the month, day, and year.
DATENS(abc)
Specifies printing of the date in the first title line. The date is printed in the
form 'abc' according to the specified values for abc. For example, on March
29, 2002, DATENS(4MD) would produce '20020329' and DATENS(MDY)
would produce '032902'. See TITLE('string') for additional information on
the first title line.
abc can be any combination of M, D, and Y or 4 (each specified once)
where M represents the month (01-12), D represents the day (01-31), Y
represents the last two digits of the year (for example, 02), and 4 represents
the four digits of the year (for example, 2002).
YDDD(abc)
specifies printing of the date in the first title line. The date is printed in the
form 'acb' according to the specified values for ab and c. For example, on
April 7, 2004, YDDD(DY-) would produce '098-04' and YDDD(4D/) would
produce '2004/098'. See TITLE('string') for additional information on the
first title line.
ab can be any combination of D, and Y or 4 (each specified once) where D
represents the day of the year (001-366), Y represents the last two digits of
the year (for example, 04), and 4 represents the four digits of the year (for
example, 2004).
c can be any character and is used to separate the month, day and year.
YDDDNS(ab)
specifies printing of the date in the first title line. The date is printed in the
form 'ab' according to the specified values for ab. For example, on April 7,
611
DISPLAY Operator
2004, YDDDNS(DY) would produce '09804' and YDDD(4D) would produce
'2004098'. See TITLE('string') for additional information on the first title
line.
ab can be any combination of D, and Y or 4 (each specified once) where D
represents the day of the year (001-366), Y represents the last two digits of
the year (for example, 04), and 4 represents the four digits of the year (for
example, 2004).
TIME
Specifies printing of the time in the first title line. The time is printed in
the form hh:mm:ss where hh is hours, mm is minutes and ss is seconds.
TIME is equivalent to specifying TIME(24:). See TITLE('string') for
additional information on the first title line.
TIME(abc)
Specifies printing of the time in the first title line. The time is printed in
the form 'hhcmmcss xx' according to the specified value for ab and c. For
example, at 08:25:13 pm, TIME=(24:) would produce '20:25:13' and
TIME=(12.) would produce '08.25.13 pm'. See TITLE('string') for additional
information on the first title line.
ab can be:
v 12 to indicate 12-hour time. hh (hours) is 01-12, mm (minutes) is 00-59,
ss (seconds) is 00-59 and xx is am or pm.
v 24 to indicate 24-hour time. hh (hours) is 00-23, mm (minutes) is 00-59,
ss (seconds) is 00-59 and xx is not included.
c can be any character and is used to separate the hours, minutes, and
seconds.
TIMENS(ab)
Specifies printing of the time in the first title line. The time is printed in
the form 'hhmmss xx' according to the specified value for ab. For example,
at 08:25:13 pm, TIMENS=(24) would produce '202513' and TIMENS=(12)
would produce '082513 pm'. See TITLE('string') for additional information
on the first title line.
ab can be:
v 12 to indicate 12-hour time. hh (hours) is 01-12, mm (minutes) is 00-59,
ss (seconds) is 00-59 and xx is am or pm.
v 24 to indicate 24-hour time. hh (hours) is 00-23, mm (minutes) is 00-59,
ss (seconds) is 00-59 and xx is not included.
BLANK
Specifies an alternate format for printing character and numeric data as
follows:
v Numeric values for which formatting is not specified are printed with
blank for plus sign, - for minus sign and no leading zeros (overriding
the default of + for plus sign and leading zeros).
Numeric values are thus displayed as:
d...d for positive values (blank sign immediately to the left of the
digits and no leading zeros)
-d...d for negative values (- sign immediately to the left of the digits
and no leading zeros)
v Column widths are dynamically adjusted according to the length of the
headings and the maximum number of bytes needed for the character or
numeric data
612
DISPLAY Operator
v Headings and data for numeric fields are right-justified (overriding the
default of left-justified headings and data for numeric fields)
PLUS
Specifies an alternate format for printing character and numeric data as
follows:
v Numeric values for which formatting is not specified are printed with +
for plus sign, - for minus sign and no leading zeros (overriding the
default of leading zeros).
Numeric values are thus displayed as:
+d...d for positive values (- sign immediately to the left of the digits
and no leading zeros)
-d...d for negative values (- sign immediately to the left of the digits
and no leading zeros)
v Column widths are dynamically adjusted according to the length of the
headings and the maximum number of bytes needed for the character or
numeric data
v Headings and data for numeric fields are right-justified (overriding the
default of left-justified headings and data for numeric fields)
For ON(NUM), PLUS is treated as BLANK.
NOCC
Specifies that carriage control characters are not to be included in the lines
of the list data set (overriding the default of using a carriage control
character as the first byte of each line). A blank line is used instead of a
page eject control character to separate elements of the report (such as
sections).
The RECFM of the list data set is set to FB.
The LRECL of the list data set will not include a byte for the carriage
control character. If the line length is less than or equal to 120 bytes, the
LRECL will be set to 120. If the line length is greater than 120 bytes, the
LRECL will be set to the line length. The maximum line length is 2047
bytes if LONGLINE is not specified, or 8191 bytes if LONGLINE is
specified.
If WIDTH(n) is specified, n can be 121 to 8191.
HEADER('string1')
Specifies a heading to be printed for the corresponding ON field. The
specified string is used instead of the standard column heading for the
corresponding ON field. (ON fields and HEADER operands correspond
one-for-one according to the order in which they are specified; that is, the
first HEADER operand corresponds to the first ON field, the second
HEADER operand corresponds to the second ON field, and so on.)
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). If the string length is greater than the column width for the
corresponding ON field, the column width is increased to the string length.
The heading is left-justified for character fields or right-justified for
numeric fields and is underlined with hyphens for the entire column width
(overriding the default of left-justified, non-underlined headings).
Character values are left-justified and numeric values are right-justified
(overriding the default of left-justified field values).
A null string ('') or blank string (' ') may be used to set string1 to blanks.
Chapter 7. Using ICETOOL
613
DISPLAY Operator
Blanks at the start or end of a heading string may alter the justification of
the heading or the width of the column.
If HEADER('string1') is used for any ON field, HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3'), or
HEADER(NONE) must be used for each ON field.
HEADER('string1','string2')
Specifies a heading to be printed for the corresponding ON field. A
two-line heading is used with string1 on line1 and string2 on line2. A null
string ('') or blank string (' ') may be used to set string1 or string2 to
blanks. A comma (,) may also be used to set string1 to blanks. For
example, HEADER(,'string1') results in blanks for this heading in line1 and
string1 for this heading in line2.
If HEADER('string1','string2') is used for any ON field, HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3') or
HEADER(NONE) must be used for each ON field.
If a HEADER('string1','string2') operand is specified, a two-line heading is
also used for any HEADER('string1') operands you specify, with string1 for
that heading on line1 and blanks for that heading on line2.
HEADER(,'string1') can be used to put blanks for that heading on line1
and string1 for that heading on line2.
See HEADER('string1') for more details on the HEADER operand.
HEADER('string1','string2','string3')
Specifies a heading to be printed for the corresponding ON field. A
three-line heading is used with string1 on line1, string2 on line2 and
string3 on line3. A null string ('') or blank string (' ') may be used to set
string1, string2 or string3 to blanks. A comma (,) may also be used to set
string1 or string2 to blanks. For example, HEADER(,,'string1') results in
blanks for this heading in line1 and line2 and string1 for this heading in
line3.
If HEADER('string1','string2','string3') is used for any ON field,
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3') or HEADER(NONE) must be used for
each ON field.
If a HEADER('string1','string2','string3') operand is specified:
v a three-line heading is also used for any HEADER('string1') operands
you specify, with string1 for that heading on line1 and blanks for that
heading on line2 and line3. HEADER(,,'string1') can be used to put
blanks for that heading on line1 and line2 and string1 for that heading
on line3.
v a three-line heading is also used for any HEADER('string1','string2')
operands you specify, with string1 for that heading on line1, string2 for
that heading on line2 and blanks for that heading on line3.
HEADER(,'string1','string2') can be used to put blanks for that heading
on line1, string1 for that heading on line2 and string2 for that heading
on line3.
See HEADER('string1') for more details on the HEADER operand.
HEADER(NONE)
Specifies that a heading is not to be printed for the corresponding ON
field. The standard column heading for the corresponding ON field is
suppressed.
614
DISPLAY Operator
If HEADER(NONE) is used for any ON field, HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3'), or
HEADER(NONE) must be used for each ON field. Specifying
HEADER(NONE) for every ON field is equivalent to specifying
NOHEADER.
NOHEADER
Specifies that headings for ON fields are not to be printed (overriding the
default of printing standard headings for ON fields).
If NOHEADER is used, it must be specified only once and
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), and HEADER(NONE) must not be
used.
If NOHEADER is specified without any TITLE, DATE, TIME, or PAGE
operands, the resulting list data set contains only data records. Data sets
created in this way can be processed further by other operators (for
example, STATS or UNIQUE) using CH for character values or FS for
numeric values.
LINES(n)
Specifies the number of lines per page for the list data set (overriding the
default of 58). n must be greater than 9, but less than 1000.
INDENT(n)
Specifies the number of blanks to be used to indent the report (overriding
the default of 0). n can be from 0 to 50. For example, if INDENT(n) is not
specified, the report starts in column 2 (after the control character),
whereas if INDENT(10) is specified, the report starts in column 12 (after
the control character and 10 blanks).
BETWEEN(n)
Specifies the number of blanks to be used between the columns of data
(overriding the default of 3). n can be from 0 to 50. For example, if
BETWEEN(n) is not specified, three blanks appear between columns,
whereas if BETWEEN(7) is specified, seven blanks appear between
columns.
TBETWEEN(n)
Specifies the number of blanks to be used between title elements (title
strings, page number, date and time) in the first title line (overriding the
default of 8). n can be from 0 to 50. For example, if TBETWEEN(n) is not
specified, eight blanks appear between the title strings and page number in
the first title line, whereas if TBETWEEN(4) is specified, four blanks appear
between the title strings and page number in the first title line.
TOTAL('string')
Specifies an overall TOTAL line is to be printed after the rows of data for
the report. The specified string is printed starting at the indent column of
the overall TOTAL line, followed by the overall total for each numeric data
column. If STATLEFT is specified, the string is printed to the left of the
first column of data with the totals on the same line as the string. If
STATLEFT is not specified, the string is printed in the first column of data
with the totals on the same line as the string, or on the next line, as
appropriate. A blank line is printed before the overall TOTAL line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify TOTAL('') using two single
apostrophes.
Chapter 7. Using ICETOOL
615
DISPLAY Operator
The overall total for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The total for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Totals are printed for ON(VLEN) fields, but not for
ON(NUM) fields.
The default number of digits (d) for a total is 15 if the ON field is BI or FI
with a length up to 4, PD with a length up to 8, or ZD, CSF, FS, UFF or
SFF with a length up to 15. The default number of digits (d) for a total is
31 if the ON field is BI or FI with a length greater than 4, PD with a length
greater than 8, ZD, CSF, FS, UFF or SFF with a length greater than 15, or
FL. By default, column widths are adjusted to allow for a maximum of a
sign and d digits for the totals. If the overall total for an ON field
overflows d digits, ICETOOL prints asterisks for the overall total for that
field and terminates the operation.
You can use the Ndd or Udd formatting item to decrease or increase the
number of digits used for a total. If you use Ndd or Udd and the overall
total for an ON field overflows dd digits, ICETOOL prints asterisks for the
overall total for that field and terminates the operation.
You can prevent overflow by specifying an appropriate dd value for Ndd
or Udd. For example, if ON(1,15,ZD) with TOTAL overflows the default of
15 digits, you can specify ON(1,15,ZD,U16) to prevent overflow. If
ON(1,15,ZD,U16) still results in overflow, you can specify
ON(1,15,ZD,U17), and so on.
Either Ndd or Udd can be used to set the number of digits greater than the
maximum for a numeric field, but only Udd can be used to set the number
of digits less than the maximum for a numeric field.
See the discussion of Ndd or Udd under ON(p,m,f,formatting) for more
details on using Ndd or Udd with TOTAL.
The TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT lines are
printed in the order in which you specify them.
MAXIMUM('string')
Specifies an overall MAXIMUM line is to be printed after the rows of data
for the report. The specified string is printed starting at the indent column
of the overall MAXIMUM line, followed by the overall maximum for each
numeric data column. If STATLEFT is specified, the string is printed to the
left of the first column of data with the maximums on the same line as the
string. If STATLEFT is not specified, the string is printed in the first
column of data with the maximums on the same line as the string, or on
the next line, as appropriate. A blank line is printed before the overall
MAXIMUM line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify MAXIMUM('') using two
single apostrophes.
The overall maximum for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The maximum for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Maximums are printed for ON(VLEN) fields, but
not for ON(NUM) fields.
The TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT lines are
printed in the order in which you specify them.
616
DISPLAY Operator
MINIMUM('string')
Specifies an overall MINIMUM line is to be printed after the rows of data
for the report. The specified string is printed starting at the indent column
of the overall MINIMUM line, followed by the overall minimum for each
numeric data column. If STATLEFT is specified, the string is printed to the
left of the first column of data with the minimums on the same line as the
string. If STATLEFT is not specified, the string is printed in the first
column of data with the minimums on the same line as the string, or on
the next line, as appropriate. A blank line is printed before the overall
MINIMUM line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify MINIMUM('') using two single
apostrophes.
The overall minimum for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The minimum for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Minimums are printed for ON(VLEN) fields, but
not for ON(NUM) fields.
The TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT lines are
printed in the order in which you specify them.
AVERAGE('string')
Specifies an overall AVERAGE line is to be printed after the rows of data
for the report. The specified string is printed starting at the indent column
of the overall AVERAGE line, followed by the overall average for each
numeric data column. If STATLEFT is specified, the string is printed to the
left of the first column of data with the averages on the same line as the
string. If STATLEFT is not specified, the string is printed in the first
column of data with the averages on the same line as the string, or on the
next line, as appropriate. A blank line is printed before the overall
AVERAGE line.
The overall average (or mean) is calculated by dividing the overall total by
the number of values in the report and rounding down to the nearest
integer (examples: 23 / 5 = 4, -23 / 5 = -4).
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
('). To suppress printing of a string, specify AVERAGE('') using two single
apostrophes.
The overall average for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The average for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Averages are printed for ON(VLEN) fields, but not
for ON(NUM) fields.
You can use the Ndd or Udd formatting item to decrease or increase the
number of digits used for a total. If the overall total for an ON field
overflows d digits, ICETOOL prints asterisks for the overall average for
that field and terminates the operation. You can prevent overflow by
specifying an appropriate dd value for Ndd or Udd. For example, if
ON(1,15,ZD) with AVERAGE overflows the default of 15 digits for the
total, you can specify ON(1,15,ZD,U16) to prevent overflow.
617
DISPLAY Operator
See the discussion of Ndd or Udd under ON(p,m,f,formatting) for more
details on using Ndd or Udd.
The TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT lines are
printed in the order in which you specify them.
COUNT('string')
Specifies an overall COUNT line is to be printed after the rows of data for
the report. The specified string is printed starting at the indent column of
the overall COUNT line, followed by the overall count of data records. If
STATLEFT is specified, the string is printed to the left of the first column
of data. If STATLEFT is not specified, the string is printed in the first
column of data. The count is printed on the same line as the string. A
blank line is printed before the overall COUNT line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify COUNT('') using two single
apostrophes.
The count is printed in the format (PLUS, BLANK, or standard) you
specify. EDCOUNT(formatting) can be used to apply formatting items to
the count. The default number of digits (d) for the count is 15.
The TOTAL, MAXIMUM, MINIMUM, AVERAGE, and COUNT lines are
printed in the order in which you specify them.
EDCOUNT(formatting)
Specifies how the overall count is to be formatted for printing. Formatting
items can be specified in any order, but each item can only be specified
once. EDCOUNT can only be specified if COUNT('string') is specified.
mask
See ON(p,m,f,formatting) for a discussion of mask.
E'pattern'
specifies an edit pattern to be applied to the count. The pattern (1 to 24
characters) must be enclosed in single apostrophes. Each 9 in the
pattern (up to 15) is replaced by a corresponding digit from the count.
Characters other than 9 in the pattern appear as specified. To include a
single apostrophe (') in the pattern, specify two single apostrophes ('').
F'string' or a mask cannot be specified with E'pattern'.
When E'pattern' is specified for the count:
v If the number of significant digits in the count is less than the
number of 9's in the pattern, 0's are filled in on the left. For example,
1234 is shown as 001234 with EDCOUNT(E'999999').
v If the number of significant digits in the count is greater than the
number of 9's in the pattern, digits are truncated from the left. For
example, 1234567 is shown as *4567* with EDCOUNT(E'*9999*').
L'string'
See ON(p,m,f,formatting) for a discussion of L'string'.
F'string'
See ON(p,m,f,formatting) for a discussion of F'string'.
T'string'
See ON(p,m,f,formatting) for a discussion of T'string'.
LZ See ON(p,m,f,formatting) for a discussion of LZ.
618
DISPLAY Operator
Udd
specifies the number of digits to be used for the count. dd specifies the
number of digits and must be a two-digit number between 01 and 15.
The default number of digits (d) for the count is 15.
If you know that your count requires less than 15 digits, you can use a
lower number of digits (dd) instead by specifying Udd. For example, if
EDCOUNT(U09) is specified, 9 digits (from U09) is used instead of 15
(default for the count).
If you use Udd and the count overflows the number of digits used,
ICETOOL terminates the operation. You can prevent the overflow by
specifying an appropriately higher dd value for Udd. For example, if
EDCOUNT(U05) results in overflow, you can use EDCOUNT(U06)
instead.
If E'pattern' is specified, Udd is ignored, because d is determined from
the pattern.
LIMIT(n)
Specifies a limit for the number of invalid decimal values (overriding the
default of 200). If n invalid decimal values are found, ICETOOL terminates
the operation. n can be 1 to 15 decimal digits, but must be greater than 0.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY
operator on page 575.
WIDTH(n)
Specifies the line length and LRECL you want ICETOOL to use for your
list data set. If NOCC is not specified, n can be from 121 to 8192. If NOCC
is specified, n can be from 121 to 8191.
ICETOOL always calculates the line length required to print all titles,
headings, data, and statistics and uses it as follows:
v If WIDTH(n) is specified and the calculated line length is less than or
equal to n, ICETOOL sets the line length and LRECL to n.
v If WIDTH(n) is specified and the calculated line length is greater than n,
ICETOOL issues an error message and terminates the operation.
v If WIDTH(n) is not specified, NOCC is not specified, and the calculated
line length is less than or equal to 121, ICETOOL sets the line length and
LRECL to 121.
v If WIDTH(n) is not specified, NOCC is specified, and the calculated line
length is less than or equal to 120, ICETOOL sets the line length and
LRECL to 120.
v If WIDTH(n) is not specified, NOCC is specified, and the calculated line
length is between 121 and 2047, or between 121 and 8191 if LONGLINE
is specified, ICETOOL sets the line length and LRECL to the calculated
line length.
v If WIDTH(n) is not specified, NOCC is not specified, and the calculated
line length is between 122 and 2048, or between 122 and 8192 if
LONGLINE is specified, ICETOOL sets the line length and LRECL to the
calculated line length.
v If WIDTH(n) is not specified, NOCC is not specified, and the calculated
line length is greater than 2048, or greater than 8192 if LONGLINE is
specified, ICETOOL issues an error message and terminates the
operation.
Chapter 7. Using ICETOOL
619
DISPLAY Operator
v If WIDTH(n) is not specified, NOCC is specified, and the calculated line
length is greater than 2047, or greater than 8191 if LONGLINE is
specified, ICETOOL issues an error message and terminates the
operation.
Use WIDTH(n) if your LRECL must be set to a particular value (for
example, if you use DISP=MOD to place several reports in the same data
set) or if you want to ensure that the line length for your report does not
exceed a specific maximum (for example, 133 bytes). Otherwise, you can
let ICETOOL calculate and set the appropriate line length and LRECL by
not specifying WIDTH(n).
LONGLINE
Specifies the calculated line length can be a maximum of 8191 bytes if
NOCC is specified, or a maximum of 8192 bytes if NOCC is not specified
(overriding the defaults of 2047 bytes if NOCC is specified or 2048 bytes if
NOCC is specified). Use LONGLINE if you do not specify WIDTH(n) and
your calculated line length is larger than the default.
BREAK(p,m,f)
Specifies a numeric or character break field to be used to divide the report
into sections. Each set of sequential input records, with the same value for
the specified break field, results in a corresponding set of data lines that is
treated as a section in the report. The DISPLAY operator should be
preceded by a SORT operator (or another application) that sorts the break
field and any other appropriate fields in the desired sequence for the
report.
Each section starts on a new page. Each page of a section includes a break
title line showing the break value for the section. Numeric break values are
printed with blank for plus sign, - for minus sign, and no leading zeros.
BTITLE can be used to specify a string to appear in the break title line. The
break value and break title string appear in the order in which you specify
BREAK and BTITLE. Two blanks appear between break title elements. A
blank line is printed after the break title line.
BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT can be
used to produce break statistics for each numeric ON field and for the
break count-for example, the maximum of the values in the section for
ON(5,3,ZD) and the maximum of the values in the section for ON(22,2,BI).
The break statistics for each section are printed at the end of the section
(on one or more pages that include the break title). TOTAL, MAXIMUM,
MINIMUM, AVERAGE, and COUNT can be used to produce overall
statistics for each numeric ON field and for the overall count-for example,
the maximum of the values in the report for ON(5,3,ZD) and the maximum
of the values in the report for ON(22,2,BI). The overall statistics for each
section are printed at the end of the report (on a separate page that does
not include the break title).
See ON(p,m,f) for a discussion of p and m.
f specifies the format of the field as shown for ON(p,m,f).
Note: An FL (hexadecimal floating-point) field can be specified for ON,
but not for BREAK.
For a CSF, FS, UFF, or SFF format break field:
v A maximum of 31 digits is allowed. If a value with more than 31 digits
is found, ICETOOL issues an error message and terminates the
operation.
620
DISPLAY Operator
For a ZD or PD format break field:
v If a decimal value with an invalid digit (A-F) is found, ICETOOL issues
an error message and terminates the operation.
v A value is treated as positive if its sign is F, E, C, A, 8, 6, 4, 2, or 0.
v A value is treated as negative if its sign is D, B, 9, 7, 5, 3, or 1.
For a DT1, DT2 or DT3 format field:
v An invalid SMF date can result in a data exception (0C7 ABEND) or an
incorrect ZD date.
v SMF date values are always treated as positive.
For a DC1, DC2, DC3, DE1, DE2, or DE3 format field:
v TOD and ETOD date values are always treated as positive.
For a TM1, TM2, TM3 or TM4 format field:
v An invalid SMF time can result in an incorrect ZD time.
v SMF time values are always treated as positive.
For a TC1, TC2, TC3, TC4, TE1, TE2, TE3, or TE4 format field:
v TOD and ETOD time values are always treated as positive.
BREAK(p,m,f,formatting)
Specifies a numeric or character break field to be used to divide the report
into sections, and how the data for this field is to be formatted for
printing.
See BREAK(p,m,f) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Udd
621
DISPLAY Operator
LZ See ON(p,m,f,formatting) for a discussion of LZ.
Udd
specifies the number of digits to be used for a numeric break field.
Udd can be used to change the column width for numeric break fields.
dd specifies the number of digits and must be a two-digit number
between 01 and 31.
The default number of digits (d) for a numeric break field is the
maximum number of digits for that field. For example, d is 8 for
BREAK(1,8,ZD). If you know that your break field requires less than d
digits, you can use a lower number of digits (dd) instead by specifying
Udd, thus reducing the break field width. For example,
BREAK(1,8,ZD,U06) reduces d from 8 to 6. If you want your break
field to be displayed with more than d digits, you can use a higher
number of digits (dd) instead by specifying Udd, thus increasing the
field width. For example, BREAK(1,8,ZD,U11) increases d from 8 to 11.
BTITLE('string')
Specifies a string to appear in the break title line printed for each page of a
section. BTITLE can only be specified if BREAK is specified. The break
value and break title string appear in the order in which you specify
BREAK and BTITLE. Two blanks appear between break title elements. A
blank line is printed after the break title line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). Blanks at the start of the string move the text to the right. Blanks at the
end of the string increase the spacing between the string and the break
value if BTITLE is specified before BREAK.
BTOTAL('string')
Specifies a break TOTAL (BTOTAL) line is to be printed after the rows of
data for each section. BTOTAL can only be specified if BREAK is specified.
The specified string is printed starting at the indent column of the break
TOTAL line, followed by the break total for each numeric data column.If
STATLEFT is specified, the string is printed to the left of the first column
of data with the totals on the same line as the string. If STATLEFT is not
specified, the string is printed in the first column of data with the totals on
the same line as the string, or on the next line, as appropriate. A blank line
is printed before the break TOTAL line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify BTOTAL('') using two single
apostrophes.
The break total for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The total for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Totals are printed for ON(VLEN) fields, but not for
ON(NUM) fields.
The default number of digits (d) for a break total is 15 if the ON field is BI
or FI with a length up to 4, PD with a length up to 8, or ZD, CSF, FS, UFF
or SFF with a length up to 15. The default number of digits (d) for a break
total is 31 if the ON field is BI or FI with a length greater than 4, PD with
a length greater than 8, or ZD, CSF, FS, UFF or SFF with a length greater
than 15. By default, column widths are adjusted to allow for a maximum
622
DISPLAY Operator
of a sign and d digits for the totals. If the break total for an ON field
overflows d digits, ICETOOL prints asterisks for the break total for that
field and terminates the operation.
You can use the Ndd or Udd formatting item to decrease or increase the
number of digits used for a break total. If you use Ndd or Udd and the
break total for an ON field overflows dd digits, ICETOOL prints asterisks
for the break total for that field and terminates the operation.
You can prevent overflow by specifying an appropriate dd value for Ndd
or Udd. For example, if ON(1,15,ZD) with BTOTAL overflows the default
of 15 digits, you can specify ON(1,15,ZD,U16) to prevent overflow. If
ON(1,15,ZD,U16) still results in overflow, you can specify
ON(1,15,ZD,U17), and so on.
Either Ndd or Udd can be used to set the number of digits greater than the
maximum for a numeric field, but only Udd can be used to set the number
of digits less than the maximum for a numeric field.
See the discussion of Ndd or Udd under ON(p,m,f,formatting) for more
details on using Ndd or Udd with BTOTAL.
The BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT lines
are printed in the order in which you specify them.
BMAXIMUM('string')
Specifies a break MAXIMUM line is to be printed after the rows of data for
each section. BMAXIMUM can only be specified if BREAK is specified. The
specified string is printed starting at the indent column of the break
MAXIMUM line, followed by the break maximum for each numeric data
column. If STATLEFT is specified, the string is printed to the left of the
first column of data with the maximums on the same line as the string. If
STATLEFT is not specified, the string is printed in the first column of data
with the maximums on the same line as the string, or on the next line, as
appropriate. A blank line is printed before the break MAXIMUM line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify BMAXIMUM('') using two
single apostrophes.
The break maximum for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The maximum for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Maximums are printed for ON(VLEN) fields, but
not for ON(NUM) fields.
The BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT lines
are printed in the order in which you specify them.
BMINIMUM('string')
Specifies a break MINIMUM line is to be printed after the rows of data for
each section. BMINIMUM can only be specified if BREAK is specified. The
specified string is printed starting at the indent column of the break
MINIMUM line, followed by the break minimum for each numeric data
column. If STATLEFT is specified, the string is printed to the left of the
first column of data with the minimums on the same line as the string. If
STATLEFT is not specified, the string is printed in the first column of data
with the minimums on the same line as the string, or on the next line, as
appropriate. A blank line is printed before the break MINIMUM line.
623
DISPLAY Operator
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify BMINIMUM('') using two
single apostrophes.
The break minimum for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The minimum for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Minimums are printed for ON(VLEN) fields, but
not for ON(NUM) fields.
The BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT lines
are printed in the order in which you specify them.
BAVERAGE('string')
Specifies a break AVERAGE line is to be printed after the rows of data for
each section. BAVERAGE can only be specified if BREAK is specified. The
specified string is printed starting at the indent column of the break
AVERAGE line, followed by the break average for each numeric data
column. If STATLEFT is specified, the string is printed to the left of the
first column of data with the averages on the same line as the string. If
STATLEFT is not specified, the string is printed in the first column of data
with the averages on the same line as the string, or on the next line, as
appropriate. A blank line is printed before the break AVERAGE line.
The break average (or mean) is calculated by dividing the break total by
the number of values in the section and rounding down to the nearest
integer (examples: 23 / 5 = 4, -23 / 5 = -4).
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify BAVERAGE('') using two
single apostrophes.
The break average for each numeric ON field is printed in the format
(formatting, PLUS, BLANK, or standard) you specify. The average for a
specific numeric field is suppressed if the NOST formatting item is
specified for that field. Averages are printed for ON(VLEN) fields, but not
for ON(NUM) fields.
You can use the Ndd or Udd formatting item to decrease or increase the
number of digits used for a break total. If the break total for an ON field
overflows d digits, ICETOOL prints asterisks for the break average for that
field and terminates the operation. You can prevent overflow by specifying
an appropriate dd value for Ndd or Udd. For example, if ON(1,15,ZD)
with BAVERAGE overflows the default of 15 digits for the total, you can
specify ON(1,15,ZD,U16) to prevent overflow.
See the discussion of Ndd or Udd under ON(p,m,f,formatting) for more
details on using Ndd or Udd.
The BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT lines
are printed in the order in which you specify them.
BCOUNT('string')
Specifies a break COUNT line is to be printed after the rows of data for
each section. BCOUNT can only be specified if BREAK is specified. The
specified string is printed starting at the indent column of the break
COUNT line, followed by the break count of data records in the section. If
STATLEFT is specified, the string is printed to the left of the first column
of data. If STATLEFT is not specified, the string is printed in the first
624
DISPLAY Operator
column of data. The count is printed on the same line as the string. A
blank line is printed before the break COUNT line.
The string (1 to 50 characters) must be enclosed in single apostrophes. To
include a single apostrophe (') in the string, specify two single apostrophes
(''). To suppress printing of a string, specify BCOUNT('') using two single
apostrophes.
The count is printed in the format (PLUS, BLANK, or standard) you
specify. EDBCOUNT(formatting) can be used to apply formatting items to
the count. The default number of digits (d) for the count is 15.
The BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE, and BCOUNT lines
are printed in the order in which you specify them.
EDBCOUNT(formatting)
Specifies how the break count is to be formatted for printing. Formatting
items can be specified in any order, but each item can only be specified
once. EDBCOUNT can only be specified if BCOUNT('string') is specified.
mask
See ON(p,m,f,formatting) for a discussion of mask.
E'pattern'
See ON(p,m,f,formatting) for a discussion of E'pattern'.
L'string'
See ON(p,m,f,formatting) for a discussion of L'string'.
F'string'
See ON(p,m,f,formatting) for a discussion of F'string'.
T'string'
See ON(p,m,f,formatting) for a discussion of T'string'.
LZ See ON(p,m,f,formatting) for a discussion of LZ.
Udd
See EDCOUNT(formatting) for a discussion of Udd.
STATLEFT
Specifies that the strings for statistics (TOTAL, MAXIMUM, MINIMUM,
AVERAGE, COUNT, BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE,
BCOUNT) are to be placed to the left of the first column of data
(overriding the default of placing the strings in the first column).
STATLEFT ensures that each statistic appears on the same line as its string
while making the statistics lines stand out from the columns of data.
UZERO
Specifies that -0 and +0 are to be treated as unsigned zero values, that is,
as the same value. With UZERO, -0 and +0 are treated as positive for ON,
MINIMUM, MAXIMUM, BREAK, BMINIMUM and BMAXIMUM
processing.
UZERO overrides the default of treating -0 and +0 as signed zero values,
that is, as different values. Without UZERO, -0 is treated as negative and
+0 is treated as positive for ON, MINIMUM, MAXIMUM, BREAK,
BMINIMUM and BMAXIMUM processing.
LISTSDB OR LISTNOSDB
Can be used to override the SDBMSG value for this LIST data set.
LISTSDB directs ICETOOL to select the system-determined optimum block
size for the LIST data set in the same way as for installation option
Chapter 7. Using ICETOOL
625
DISPLAY Operator
SDBMSG=YES. LISTNOSDB directs ICETOOL to select the block size for
the LIST data set in the same way as for installation option SDBMSG=NO.
See the discussion of the LIST(listdd) operand previously in this section for
more information on how LISTSDB or LISTNOSDB affects the LIST data
set block size.
Attention: LISTSDB has no effect for SYSOUT data sets (for example,
//RPT1 DD SYSOUT=*), because the system-determined optimum block
size is not used for spool or dummy data sets.
DISPLAY examples
Although the DISPLAY operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity. See OCCUR operator on page 646 for additional examples of tailoring
the report format.
Example 1:
DISPLAY FROM(SOURCE) LIST(FIELDS) ON(NUM) ON(40,12,CH) ON(20,8,PD)
(40,12,CH)
SAN JOSE
MORGAN HILL
.
.
.
(20,8,PD)
000000000003745
000000000016502
.
.
.
626
DISPLAY Operator
The zoned decimal values from positions 35-44 of the IN data set
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields in the BLANK format
v An AVERAGE line containing the specified string and the average for each of
the two zoned decimal fields in the BLANK format.
The LIST1 output starts on a new page and looks as follows (the first 2 records are
shown with illustrative values):
National Accounting Report
- 1 -
Division
------------------------Research and Development
Manufacturing
.
.
.
Revenue
---------------54323456
159257631
.
.
.
Profit/Loss
----------------823325
1372610
.
.
.
612867321
5277836
76608415
659729
Company Totals
Company Averages
02/21/05
18:52:44
The title line and underlined heading line appear at the top of each page.
Example 3:
DISPLAY FROM(DATA) LIST(JUSTDATA) NOHEADER ON(17,5,PD) ON(1,2,FI)
+0000000000000027
+0000000000000321
.
.
.
Example 4:
COPY FROM(INPUT) TO(TEMP) USING(TREG)
DISPLAY FROM(TEMP) LIST(REGULAR) PAGE TITLE(Report on Regular Tools) TBETWEEN(12)HEADER(NONE) ON(1,18,CH) HEADER(,Item) ON(35,5,CH) HEADER(Percent,Change) ON(28,4,FS,B1) LINES(66)
COPY FROM(INPUT) TO(TEMP) USING(TPOW)
DISPLAY FROM(TEMP) LIST(POWER) PAGE TITLE(Report on Power Tools ) TBETWEEN(12)-
627
DISPLAY Operator
HEADER(NONE) ON(1,18,CH) HEADER(,Item) ON(35,5,CH) HEADER(Percent,Change) ON(28,4,FS,B1) LINES(66)
This example shows how reports for different subsets of data can be produced.
Assume that:
v The TREGCNTL data set contains:
INCLUDE COND=(44,8,CH,EQ,CRegular)
The first COPY operator copies the records from the INPUT data set that contain
'Regular ' in positions 44-51 to the TEMP (temporary) data set
The first DISPLAY operator uses the first subset of records in the TEMP data set to
print, in the REGULAR data set:
v A title line containing the page number and specified title, with twelve blanks
between these report elements.
v A two-line heading containing the specified underlined strings (with no heading
for the first ON field)). Note the comma in HEADER(,'Item') to place 'Item' on
line2 of the heading.
v Data lines for the first subset of records containing:
The characters from positions 1-18
The characters from positions 35-39
The floating sign values from positions 28-31 formatted with one decimal
place and a period as the decimal point
The second COPY operator copies the records from the INPUT data set that
contain 'Power ' in positions 44-51 to the TEMP (temporary) data set
The second DISPLAY operator uses the second subset of records in the TEMP data
set to print, in the POWER data set:
v A title line containing the page number and specified title, with twelve blanks
between these report elements.
v A two-line heading containing the specified underlined strings (with no heading
for the first ON field)). Note the comma in HEADER(,'Item') to place 'Item' on
line2 of the heading.
v Data lines for the second subset of records containing:
The characters from positions 1-18
The characters from positions 35-39
The floating sign values from positions 28-31 formatted with one decimal
place and a period as the decimal point
The REGULAR output starts on a new page and looks as follows (the first 2
records are shown with illustrative values):
- 1 -
Hammers
Wrenches
628
Item
----10325
00273
Percent
Change
-------7.3
15.8
DISPLAY Operator
The title line and underlined heading lines appear at the top of each page. The
number of lines per page is 66, overriding the default of 58.
The POWER output starts on a new page and looks as follows (the first 2 records
are shown with illustrative values):
- 1 -
Item
----10325
00273
Hammers
Wrenches
Percent
Change
------9.8
123.0
The title line and underlined heading lines appear at the top of each page. The
number of lines per page is 66, overriding the default of 58.
Example 5:
DISPLAY FROM(INV) LIST(RDWLIST1) TITLE(No Frills RDW Report) ON(NUM) ON(VLEN) ON(1,4,HEX) MINIMUM(Smallest) MAXIMUM(Largest)
RECORD LENGTH
(1,4,HEX)
+000000000000075 004B0000
+000000000000071 00470000
. .
. .
. .
Smallest
+000000000000058
Largest
+000000000000078
The title line and heading line appear at the top of each page.
629
DISPLAY Operator
Example 6:
DISPLAY FROM(INV) LIST(RDWLIST2) DATE(DMY.) TFIRST TBETWEEN(3) TITLE(Fancy RDW Report with) TITLE(length in decimal and hex) TITLE(and max and min length) TIME(12:) HEADER(Relative Record) ON(NUM) HEADER(
RDW (length)) ON(VLEN) HEADER(RDW (Hex)) ON(1,4,HEX) BLANK MINIMUM(Smallest Record:) MAXIMUM(Largest Record:) COUNT(Number of Records: ) EDCOUNT(U04)
05:37:43 pm
RDW (length)
---------------84
47
31
31
31
RDW (Hex)
--------00540000
002F0000
001F0000
001F0000
001F0000
Relative Record
--------------51
52
53
54
55
56
RDW (length)
---------------31
31
31
31
31
31
RDW (Hex)
--------001F0000
001F0000
001F0000
001F0000
001F0000
001F0000
Smallest Record:
31
Largest Record:
84
Number of Records:
630
56
DISPLAY Operator
The title lines only appear at the top of the first page as specified by the TFIRST
operand. The underlined heading line appears at the top of each page.
Example 7:
SORT FROM(PARTS) TO(TEMP) USING(SRT1)
DISPLAY FROM(TEMP) LIST(USA) TITLE(Parts Completion Report for USA) DATE HEADER(Part) HEADER(Completed) HEADER(Value ($)) ON(15,6,CH)
ON(3,4,ZD,A1)
ON(38,8,ZD,C1) TOTAL(Total:)
DISPLAY FROM(TEMP) LIST(FRANCE) TITLE(Parts Completion Report for France) DATE(DM4/) HEADER(Part) HEADER(Completed) HEADER(Value (F)) ON(15,6,CH)
ON(3,4,ZD,A3)
ON(38,8,ZD,C3) TOTAL(Total:)
DISPLAY FROM(TEMP) LIST(DENMARK) TITLE(Parts Completion Report for Denmark) DATE(DMY-) HEADER(Part) HEADER(Completed) HEADER(Value (kr)) ON(15,6,CH)
ON(3,4,ZD,A2)
ON(38,8,ZD,C2) TOTAL(Total:)
This example shows how reports for three different countries can be produced. The
reports differ only in the way that date and numeric values are displayed.
Assume that the SRT1CNTL data set contains:
SORT FIELDS=(15,6,CH,A)
The SORT operator sorts the PARTS data set to the TEMP data set using the SORT
statement in SRT1CNTL.
The first DISPLAY operator uses the sorted records in the TEMP data set to print,
in the USA data set:
v A title line containing the specified title and the date in the format commonly
used in the United States
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in the United States
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in the United
States.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The second DISPLAY operator uses the sorted records in the TEMP data set to
print, in the FRANCE data set:
v A title line containing the specified title and the date in the format commonly
used in France
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in France
631
DISPLAY Operator
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in France.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The third DISPLAY operator uses the sorted records in the TEMP data set to print,
in the DENMARK data set:
v A title line containing the specified title and the date in the format commonly
used in Denmark
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 15-20
The zoned decimal values from positions 3-6 formatted with the separators
commonly used in Denmark
The zoned decimal values from positions 38-45 formatted with two decimal
places and the separators and decimal point commonly used in Denmark.
v A TOTAL line containing the specified string and the total for each of the two
zoned decimal fields formatted in the same way as the data values.
The USA output starts on a new page and looks as follows (several records are
shown with illustrative values):
Parts Completion Report for USA
01/14/05
Part
-----000310
001184
029633
192199
821356
Completed
-------------------562
1,234
35
3,150
233
Value ($)
--------------------8,317.53
23,456.78
642.10
121,934.65
2,212.34
Total:
5,214
156,563.40
The title line and underlined heading line appear at the top of each page.
The FRANCE output starts on a new page and looks as follows (several record are
shown with illustrative values):
Parts Completion Report for France
14/01/2005
Part
-----000310
001184
029633
192199
821356
Completed
-------------------562
1 234
35
3 150
233
Value (F)
--------------------8 317,53
23 456,78
642,10
121 934,65
2 212,34
Total:
5 214
156 563,40
The title line and underlined heading line appear at the top of each page.
The DENMARK output starts on a new page and looks as follows (several records
are shown with illustrative values):
632
DISPLAY Operator
14-01-05
Part
-----000310
001184
029633
192199
821356
Completed
-------------------562
1.234
35
3.150
233
Value (kr)
--------------------8.317,53
23.456,78
642,10
121.934,65
2.212,34
Total:
5.214
156.563,40
The title line and underlined heading line appear at the top of each page.
Example 8:
SORT FROM(DATA) TO(TEMP) USING(SRTX)
DISPLAY FROM(TEMP) LIST(WEST) DATE TITLE(Western Region Profit/Loss Report) PAGE BTITLE(Division:) BREAK(3,10,CH) HEADER(Branch Office) ON(16,13,CH) HEADER(Profit/Loss (K)) ON(41,4,PD,/K,E1) BMINIMUM(Lowest Profit/Loss in this Division:) BMAXIMUM(Highest Profit/Loss in this Division:) BAVERAGE(Average Profit/Loss for this Division:) MINIMUM(Lowest Profit/Loss for all Divisions:) MAXIMUM(Highest Profit/Loss for all Divisions:) AVERAGE(Average Profit/Loss for all Divisions:)
The SORT operator sorts the DATA data set to the TEMP data set using the SORT
statement in SRTXCNTL.
The DISPLAY operator uses the sorted records in the TEMP data set to print, in the
WEST data set, sections with:
v A title line containing the date, the specified title string, and the page number
v A break title containing the specified break title string, and the break field
characters from positions 3-12
v A heading line containing the specified underlined headings
v Data lines containing:
The characters from positions 16-28
The packed decimal values from positions 41-44 divided by 1000 and
formatted with separators and signs as specified.
v Break MINIMUM, MAXIMUM, and AVERAGE lines containing the specified
strings and statistics for the packed decimal field values in this section,
formatted in the same way as the data values.
The last page of the report contains:
v A title line containing the date, the specified title string, and the page number
v A heading line containing the specified underlined headings
v Overall MINIMUM, MAXIMUM, and AVERAGE lines containing the specified
strings and statistics for the packed decimal field values in the report, formatted
in the same way as the data values.
Chapter 7. Using ICETOOL
633
DISPLAY Operator
The first section of the WEST output starts on a new page and looks as follows
(several records are shown with illustrative values):
01/14/05
Division:
- 1 -
Chips
Branch Office
------------Gilroy
Los Angeles
Morgan Hill
Oakland
San Francisco
San Jose
San Martin
Profit/Loss (K)
--------------3,293
(141)
213
1,067
(31)
92
1,535
The title line, break title line, and underlined heading line appear at the top of
each page of the section.
The second section of the WEST output starts on a new page and looks as follows
(several records are shown with illustrative values):
01/14/05
Division:
- 2 -
Ice Cream
Branch Office
------------Marin
Napa
San Francisco
San Jose
San Martin
Profit/Loss (K)
--------------673
95
(321)
2,318
21
The title line, break title line, and underlined heading line appear at the top of
each page of the section.
The last page of the WEST output starts on a new page and looks as follows:
634
DISPLAY Operator
01/14/05
Branch Office
-------------
Profit/Loss (K)
---------------
- 3 -
Example 9:
MODE CONTINUE
VERIFY FROM(CHECK) ON(2,3,PD) LIMIT(500)
DISPLAY FROM(CHECK) LIST(PDREPORT) BLANK LIMIT(500) HEADER(Relative Record) ON(NUM) HEADER(Numeric) ON(2,3,PD) HEADER(Hexadecimal) ON(2,3,HEX) HEADER(Associated Field) ON(21,20,CH)
This example shows how each record containing an invalid decimal value can be
identified either by its relative record number or an associated field in the record.
The MODE operator ensures that the DISPLAY operator is processed if the VERIFY
operator identifies an invalid decimal value.
The VERIFY operator checks for invalid digits (A-F) and invalid signs (0-9) in the
packed decimal values from positions 2-4 of the CHECK data set. Messages
ICE618A and ICE649A are printed in the TOOLMSG data set for each value (if
any) that contains an invalid digit or sign. If 500 invalid values are found, the
operation is terminated.
The DISPLAY operator checks for invalid digits (A-F) in the packed decimal values
from positions 2-4 of the CHECK data set. Messages ICE618A and ICE649A are
printed in the TOOLMSG data set for each value (if any) that contains an invalid
digit. If 500 invalid values are found, the operation is terminated. If a check for
invalid signs is required, the VERIFY operator must be used, because the DISPLAY
operator only checks for invalid digits. The VERIFY operator is not required if
signs need not be checked.
The DISPLAY operator also prints, in the PDREPORT data set:
v A heading line containing the specified underlined headings
v Data lines in the BLANK format containing:
The relative record number. This number can be matched against the
RECORD numbers printed in the ICE618A messages to find the records with
invalid signs.
The numeric representation of the packed decimal value in positions 2-4.
Asterisks are shown for values with invalid digits, making them easy to
identify. Asterisks are not shown for values with invalid signs; these must be
identified by matching the relative record number against the RECORD
number in ICE618A.
The hexadecimal representation of the packed decimal value in positions 2-4
(also shown in ICE649A). This makes it easy to find the specific hexadecimal
digits or signs that are invalid.
Chapter 7. Using ICETOOL
635
DISPLAY Operator
The characters in positions 21-40. An associated field such as this can be used
to make identification of the records with invalid values easier.
The ICE618A and ICE649A messages in TOOLMSG for the VERIFY operator are:
ICE618A
ICE649A
ICE618A
ICE649A
ICE618A
ICE649A
0 INVALID (2,3,PD)
0
HEX VALUE: 53A54C
0 INVALID (2,3,PD)
0
HEX VALUE: 621540
0 INVALID (2,3,PD)
0
HEX VALUE: 400F3C
VALUE - RECORD:
000000000000003
VALUE - RECORD:
000000000000012
VALUE - RECORD:
000000000000019
The ICE618A and ICE649A messages in TOOLMSG for the DISPLAY operator are:
ICE618A
ICE649A
ICE618A
ICE649A
0 INVALID (2,3,PD)
0
HEX VALUE: 53A54C
0 INVALID (2,3,PD)
0
HEX VALUE: 400F3C
VALUE - RECORD:
000000000000003
VALUE - RECORD:
000000000000019
Numeric
------18600
-93
******
86399
24215
8351
19003
-31285
88316
1860
-29285
62154
-328
-11010
1363
92132
-48500
-55
******
33218
96031
Hexadecimal
----------18600C
00093B
53A54C
86399C
24215F
08351C
19003C
31285D
88316C
01860C
29285D
621540
00328D
11010D
01363F
92132C
48500D
00055D
400F3C
33218C
96031C
Associated Field
-------------------Wagar
Gellai
Giulianelli
Mehta
Johnson
Packer
Childers
Burg
Monkman
Vezinaw
Mead
Wu
Madrid
Warren
Burt
Mao
Shen
Yamamoto-Smith
Yaeger
Leung
Kaspar
PDREPORT can be used in conjunction with the ICE618A and ICE649A messages
to identify that:
v Record 3 has an invalid digit of A and an associated field of Giulianelli
v Record 12 has an invalid sign of 0 and an associated field of Wu
v Record 19 has an invalid digit of F and an associated field of Yaeger.
Example 10:
COPY FROM(IN) USING(OUTF)
DISPLAY FROM(TEMP) LIST(EMPCT) BLANK TITLE(Employees by Function) DATE HEADER(Function) HEADER(Employees) ON(1,25,CH)
ON(30,4,ZD)
This example shows how the OUTFIL table lookup feature can be used to
substitute meaningful phrases for cryptic values in ICETOOL reports. Assume that:
v The OUTFCNTL data set contains:
636
DISPLAY Operator
OUTFIL FNAMES=TEMP,
OUTREC=(1:9,2,CHANGE=(25,
CMN,CManufacturing,
CRD,CResearch and Development,
CFN,CFinance,
CMR,CMarketing,
CIS,CInformation Systems),
30:4,4)
The COPY operator uses the OUTFIL statement in OUTFCNTL to reformat the IN
data set records to the TEMP (temporary) data set. Two fields are extracted for use
by the DISPLAY operator:
v The 2-character department code in positions 9-10 is changed to a 25-character
name in positions 1-25 using the table lookup feature.
v The zoned decimal value in positions 4-7 is moved to positions 30-33.
The DISPLAY operator uses the reformatted fields in the TEMP data set to print, in
the EMPCT data set:
v A title line containing the specified title and the date
v A heading line containing the specified underlined headings
v Data lines in the BLANK format containing:
The names from positions 1-25 that were substituted for the department codes
The zoned decimal values from positions 30-33.
The EMPCT output starts on a new page and looks as follows:
Employees by Function
Function
------------------------Manufacturing
Marketing
Research and Development
Information Systems
Finance
02/14/05
Employees
--------486
21
55
123
33
Example 11:
DISPLAY FROM(ACCTS) LIST(PLAIN) TITLE(Accounts Report for First Quarter) DATE(MD4/) BLANK HEADER(Amount) ON(12,6,ZD) HEADER(Id) ON(NUM) HEADER(Acct#) ON(31,3,PD) HEADER(Date) ON(1,4,ZD) TOTAL(Total for Q1) AVERAGE(Average for Q1)
DISPLAY FROM(ACCTS) LIST(FANCY) TITLE(Accounts Report for First Quarter) DATE(MD4/) BLANK HEADER(Amount) ON(12,6,ZD,C1,N08) HEADER(Id) ON(NUM,N02) HEADER(Acct#) ON(31,3,PD,NOST,LZ) HEADER(Date) ON(1,4,ZD,E99/99,NOST) INDENT(2) BETWEEN(5) STATLEFT TOTAL(Total for Q1) AVERAGE(Average for Q1)
637
DISPLAY Operator
This example shows some options you can use to improve the appearance of a
DISPLAY report. The first DISPLAY operator produces a "plain" report, and the
second DISPLAY operator uses the options shown in bold to produce a "fancy"
report.
The PLAIN output starts on a new page and looks as follows:
Accounts Report for First Quarter
Amount
--------------93271
137622
83147
183261
76389
920013
Id
--------------1
2
3
4
5
6
05/04/2001
Acct#
------------------15932
187
15932
2158
187
15932
Date
-------------------106
128
212
217
305
319
Total for Q1
1493703
50328
1287
Average for Q1
248950
8388
214
05/04/2001
Id
--1
2
3
4
5
6
Acct#
-----15932
00187
15932
02158
00187
15932
Date
----01/06
01/28
02/12
02/17
03/05
03/19
14,937.03
2,489.50
Here is an explanation of the extra options used for the "fancy" report:
v First ON field: In the PLAIN report, BLANK causes ICETOOL to print the 6-byte
ZD values as unedited digits with leading zeros suppressed. But for this
example, we know the digits really represent dollars and cents. So in the FANCY
report, we use the C1 formatting item (one of thirty-three available masks) to
print the values with a comma (,) as the thousands separator and a period (.) as
the decimal point.
In the PLAIN report, TOTAL causes ICETOOL to allow 15 digits for the values
because it does not know how many digits are needed. But for this example, we
know the total amount will not exceed 8 digits. So in the FANCY report, we use
the N08 formatting item to set the number of digits to 8. This decreases the
column width for the field.
v Second ON field: In the PLAIN report, NUM causes ICETOOL to allow 15 digits
for the record number because it does not know how many digits are needed.
But for this example, we know the number of records will not exceed 99. So in
the FANCY report, we use the N02 formatting item to set the number of digits
to 2. This decreases the column width for the record number.
v Third ON field: In the PLAIN report, TOTAL and AVERAGE cause ICETOOL to
print the total and average for this 3-byte PD field. But for this example, we
638
DISPLAY Operator
know we do not want statistics for the field because it is an account number. So
in the FANCY report, we use the NOST formatting item to suppress the
statistics for this field.
In the PLAIN report, the default mask of A0 causes ICETOOL to suppress
leading zeros for this 3-byte PD field. But for this example, we know that we
want to show leading zeros for the field because it is an account number. So in
the FANCY report, we use the LZ formatting item to print leading zeros for this
field.
v Fourth ON field: In the PLAIN report, BLANK causes ICETOOL to print the
4-byte ZD values as unedited digits with leading zeros suppressed. But for this
example, we know the digits represent a date (month and day). So in the
FANCY report, we use the E'99/99' formatting item to print the values with
leading zeros and a slash (/) between the month and day.
In the PLAIN report, TOTAL and AVERAGE cause ICETOOL to print the total
and average for this 4-byte ZD field. But for this example, we know we do not
want the total or average for this field because it is a date. So in the FANCY
report, we use the NOST formatting item to suppress the statistics for this field.
Note: In some applications, we might want the minimum and maximum for a
date displayed with E'pattern', so we would not specify NOST for the date field.
v INDENT: In the PLAIN report, ICETOOL starts the report in column 2 (after the
control character), by default. But for this example, we want to indent the report
a bit. So in the FANCY report, we use the INDENT(2) operand to indent the
report by 2 blanks so it starts in column 4.
v BETWEEN: In the PLAIN report, ICETOOL uses 3 blanks between the columns
of data, by default. But for this example, we want more space between the
columns. So in the FANCY report, we use the BETWEEN(5) operand to insert 5
blanks between the columns.
v STATLEFT: In the PLAIN report, ICETOOL prints the strings for TOTAL and
AVERAGE under the first column of data, by default, and uses two lines for
each statistic to avoid having the string overlay the value. But for this example,
we would like to have the TOTAL and AVERAGE strings stand out in the report
and also have each string on the same line as its value. So in the FANCY report,
we use the STATLEFT operand to print the TOTAL and AVERAGE strings to the
left of the first column of data.
Example 12:
SORT FROM(RAWSMF) TO(SMF14) USING(SMFI)
DISPLAY FROM(SMF14) LIST(SMF14RPT) TITLE(SMF Type-14 Records) DATE(4MD/) HEADER(Date) ON(11,4,DT1,E9999/99/99) HEADER(Time) ON(7,4,TM1,E99:99:99) HEADER(Sys) ON(15,4,CH) HEADER(Jobname) ON(19,8,CH) HEADER(Datasetname) ON(69,44,CH)
This example shows how SMF date and time values can be displayed in a
meaningful way in a report on SMF type-14 records.
The SORT operator selects the type-14 records from the RAWSMF data set and
sorts them by date and time to the SMF14 data set. It uses the following control
statements in SMFICNTL:
INCLUDE COND=(6,1,BI,EQ,14)
SORT FIELDS=(11,4,PD,A,7,4,BI,A)
639
DISPLAY Operator
The DISPLAY operator uses the selected type-14 records in SMF14 to print, in the
SMF14RPT data set:
v A title line containing the specified title and the date
v A heading line containing the specified underlined headings
v Data lines containing:
The SMF date values in positions 11-14 displayed as C'yyyy/mm/dd'
The SMF time values in positions 7-10 displayed as C'hh:mm:ss'
The character values in positions 15-18
The character values in positions 19-26
The character values in positions 69-112
The SMF14RPT output starts on a new page and looks as follows:
SMF Type-14 Records
Date
---------2001/04/20
2001/04/20
2001/04/21
2001/04/21
2001/04/24
2001/04/24
Time
-------06:03:15
10:03:22
14:05:37
22:11:00
00:00:08
Sys
---ID03
ID02
ID03
ID03
ID03
Jobname
-------JOB00003
JOB00002
JOB00004
JOB00005
JOB00006
Datasetname
----------- ...
SYS1.QRS
SYS1.XYZ
SYS1.MNO
SYS1.MNO
SYS1.MNO
Note: When you use SMF date formats (DTn) or SMF time formats (TMn), the
SMF values are treated as numeric. This allows you to use numeric formatting
items such as masks and patterns to edit the SMF values. By default, DTn and
TMn headings, like other numeric headings, appear right-aligned as shown in the
SMF14RPT output example shown previously in this section. If you want to
center-align or left-align headings for numeric values, you can add an appropriate
number of blanks at the end of HEADER('string1').
For example, if you wanted to left-align the SMF date heading, you could use six
blanks at the end of the header string like so:
HEADER(Date
If you wanted to center-align the SMF date heading, you could use three blanks at
the end of the header string like so:
HEADER(Date
Example 13:
SORT FROM(SMFIN) TO(SMF71) USING(TY71)
DISPLAY FROM(SMF71) LIST(SMF71RPT) TITLE(Low impact central storage frames) BREAK(15,4,CH,LSystem: ) HEADER(Date) ON(11,4,DT1,E9999-99-99) HEADER(Time) ON(7,4,TM1,E99:99:99) -
640
DISPLAY Operator
HEADER(Min Frames) ON(925,8,FL,U10) HEADER(Max Frames) ON(933,8,FL,U10) HEADER(Avg Frames) ON(941,8,FL,U10) BLANK PAGE
This example shows how floating point values can be displayed as integers in a
report on SMF type-71 records with a section for each system id.
The SORT operator selects SMF type-71 records that are at least 19 bytes long and
sorts them by system id, date and time to the SMF71 data set. It uses the following
control statements in TY71CNTL:
OMIT COND=(6,1,BI,NE,+71,OR,1,2,BI,LE,+18)
SORT FIELDS=(15,4,CH,A,11,4,PD,A,7,4,BI,A)
The DISPLAY operator uses the selected type-71 records in SMF71 to print, in the
SMF71RPT data set:
v A title line containing the specified title and the page number.
v A break title containing the specified leading string and the SMF71SID system id
character values in positions 15-18.
v A heading line containing the specified underlined headings.
v Data lines containing:
The SMF71DTE date value. This SMF date value in positions 11-14 is
displayed as a C'yyyy-mm-dd' value.
The SMF71TME time value. This SMF time value in positions 7-10 is
displayed as a C'hh:mm:ss' value.
The SMF71CLM minimum number of low-impact central storage frames
value. This floating-point value in positions 925-932 is displayed as a 10 digit
integer value. (The U10 formatting item reduces the number of digits for the
integer representation of the floating-point value from 20 to 10, decreasing the
column width for the field.)
The SMF71CLX maximum number of low-impact central storage frames
value. This floating-point value in positions 933-940 is displayed as a 10 digit
integer value.
The SMF71CLA average number of low-impact central storage frames value.
This floating-point value in positions 941-948 is displayed as a 10 digit integer
value.
Each system id value starts on a new page and looks as follows (several sections
and records are shown with illustrative values):
Low impact central storage frames
- 1 -
System: SYSA
Date
---------2005-08-01
2005-08-01
2005-08-01
Time
-------11:45:00
12:00:00
12:15:00
Min Frames
----------934215
971599
970192
Max Frames
----------1001596
1004939
982565
Avg Frames
----------963434
984437
973768
- 2 -
System: SYSB
Date
----------
Time
--------
Min Frames
-----------
Max Frames
-----------
Avg Frames
-----------
641
DISPLAY Operator
2005-08-01
2005-08-01
2005-08-01
11:45:00
12:00:00
12:15:00
947220
980120
980387
985444
1018982
1051920
966581
986360
1011873
MERGE operator
,
,
MERGE
FROM
( indd
USING(xxxx)
,
TO
outdd
)
VSAMTYPE(x)
LOCALE(name)
LOCALE(CURRENT)
LOCALE(NONE)
SERIAL
Merges up to 50 input data sets to an output data set. The records in each input
data set to be merged must already be in sorted order as specified by the control
fields in a supplied DFSORT MERGE statement.
You must specify at least one FROM operand and a USING(xxxx) operand. Each
FROM operand can be used to specify one or more ddnames. You can specify up
to 10 FROM operands. The maximum number of ddnames in all of the FROM
operands must not exceed 50.
DFSORT is called to merge the indd data sets to the outdd data sets using the
DFSORT control statements in xxxxCNTL. You must supply a DFSORT MERGE
statement in the xxxxCNTL data set to indicate the control fields for the merge.
You can use additional DFSORT statements in the xxxxCNTL data set to merge a
subset of the input records (INCLUDE or OMIT statement; OUTFIL INCLUDE,
OMIT, SAVE, STARTREC, ENDREC, SAMPLE, SPLIT, SPLITBY and SPLIT1R
operands), reformat records for output (INREC, OUTREC, and OUTFIL statements;
user exit routines), and so on.
If EQUALS is in effect, records that collate identically are output in the order of
their ddnames in the FROM operands.
The active locale's collating rules affect MERGE processing as explained in
MERGE control statement on page 162. If an INCLUDE or OMIT statement or an
OUTFIL INCLUDE or OMIT operand is specified in the xxxxCNTL data set, the
active locale's collating rules affect INCLUDE and OMIT processing as explained in
the "Cultural Environment Considerations" discussion in INCLUDE control
statement on page 96.
Note: For a merge application, records deleted during an E35 exit routine are not
sequence checked. If you use an E35 exit routine without an output data set,
sequence checking is not performed at the time the records are passed to the E35
user exit; therefore, you must ensure that input records are in correct sequence.
642
Operand Descriptions
Operand descriptions
The operands described in this section can be specified in any order:
FROM(indd,...)
Specifies the ddnames of the input data sets to be read by DFSORT for this
operation. Up to 10 FROM operands can be used to specify up to 50 input
ddnames. An indd DD statement must be present for each indd name
specified. Each indd input data set must conform to the rules for DFSORT's
SORTINnn data sets.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
An xxxxCNTL DD statement must be present, and the control statements in it
must conform to the rules for DFSORT's SORTCNTL data set.
The xxxxCNTL data set must contain a MERGE statement. If TO is not
specified, the xxxxCNTL data set must also contain either one or more OUTFIL
statements or a MODS statement for an E35 routine that disposes of all
records. Other statements are optional.
TO(outdd,...)
Specifies the ddnames of the output data sets to be written by DFSORT for this
operation. From 1 to 10 outdd names can be specified. An outdd DD statement
must be present for each outdd name specified. If a single outdd data set is
specified, DFSORT is called once to merge the indd data sets to the outdd data
set using SORTOUT processing; the outdd data set must conform to the rules
for DFSORT's SORTOUT data set. If multiple outdd data sets are specified and
SERIAL is not specified, DFSORT is called once to merge the indd data sets to
the outdd data sets using OUTFIL processing; the outdd data sets must
conform to the rules for DFSORT's OUTFIL data sets.
A ddname specified in a FROM operand must not also be specified in the TO
operand.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(name)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(CURRENT)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(NONE)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
SERIAL
Specifies that OUTFIL processing is not to be used when multiple outdd data
sets are specified. DFSORT is called multiple times and uses SORTOUT
processing; the outdd data sets must conform to the rules for DFSORT's
SORTOUT data set. SERIAL is not recommended because the use of serial
processing (that is, multiple calls to DFSORT) instead of OUTFIL processing
can degrade performance and imposes certain restrictions as detailed later in
this section. SERIAL is ignored if a single outdd data set is specified.
Chapter 7. Using ICETOOL
643
Operand Descriptions
DFSORT is called to merge the indd data set to the first outdd data set using
the DFSORT control statements in the xxxxCNTL data set. If the merge
operation is successful, DFSORT is called as many times as necessary to copy
the first outdd data set to the second and subsequent outdd data sets.
Therefore, for maximum efficiency, use a disk data set as the first in a list of
outdd data sets on both disk and tape. If more than one outdd data set is
specified, DFSORT must be able to read the first outdd data set after it is
written in order to copy it to the other outdd data sets. Do not use a SYSOUT
or DUMMY data set as the first in a list of outdd data sets because:
v If the first data set is SYSOUT, DFSORT abends when it tries to copy the
SYSOUT data set to the second outdd data set.
v If the first data set is DUMMY, DFSORT copies the empty DUMMY data set
to the other outdd data sets (that is, all of the resulting outdd data sets are
empty).
MERGE examples
Although the MERGE operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
Example 1
//TOOLIN DD *
MERGE FROM(IN01,IN02,IN03,IN04,IN05) TO(OUTPUT) USING(MERG)
//MERGCNTL DD *
OPTION EQUALS
MERGE FIELDS=(21,4,CH,A)
/*
This example merges 5 input files to an output file. EQUALS is used to ensure that
records that collate identically are output in the order specified in the FROM
operand. For example, if IN01, IN03 and IN05 all have records with a key or
'AAAA' in positions 21-24, the output will contain the 'AAAA' record from IN01,
the 'AAAA' record from IN03 and the 'AAAA' record from IN05, in that order.
Example 2
//TOOLIN DD *
MERGE FROM(INPUT1,INPUT2,INPUT3,INPUT4) FROM(INPUT5,INPUT6,INPUT7) VSAMTYPE(F) USING(MRG1)
//MRG1CNTL DD *
MERGE FIELDS=(52,8,UFF,D)
OUTFIL FNAMES=OUT1,INCLUDE=(15,3,SS,EQ,CD21,D33)
OUTFIL FNAMES=OUT2,SAVE
/*
This example merges 7 input files to 2 output files. It uses two OUTFIL statements
to create the two output files; each output file will have a different subset of the
merged records. VSAMTYPE(F) tells DFSORT the record type is F (only needed for
VSAM input files).
MODE operator
MODE
644
STOP
CONTINUE
SCAN
MODE Operator
Specifies one of three modes to control error checking and actions after error
detection. A MODE operator effects the processing (that is, error checking of
ICETOOL statements and calling DFSORT) of the operators that follow it, up to the
next MODE operator (if any). MODE operators allow you to do the following for
groups of operators or all operators:
1. Stop or continue processing operators after a return code of 8, 12 or 16. A
return code of 12 or 16 can be set as the result of a statement or run-time error
detected by ICETOOL or DFSORT. A return code of 8 can be set as the result of
a COUNT operator with RC8.
2. Check for errors in ICETOOL statements, but do not call DFSORT.
Operand descriptions
The operands described in this section can be specified in any order.
STOP
Stops subsequent operations if a return code of 8, 12 or 16 is set. If an error is
detected for an operator, SCAN mode is automatically set in effect; DFSORT is
not called for subsequent operators, although checking ICETOOL statements
for errors continues.
STOP mode can be used to group dependent operators (that is, if an operation
fails, do not process the remaining operators).
STOP MODE is set in effect automatically at the start of the ICETOOL run.
CONTINUE
Continues with subsequent operations regardless of whether or not a return
code of 8, 12 or 16 is set. If an operator results in an error, processing continues
for subsequent operators.
CONTINUE mode can be used to group independent operators (that is,
process each operator regardless of the success or failure of the others).
SCAN
ICETOOL statements are checked for errors, but DFSORT is not called.
SCAN mode can be used to test ICETOOL statements for errors.
Note: SCAN mode is set automatically if an error is detected while in STOP
mode.
MODE example
MODE SCAN
RANGE ...
UNIQUE ...
MODE STOP
VERIFY ...
DISPLAY ...
MODE CONTINUE
COPY ...
SORT ...
STATS ...
SCAN mode: RANGE and UNIQUE are checked for statement errors, but DFSORT
is not called.
STOP mode: DISPLAY is dependent on VERIFY. If the return code for VERIFY is
12 or 16, SCAN mode is entered; DISPLAY is checked for statement errors, but
DFSORT is not called.
Chapter 7. Using ICETOOL
645
MODE Operator
CONTINUE mode: COPY, SORT, and STATS are independent of each other. SORT
is processed even if the return code for COPY is 12 or 16. STATS is processed even
if the return code for COPY or SORT is 12 or 16.
Note that the return codes for one group of operators does not affect the other
groups of operators.
OCCUR operator
FROM(indd)
OCCUR
OCCURS
ON(p,m,f)
ON(p,m,f,formatting)
ON(p,m,HEX)
ON(VLEN)
ON(VLEN,formatting)
ON(VALCNT)
ON(VALCNT,formatting)
TITLE('string1')
TITLE('string1','string2')
TITLE('string1','string2','string3')
LIST(listdd)
TLEFT
TFIRST
PAGE
DATE
DATE(abcd)
DATENS(abc)
YDDD(abc)
YDDDNS(ab)
TIME
TIME(abc)
TIMENS(ab)
BLANK
PLUS
NOCC
HEADER('string1')
HEADER('string1','string2')
HEADER('string1','string2','string3')
HEADER(NONE)
NOHEADER
LINES(n)
INDENT(n)
BETWEEN(n)
ALLDUPS
NODUPS
HIGHER(x)
LOWER(y)
EQUAL(v)
VSAMTYPE(x)
WIDTH(n)
LONGLINE
UZERO
646
TBETWEEN(n)
LISTSDB
LISTNOSDB
OCCUR Operator
Prints each unique value for specified numeric fields (including SMF, TOD, and
ETOD date and time) or character fields, and how many times it occurs, in a
separate list data set. Simple or tailored reports can be produced. The values
printed can be limited to those for which the value count meets specified criteria.
From 1 to 10 fields can be specified, but the resulting list data set line length must
not exceed the limit specified by the WIDTH operand or 8192 bytes if LONGLINE
is specified and WIDTH is not specified, or 2048 bytes if LONGLINE and WIDTH
are not specified. At least one ON(VLEN) or ON(p,m,f) field must be specified; all
such ON fields specified are used to determine whether a record contains a unique
value. A single list data set record is printed for each unique value. If
ON(VALCNT) is specified, the "value count" (that is, the number of times the ON
values occur) is printed in the list data set record along with the other ON values.
Specifying formatting items or the PLUS or BLANK operand, which can
"compress" the columns of output data, can enable you to include more fields in
your report, up to a maximum of 10, if your line length is limited by the
character width your printer or display supports.
ALLDUPS, NODUPS, HIGHER(x), LOWER(y) or EQUAL(v) can be specified to
limit the ON values printed to those for which the value count meets the specified
criteria (for example, ALLDUPS for duplicate values only). The default criteria is
HIGHER(0) resulting in the ON values being printed for each unique value.
DFSORT is called to sort the indd data set to ICETOOL's E35 user exit. ICETOOL
uses its E35 exit to print appropriate titles, headings and data in the list data set.
You must not supply your own DFSORT MODS, INREC, OUTREC, SUM, or
RECORD statement, because they override the DFSORT statements passed by
ICETOOL for this operator.
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for an OCCUR operator, you can take one of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(,8)
Simple report
You can produce a simple report by specifying just the required operands. For
example, if you specify FROM and LIST operands, and ON operands for 10-byte
character and 7-byte zoned decimal fields and the value count, the output in the
list data set can be represented as follows:
647
OCCUR Operator
(p,m,f)
characters
.
.
.
(p,m,f)
sddddddddddddddd
.
.
.
VALUE COUNT
ddddddddddddddd
.
.
.
A control character occupies the first byte of each list data set record. Left-justified
standard headings are printed at the top of each page to indicate the contents of
each column, followed by a line for each record showing the characters and
numbers in the fields of that record, and the count of occurrences (value count) of
the specified values.
The fields are printed in columns in the same order in which they are specified in
the OCCUR statement. All fields are left-justified. For numeric fields, leading zeros
are printed, a - is used for the minus sign, and a + is used for the plus sign. For
the value count, leading zeros are printed.
By default, the first column of data starts immediately after the control character,
and three blanks appear between columns. The NOCC operand can be used to
suppress the control character. The INDENT operand can be used to change the
number of blanks before the first column of data. The BETWEEN operand can be
used to change the number of blanks between columns.
The standard column widths are as follows:
v Character data: the length of the character field or 20 bytes if the field length is
less than 21 bytes
v Numeric data: 16 bytes, or 32 bytes if the numeric field is BI or FI with a length
greater than 4, PD with a length greater than 8, or ZD, CSF, FS, UFF or SFF with
a length greater than 15.
v Value count: 15 bytes
HEADER operands can be used to change or suppress the headings. PLUS or
BLANK operands can be used to change the format of numeric fields. PLUS,
BLANK and HEADER operands can be used to change the width of the columns
for numeric and character fields and the justification of headings and fields.
The NOHEADER operand can be used to create list data sets containing only data
records. Data sets created in this way can be processed further by other operators
(for example, STATS or UNIQUE) using CH format for character values or FS
format for numeric values (including the value count).
Tailored report
You can tailor the output in the list data set using various operands that control
title strings, date, time, page number, headings, lines per page and field formats.
The optional operands can be used in many different combinations to produce a
wide variety of report formats. For example, if you specify FROM, LIST, BLANK,
TITLE, PAGE, DATE, TIME, and HEADER operands, and ON operands for 10-byte
character and 7-byte zoned decimal fields and the value count, the output in the
list data set looks as follows:
648
OCCUR Operator
title
- p -
header
---------characters
.
.
.
header
-------sd
.
.
.
mm/dd/yy
hh:mm:ss
header
-------------d
.
.
.
By default, a control character occupies the first byte of each list data set record.
The NOCC operand can be used to suppress the control characters. The title lines
(up to 3) are printed at the top of each page of the list data set. The first title line
contains the elements you specify (title strings,page number, date and time) in the
order in which you specify them. The second and third title lines contain the title
strings you specify. By default, eight blanks appear between title elements, the title
strings are centered with respect to each other, and the title lines appear on every
page. The TBETWEEN(n) operand can be used to change the number of blanks
between title elements. The TLEFT operand can be used to left-justify the title
strings with respect to each other. The TFIRST operand can be used to only print
the title lines on the first page. A blank line is printed after each title line.
Your specified headings (underlined) are printed after the title line on each page to
indicate the contents of each column, followed by a line for each record showing
the characters and numbers in the fields of that record. Your specified headings
can be one, two or three lines. Headings for character fields are left-justified and
headings for numeric fields are right-justified.
The fields are printed in columns in the same order in which they are specified in
the OCCUR statement. Character fields are left-justified and numeric fields are
right justified. For numeric fields, leading zeros are suppressed, a - is used for the
minus sign, and a blank is used for the plus sign (you can specify PLUS rather
than BLANK if you want a + to be used for the plus sign). For the value count,
leading zeros are suppressed.
Formatting items can be used to change the appearance of individual numeric
fields in the report with respect to separators, number of digits, decimal point,
decimal places, signs, leading zeros, leading strings, floating strings, and trailing
strings. Formatting items can also be used to insert leading or trailing strings for
character fields.
The column widths are dynamically adjusted according to the length of the
headings and the maximum number of bytes needed for the character or numeric
data.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used for this operation. '(p,m,f)' is used for the standard column heading (see
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), HEADER(NONE), and NOHEADER for
alternative heading options).
Chapter 7. Using ICETOOL
649
OCCUR Operator
By default, three blanks appear between columns. You can change the space
between columns with BETWEEN(n).
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3 4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as follows:
650
Format Code
Length
Description
BI
1 to 8 bytes
Unsigned binary
FI
1 to 8 bytes
Signed fixed-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
CH
1 to 4000 bytes
Character
CSF or FS
UFF
SFF
DT1
4 bytes
DT2
4 bytes
DT3
4 bytes
DC1
8 bytes
DC2
8 bytes
DC3
8 bytes
DE1
8 bytes
DE2
8 bytes
DE3
8 bytes
TM1
4 bytes
TM2
4 bytes
TM3
4 bytes
TM4
4 bytes
OCCUR Operator
Format Code
Length
Description
TC1
8 bytes
TC2
8 bytes
TC3
8 bytes
TC4
8 bytes
TE1
8 bytes
TE2
8 bytes
TE3
8 bytes
TE4
8 bytes
651
OCCUR Operator
ON(p,m,f,formatting)
Specifies the position, length and format of a numeric or character field to be
used for this operation and how the data for this field is to be formatted for
printing. The BLANK operand is automatically in effect.
See ON(p,m,f) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
Udd
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once. Any formatting item can be specified for a
numeric field, but only L'string' and T'string' can be specified for a character
field.
The column width is dynamically adjusted to accommodate the maximum
bytes to be inserted as a result of all formatting items specified.
mask
See the discussion of mask under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
E'pattern'
See the discussion of E'pattern' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
L'string'
See the discussion of L'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
F'string'
See the discussion of F'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
T'string'
See the discussion of T'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
LZ See the discussion of LZ under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
Ndd or Udd
specifies the number of digits to be used for the numeric field. Ndd or
Udd can be used to change the column width for numeric fields. dd
specifies the number of digits and must be a two-digit number between 01
and 31.
The default number of digits (d) for a numeric field is the maximum
number of digits for that field. For example, d is 5 for ON(1,5,ZD). If you
know that your numeric field requires less than d digits, you can use a
lower number of digits (dd) instead by specifying Udd, thus reducing the
652
OCCUR Operator
column width if it is determined by d. For example, ON(1,5,ZD,U03)
reduces d from 5 to 3. If you want your numeric field to be displayed with
more than d digits, you can use a higher number of digits (dd) instead by
specifying Ndd or Udd, thus increasing the column width if it is
determined by d. For example, ON(1,5,ZD,U10) increases d from 5 to 10.
Either Ndd or Udd can be used to set d greater than the maximum for a
numeric field, but only Udd can be used to set d less than the maximum
for a numeric field.
For Udd:
dd is used for d. For example:
v If ON(1,5,ZD) is specified, 5 digits (default for 5,ZD) are used.
v If ON(1,5,ZD,U10) is specified, 10 digits (from U10) are used.
v If ON(1,5,ZD,U03) is specified, 3 digits (from U03) are used.
v If ON(1,16,FS) is specified, 16 digits (default for 16,FS) are used.
v If ON(1,16,FS,U16) is specified, 16 digits (from U16) are used.
v If ON(1,16,FS,U15) is specified, 15 digits (from U15) are used.
If you use Udd and a numeric value overflows dd digits, ICETOOL
terminates the operation. You can prevent the overflow by specifying an
appropriately higher dd value for Udd. For example, if ON(1,12,ZD,U09)
results in overflow, you can use ON(1,12,ZD,U10) instead.
If E'pattern' is specified, Udd is ignored, because the number of digits is
determined from the pattern.
For Ndd:
If dd is greater than or equal to d, dd is used. If dd is less than d, d is
used. For example:
v If ON(1,5,ZD) is specified, 5 digits (default for 5,ZD) are used.
v If ON(1,5,ZD,N10) is specified, 10 digits (from N10) are used.
v If ON(1,5,ZD,N03) is specified, 5 digits (from 5,ZD) are used.
If E'pattern' is specified, Ndd is ignored, because d is determined from the
pattern.
ON(p,m,HEX)
Specifies the position and length of a character field to be used for this
operation and printed in hexadecimal format (00-FF for each byte). '(p,m,HEX)'
is used for the standard column heading (see HEADER('string1'),
HEADER('string1','string2'), HEADER('string1','string2','string3'),
HEADER(NONE), and NOHEADER for alternative heading options).
See ON(p,m,f) for a discussion of p.
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. A field can be 1 to 2000 bytes.
ON(VLEN)
Equivalent to specifying ON(1,2,BI); a two-byte binary field starting at position
1. For variable-length records, ON(VLEN) represents the record-length for each
record. 'RECORD LENGTH' is used for the standard column heading. See
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), HEADER(NONE), and NOHEADER for
alternative heading options.
653
OCCUR Operator
ON(VLEN,formatting)
Equivalent to specifying ON(1,2,BI,formatting); a two-byte binary field starting
at position 1, and how the data for this field is to be formatted for printing.
The BLANK operand is automatically in effect.
See ON(VLEN) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
Udd
specifies formatting items that indicate how the data for this field is to be
formatted for printing. Formatting items can be specified in any order, but each
item can only be specified once.
The column width is dynamically adjusted to accommodate the maximum
bytes to be inserted as a result of all formatting items specified.
mask
See the discussion of mask under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
E'pattern'
See the discussion of E'pattern' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
L'string'
See the discussion of L'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
F'string'
See the discussion of F'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
T'string'
See the discussion of T'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
LZ See the discussion of LZ under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
Ndd or Udd
See the discussion of Ndd or Udd under ON(p,m,f,formatting) in OCCUR
operator on page 646.
ON(VALCNT)
Specifies that the number of occurrences for each unique value is to be printed.
' VALUE COUNT' is used for the standard column heading (see
HEADER('string1'), HEADER('string1','string2'),
HEADER('string1','string2','string3'), HEADER(NONE) and NOHEADER for
alternative heading options).
654
OCCUR Operator
ON(VALCNT,formatting)
Specifies that the number of occurrences for each unique value is to be printed,
and how the value count is to be formatted for printing. The BLANK operand
is automatically in effect.
See ON(VALCNT) for further details.
formatting
,
mask
E'pattern'
L'string'
F'string'
T'string'
LZ
Ndd
Udd
specifies formatting items that indicate how the value count is to be formatted
for printing. Formatting items can be specified in any order, but each item can
only be specified once.
The column width is dynamically adjusted to accommodate the maximum
bytes to be inserted as a result of all formatting items specified.
mask
See the discussion of mask under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
E'pattern'
specifies an edit pattern to be applied to the value count. The pattern (1 to
24 characters) must be enclosed in single apostrophes. Each 9 in the pattern
(up to 15) is replaced by a corresponding digit from the numeric value.
Characters other than 9 in the pattern appear as specified. To include a
single apostrophe (') in the pattern, specify two single apostrophes ('').
F'string' or a mask cannot be specified with E'pattern'.
When E'pattern' is specified for the value count:
v If the number of significant digits in a value count is less than the
number of 9's in the pattern, 0's are filled in on the left. For example,
1234 is shown as 001234 with ON(VALCNT,E'999999').
v If the number of significant digits in a value count is greater than the
number of 9's in the pattern, digits are truncated from the left. For
example, 1234567 is shown as *4567* with ON(VALCNT,E'*9999*').
L'string'
See the discussion of L'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
F'string'
See the discussion of F'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
T'string'
See the discussion of T'string' under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
655
OCCUR Operator
LZ See the discussion of LZ under ON(p,m,f,formatting) in DISPLAY
operator on page 594.
Ndd or Udd
Specifies the number of digits to be used for the value count when
determining the column width. dd specifies the number of digits and must
be a two-digit number between 01 and 15.
The default number of digits (d) for the value count is 15. If you know that
your value counts require less than 15 digits, you can use a lower number
of digits (dd) instead by specifying Ndd or Udd, thus reducing the column
width if it is determined by d. For example, if ON(VALCNT,N06) or
ON(VALCNT,U06) is specified, 6 digits (from N06 or U06) is used instead
of 15 (default for value count).
If you use Ndd or Udd and a value count overflows the number of digits
used, ICETOOL terminates the operation. You can prevent the overflow by
specifying an appropriately higher dd value for Ndd or Udd. For example,
if ON(VALCNT,N05) results in overflow, you can use ON(VALCNT,N06)
instead.
If E'pattern' is specified, Ndd or Udd is ignored, because d is determined
from the pattern.
LIST(listdd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TITLE('string')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TITLE('string1','string2')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TITLE('string1','string2','string3')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TLEFT
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TFIRST
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
PAGE
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
DATE
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
DATE(abcd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
DATENS(abc)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
656
OCCUR Operator
YDDD(abc)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
YDDDNS(ab)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TIME
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TIME(abc)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TIMENS(ab)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
BLANK
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
PLUS
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
For ON(VALCNT), PLUS is treated as BLANK.
NOCC
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
HEADER('string1')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
HEADER('string1','string2')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
HEADER('string1','string2','string3')
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
HEADER(NONE)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
NOHEADER
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
LINES(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
INDENT(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
657
OCCUR Operator
BETWEEN(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
TBETWEEN(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ALLDUPS
Limits the ON values printed to those that occur more than once (that is, those
with duplicate field values). The ON values are printed when value count > 1.
ALLDUPS is equivalent to HIGHER(1).
NODUPS
Limits the ON values printed to those that occur only once (that is, those with
no duplicate field values). The ON values are printed when value count = 1.
NODUPS is equivalent to EQUAL(1) or LOWER(2).
HIGHER(x)
Limits the ON values printed to those that occur more than x times. The ON
values are printed when value count > x.
x must be specified as n or +n where n can be 1 to 15 decimal digits.
LOWER(y)
Limits the ON values printed to those that occur less than y times. The ON
values are printed when value count < y.
y must be specified as n or +n where n can be 1 to 15 decimal digits.
EQUAL(v)
Limits the ON values printed to those that occur v times. The ON values are
printed when value count = v.
v must be specified as n or +n where n can be 1 to 15 decimal digits.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
WIDTH(n)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
LONGLINE
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
UZERO
Specifies that -0 and +0 are to be treated as unsigned zero values, that is, as the
same value. With UZERO, -0 and +0 are treated as positive for ON processing.
UZERO overrides the default of treating -0 and +0 as signed zero values, that
is, as different values. Without UZERO, -0 is treated as negative and +0 is
treated as positive for ON processing.
LISTSDB or LISTNOSDB
See the discussion of these operands on the DISPLAY statement in DISPLAY
operator on page 594.
658
OCCUR Operator
OCCUR examples
Although the OCCUR operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity. See DISPLAY operator on page 594 for additional examples of
tailoring the report format.
Example 1
OCCUR FROM(SOURCE) LIST(VOLSERS) ON(40,6,CH) ON(VALCNT)
VALUE COUNT
000000000000025
000000000000011
.
.
.
Example 2
OCCUR FROM(IN) LIST(LIST1) TITLE(
3090 Distribution
) PAGE HEADER(Data Centers) ON(VALCNT) HEADER(State) ON(1,16,CH) HEADER(3090s) ON(25,3,PD) BLANK
659
OCCUR Operator
3090 Distribution
Data Centers
--------------12
6
.
.
.
- 1 -
State
---------------Alabama
Alabama
.
.
.
3090s
-----1
2
.
.
.
The title line and underlined heading line appear at the top of each page.
Example 3
OCCUR FROM(FAILURES) LIST(CHECKIT) BLANK HIGHER(4) DATE TITLE(Possible System Intruders on ,System) TITLE(Sysplex, in ,Location) PAGE TBETWEEN(2) HEADER(,Userid) ON(23,8,CH) HEADER(Logon failures,(More than 4)) ON(VALCNT)
Assume that the SYMNAMES data set contains the following symbols:
System,S&SYSNAME
Sysplex,S&SYSPLEX
Location,San Jose
- 1 -
Userid
-------B7234510
D9853267
...
Logon failures
(More than 4)
--------------5
11
The title lines and underlined three-line heading lines appear at the top of each
page.
660
OCCUR Operator
Example 4
OCCUR FROM(VARIN) LIST(ONCE) TITLE(Record lengths that occur only once) TIME(12:) DATE(DMY.) ON(VLEN) NODUPS BLANK
09:52:17 am
21.10.92
RECORD LENGTH
57
61
.
.
.
The title line and heading line appear at the top of each page.
Example 5
OCCUR FROM(BRANCH) LIST(CALLRPT)DATENS(4MD)TITLE(Yearly Branch Phone Call Counts)HEADER(Phone Number) ON(7,10,ZD,E(999)-999-9999)HEADER(Calls) ON(VALCNT,A1,N05)INDENT(5) BETWEEN(10)
661
RANGE Operator
RANGE operator
RANGE FROM(indd)
ON(p,m,f)
ON(VLEN)
HIGHER(x)
LOWER(y)
HIGHER(x) LOWER(y)
EQUAL(v)
NOTEQUAL(w)
VSAMTYPE(x)
Prints a message containing the count of values in a specified range for a specific
numeric field.
DFSORT is called to copy the indd data set to ICETOOL's E35 user exit. ICETOOL
prints a message containing the range count as determined by its E35 user exit.
The range can be specified as higher than x, lower than y, higher than x and lower
than y, equal to v, or not equal to w, where x, y, v, and w are signed or unsigned
decimal values. If the range is specified as higher than x and lower than y, it must
be a valid range (for example, higher than 5 and lower than 6 is not a valid range,
because there is no integer value that satisfies the criteria).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement,
because they would override the DFSORT statements passed by ICETOOL for this
operator.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ON(p,m,f)
Specifies the position, length, and format of the numeric field to be used for
this operation.
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3 4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as follows:
662
Format Code
Length
Description
BI
1 to 8 bytes
Unsigned binary
FI
1 to 8 bytes
Signed fixed-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
RANGE Operator
Format Code
Length
Description
CSF or FS
UFF
SFF
663
RANGE Operator
RANGE example
RANGE FROM(DATA1) ON(VLEN) HIGHER(10)
RANGE FROM(DATA2) ON(31,18,ZD) LOWER(+123456789012345678)
RANGE FROM(DATA3) ON(29001,4,FI) HIGHER(-10000) LOWER(27)
RANGE FROM(DATA2) ON(45,3,PD) EQUAL(-999)
RANGE FROM(DATA3) ON(40,1,BI) NOTEQUAL(199)
The first RANGE operator prints a message containing the count of binary values
from positions 1-2 of the DATA1 data set that are higher than 10.
The second RANGE operator prints a message containing the count of zoned
decimal values from positions 31-48 of the DATA2 data set that are lower than
123456789012345678.
The third RANGE operator prints a message containing the count of fixed-point
values from positions 29 001-29 004 of the DATA3 data set that are higher than -10
000 but lower than 27.
The fourth RANGE operator prints a message containing the count of packed
decimal values from positions 45-47 of the DATA2 data set that are equal to -999.
The fifth RANGE operator prints a message containing the count of binary values
from position 40 of the DATA3 data set that are not equal to 199. This RANGE
operator could be used to count the number of records that do not have 'G' in
position 40, because 199 (X'C7') is the EBCDIC code for 'G'. Alternatively, the
COUNT operator could be used with OMIT COND=(40,1,CH,EQ,C'G').
RESIZE operator
RESIZE FROM(indd) TO(outdd) TOLEN(n)
USING(xxxx)
Produces fixed length output records, with the specified TOLEN length, from fixed
length input records of a different length, as follows:
v If the input length is smaller than the requested TOLEN size, multiple smaller
input records are combined into one larger output record of size TOLEN. If the
combined input records do not completely fill up an output record, the output
record will be padded on the right with blanks. For example, if we have five
input records of 20 bytes and TOLEN is 70, two output records of 70 bytes will
be created. The first output record will have input records 1-3 (60 bytes)
followed by 10 blanks, and the second output record will have input records 4-5
(40 bytes) followed by 30 blanks. Note that the first 10 bytes of input record 4
are not used for the first output record; bytes or words are not "wrapped"
between records.
To illustrate, if the following RESIZE operator was specified:
RESIZE FROM(FB20) TO(FB70) TOLEN(70)
664
RESIZE Operator
<111111111111111111><222222222222222222><333333333333333333>
<444444444444444444><555555555555555555>
v If the input length is larger than the requested TOLEN size, each larger input
record is broken up into multiple smaller output records of size TOLEN. If a
broken up input record does not completely fill up the multiple output records,
the last of the multiple output records will be padded on the right with blanks.
For example, if we have two input records of 50 bytes and TOLEN is 20, six
output records of 20 bytes each will be created. The first two output records will
have bytes 1-20 and 21-40 of the first input record (40 bytes), respectively. The
third output record will have bytes 41-50 of the first input record (10 bytes)
followed by 10 blanks. Likewise, the fourth output record will have bytes 1-20 of
the second input record, the fifth output record will have bytes 21-40 of the
second input record, and the sixth output record will have bytes 41-50 of the
second input record followed by 10 blanks.
To illustrate, if the following RESIZE operator was specified:
RESIZE FROM(F50) TO(F20) TOLEN(20)
You must specify the FROM(indd), TO(outdd) and TOLEN(n) operands. The
FROM data set must be fixed-length (for example, RECFM=FB). The TO data set
must also be fixed-length (unless you use an OUTFIL statement with the FTOV
operand to change the fixed-length resized records to variable-length output
records). If a VSAM input data set is used, it will be treated as TYPE=F
(fixed-length) by default. If you specify a variable-length input data set (or use
TYPE=V for a VSAM input data set), the RESIZE operation will be terminated.
The USING(xxxx) operand is optional; do not supply your own MODS or
OUTREC statement.
DFSORT is called to copy or sort the indd data set, as appropriate, before the
records are resized. ICETOOL uses its E35 exit to create a larger record from
multiple smaller records, or to create multiple smaller records from a larger record.
ICETOOL passes the EQUALS option to DFSORT to ensure that if records are
sorted, duplicate records are kept in their original input order when resized.
If USING(xxxx) is specified, any SORT, INCLUDE, OMIT, INREC, or SUM
statement specified in xxxxCNTL is processed before the records are resized. The
order of the records, and the input length, will be affected by these control
statements. Any OUTFIL statements specified in xxxxCNTL are processed after the
records are resized.
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for a RESIZE operator, you can take one of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(,8)
Chapter 7. Using ICETOOL
665
RESIZE Operator
in the xxxxCNTL data set.
2. Use xxxxWKdd DD statements to override the use of dynamic allocation. Refer
to SORTWKdd DD statement on page 71 for details.
Tape work data sets cannot be used with ICETOOL.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
TO(outdd)
See the discussion of this operand on the DATASORT statement in
DATASORT operator on page 585.
TOLEN(n)
Specifies the record length you want ICETOOL to use for the resized output
records. n can be 1 to 32760. n must not be equal to the input record length.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx. If
USING(xxxx) is specified, an xxxxCNTL DD statement must be present, and
the control statements in it must conform to the rules for DFSORT's
SORTCNTL data set.
RESIZE examples
Although the RESIZE operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
Example 1
RESIZE FROM(IN1) TO(OUT1) TOLEN(40)
This example illustrates how you can create larger records from smaller records.
The IN1 data set has RECFM=FB and LRECL=10 with these 10-byte records:
Bird
Bluejay
4
Charlie
Rodent
Rat
2
Sara
The OUT1 data set has RECFM=FB and LRECL=40 with these 40 byte records:
Bird
Rodent
Bluejay
Rat
4
2
Charlie
Sara
Example 2
RESIZE FROM(OLD) TO(NEW) TOLEN(15) USING(CTL1)
This example illustrates how you can create larger records from a subset of smaller
sorted records.
666
RESIZE Operator
The CTL1CNTL data set contains:
OMIT COND=(2,4,ZD,EQ,0)
SORT FIELDS=(1,1,CH,A)
The OLD data set has RECFM=FB and LRECL=5 with these 5-byte records:
C0005
B0000
A0008
I1234
F0053
D0123
H0001
G0000
E0022
The NEW data set will have RECFM=FB and LRECL=15 with these 15-byte
records:
A0008C0005D0123
E0022F0053H0001
I1234
Note that before the records were resized, the two records with 0 in positions 2-5
were omitted, and the remaining records were sorted as directed by the DFSORT
control statements in CTL1CNTL. The last output record was padded with blanks
on the right to 15 bytes.
Example 3
RESIZE FROM(IN3) TO(OUT3) TOLEN(3) USING(CTL2)
This example illustrates how you can break up large records into multiple smaller
records.
The CTL2CNTL data set contains:
OUTFIL FNAMES=OUT3,OMIT=(1,3,CH,EQ,C ),OVERLAY=(10:X)
The IN3 data set has RECFM=FB and LRECL=18 with these 18-byte records:
000111222333444555
666777888999
Every 3-byte field in each large IN3 record will be broken up into a single 3-byte
field and then padded on the right with blanks to 10-bytes. TOLEN(3) indicates
that the resized records will have a length of 3 bytes. OVERLAY=(10:X) expands
each resized record to 10 bytes in OUT3. OMIT=(1,3,CH,EQ,C' ') removes any
resized records that are completely blank (that is, the two blank resized records
resulting from the blanks in positions 13-18 of the second input record).
The OUT3 data set will have RECFM=FB and LRECL=10 with these 10-byte
records:
000
111
222
333
444
555
666
777
888
999
667
SELECT Operator
SELECT operator
SELECT FROM(indd)
ALLDUPS
NODUPS
HIGHER(x)
LOWER(y)
EQUAL(v)
FIRST
FIRST(u)
LAST
FIRSTDUP
FIRSTDUP(w)
LASTDUP
TO(outdd)
DISCARD(savedd)
TO(outdd) DISCARD(savedd)
ON(p,m,f)
ON(VLEN)
VSAMTYPE(x)
UZERO
USING(xxxx)
Selects records from an input data set based on meeting criteria for the number of
times specified numeric or character field values occur. This makes it possible to
only keep records with duplicate field values, only keep records with no duplicate
field values, only keep records with field values that occur more than, less than, or
exactly n times, only keep the first or first n duplicate records with each field
value, or only keep the first or last record with each unique or duplicate field
value. From 1 to 10 fields can be specified. At least one ON(VLEN) or ON(p,m,f)
field must be specified; all such ON fields specified will be used to determine the
"value count" (that is, the number of times the ON values occur) to be matched
against the criteria.
DISCARD(savedd) can be used to save the records that do not meet the criteria
(that is, the discarded records), in the savedd data set. DISCARD(savedd) can be
used with or without TO(outdd).
DFSORT is called to sort the indd data set. ICETOOL uses its E35 exit to determine
which records to include in the outdd data set or savedd data set. ICETOOL passes
the EQUALS option to DFSORT to ensure that duplicates are kept in their original
input order.
The DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified.
Do not supply your own MODS, SUM or OUTREC statement.
You can use comment statements. You can use INCLUDE, OMIT, INREC, OPTION,
SORT, or OUTFIL statements providing you observe these rules:
v You can use an INCLUDE or OMIT statement to remove input records before
SELECT processing.
v You can use an INREC statement to reformat input records before SELECT
processing. You can use INREC's PARSE, BUILD (FIELDS), OVERLAY, FINDREP,
IFTHEN, or IFOUTLEN functions. If your INREC statement changes the starting
668
SELECT Operator
position of an ON field, you must specify the new starting position for that ON
field. For example, if your input records have a CH key at positions 1-5 and you
use an INREC statement like this:
INREC FIELDS=(25:1,50)
The records will be sorted by the 21,5,CH,A field and the 41,6,CH,D field, but
only selected by the 21,5,CH field. This would allow you to select the three
highest 41,6,CH values for each 21,5,CH value.
v If you specify TO(outdd) without DISCARD(savedd), you can further process
the outdd records after SELECT processing using an OUTFIL statement like this:
OUTFIL FNAMES=outdd,...
v If you specify TO(outdd) and DISCARD(savedd), you can further process the
outdd and savedd records after SELECT processing using two (and only two)
OUTFIL statements like this:
OUTFIL FNAMES=outdd,...
OUTFIL FNAMES=savedd,...
Both statements must be specified in the order shown with at least the FNAMES
parameter. For example, to further modify only the DISCARD data set, you
could use statements like this:
OUTFIL FNAMES=OUT
OUTFIL FNAMES=SAVE,INCLUDE=(21,3,ZD,GT,+25)
ICETOOL requires extra storage for SELECT processing, over and above what is
normally needed by ICETOOL and DFSORT, in order to save your records until it
can determine whether or not they meet your specified criteria. In most cases, only
a small amount of storage is needed and can be obtained (above 16MB virtual).
However, for a FROM data set with a large record length and criteria requiring
many saved records, a large amount of storage is needed. For example, with a
record length of 32756 and HIGHER(99), over 3 MBs of storage is needed. If
ICETOOL cannot get the storage it needs, it issues a message and terminates the
SELECT operation. Increasing the REGION by the amount indicated in the
message may allow ICETOOL to run successfully.
669
SELECT Operator
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for a SELECT operator, you can specify USING(xxxx) and take one
of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(,8)
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
TO(outdd)
Specifies the ddname of the output data set to which DFSORT will write the
records it selects for the operation (that is, the records that meet the specified
criteria). Thus, the outdd data set will contain the records selected by
ALLDUPS, NODUPS, HIGHER(x), LOWER(y), EQUAL(v), FIRST, FIRST(u),
LAST, FIRSTDUP, FIRSTDUP(w) or LASTDUP.
An outdd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's SORTOUT data set (if the DISCARD
operand is not specified) or OUTFIL data set (if the DISCARD operand is
specified).
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the TO operand must not be the same as the ddname
specified in the FROM or DISCARD operand.
Refer to JCL restrictions on page 573 for more information.
DISCARD(savedd)
Specifies the ddname of the output data set to which DFSORT will write the
records it does not select for this operation (that is, the records that do not
meet the specified criteria). Thus, the savedd data set will contain the records
discarded by ALLDUPS, NODUPS, HIGHER(x), LOWER(y), EQUAL(v), FIRST,
FIRST(u), LAST, FIRSTDUP, FIRSTDUP(w) or LASTDUP.
A savedd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's OUTFIL data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the DISCARD operand must not be the same as the
ddname specified in the FROM or TO operand.
Refer to JCL restrictions on page 573 for more information.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used for this operation.
670
SELECT Operator
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3
4
| p=
1
2
3
4
5
6
7
8
Length
Description
BI
1 to 1500 bytes
Unsigned binary
FI
1 to 256 bytes
Signed fixed-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
CH
1 to 4000 bytes
Character
CSF or FS
1 to 32 bytes
UFF
1 to 44 bytes
SFF
1 to 44 bytes
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
671
SELECT Operator
HIGHER(x)
Limits the records selected to those with ON values that occur more than x
times (value count > x). You can use this operand to keep just those records
with field values that occur more than x times.
x must be specified as n or +n where n can be 0 to 99.
LOWER(y)
Limits the records selected to those with ON values that occur less than y
times (value count < y). You can use this operand to keep just those records
with field values that occur less than y times.
y must be specified as n or +n where n can be 0 to 99.
EQUAL(v)
Limits the records selected to those with ON values that occur v times (value
count = v). You can use this operand to keep just those records with field
values that occur v times.
v must be specified as n or +n where n can be 0 to 99.
FIRST
Limits the records selected to those with ON values that occur only once
(value count = 1) and the first record of those with ON values that occur more
than once (value count > 1). You can use this operand to keep just the first
record for each unique field value.
FIRST is equivalent to FIRST(1).
FIRST(u)
Limits the records selected to those with ON values that occur only once
(value count = 1) and the first u records of those with ON values that occur
more than once (value count > 1). You can use this operand to keep just the
first u records for each unique field value.
u must be specified as n or +n where n can be 1 to 999999999999999.
LAST
Limits the records selected to those with ON values that occur only once
(value count = 1) and the last record of those with ON values that occur more
than once (value count > 1). You can use this operand to keep just the last
record for each unique field value.
FIRSTDUP
Limits the records selected to the first record of those with ON values that
occur more than once (value count > 1). You can use this operand to keep just
the first record of those records with duplicate field values.
FIRSTDUP is equivalent to FIRSTDUP(1).
FIRSTDUP(w)
Limits the records selected to the first w records of those with ON values that
occur more than once (value count > 1). You can use this operand to keep just
the first w records of those records with duplicate field values.
w must be specified as n or +n where n can be 1 to 999999999999999.
LASTDUP
Limits the records selected to the last record of those with ON values that
occur more than once (value count > 1). You can use this operand to keep just
the last record of those records with duplicate field values.
672
SELECT Operator
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
UZERO
See the discussion of this operand on the OCCUR statement in OCCUR
operator on page 646.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it:
1. Must conform to the rules for DFSORT's SORTCNTL data set.
2. Should generally be used only for an INCLUDE or OMIT statement, an
INREC statement, a SORT statement, comment statements, or OUTFIL
statements as described for SELECT operator on page 668.
SELECT examples
Although the SELECT operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
Example 1
SELECT FROM(INPUT) TO(DUPS) ON(11,8,CH) ON(30,44,CH) ALLDUPS
Sorts the INPUT data set to the DUPS data set, selecting only the records from
INPUT with characters in positions 11-18 and characters in positions 30-73 that
occur more than once (that is, only records with duplicate ON field values).
The DUPS data set might look as follows (several records are shown for illustrative
purposes):
USR002
DFSRT2
DFSRT5
DFSRT1
SYS003
DFSRT2
USR003
.
.
.
BETTEN
BETTEN
BOENIG
BOENIG
BOENIG
BOENIG
BOENIG
.
.
.
12
5
20
20
20
20
20
.
.
.
DOC.EXAMPLES
DOC.EXAMPLES
MYDATA
MYDATA
MYDATA
SORTST1.TEST
SORTST1.TEST
.
.
.
Example 2
SELECT FROM(INPUT) TO(ONLYONE) ON(23,3,FS) NODUPS
Sorts the INPUT data set to the ONLYONE data set, selecting only the records
from INPUT with floating sign values in positions 23-25 that occur just once (that
is, only records with no duplicate ON field values).
The ONLYONE data set might look as follows (several records are shown for
illustrative purposes):
DFSRT2
DFSRT1
USR002
SYS003
BOENIG
PACKER
BETTEN
YAEGER
5
8
12
32
DOC.EXAMPLES
ICETOOL.SMF.RUNS
DOC.EXAMPLES
ICETOOL.TEST.CASES
Chapter 7. Using ICETOOL
673
SELECT Operator
DFSRT2
.
.
.
CORNELL
.
.
.
108
.
.
.
FS.TEST.CASES
.
.
.
Example 3
SELECT FROM(FAILURES) TO(CHECKOUT) ON(28,8,CH) ON(1,5,CH) HIGHER(3)
Sorts the FAILURES data set to the CHECKOUT data set, selecting only the
records from FAILURES with characters in positions 28-35 and characters in
positions 1-5 that occur more than three times (that is only records with four or
more duplicate ON field values).
The CHECKOUT data set might look as follows (several records are shown for
illustrative purposes):
03/12/04
03/12/04
03/12/04
03/12/04
03/06/04
03/06/04
03/06/04
03/06/04
03/06/04
.
.
.
08:36:59
09:27:32
09:03:18
08:56:13
15:12:01
14:57:00
15:43:19
16:06:39
15:22:08
.
.
.
A3275647
A3275647
A3275647
A3275647
C3275647
C3275647
C3275647
C3275647
C3275647
.
.
.
Example 4
SELECT FROM(BOOKS) TO(PUBLISHR) ON(29,10,CH) FIRST
Sorts the BOOKS data set to the PUBLISHR data set, selecting only the records
from BOOKS with characters in positions 29-38 that occur only once and the first
record of those with characters in positions 29-38 that occur more than once (that
is, one record for each unique ON field value).
The PUBLISHR data set might look as follows (several records are shown for
illustrative purposes):
Banana Slugs I Have Known
Toads on Parade
Pets Around the World
.
.
.
Brent
Cooper
Davis
.
.
.
Animals
Animals
Animals
.
.
.
Example 5
SELECT FROM(BOOKS) TO(PUBLISHR) ON(29,10,CH) FIRST DISCARD(SAVEREST)
This example creates the same PUBLISHR data set as Example 4. In addition, it
creates a SAVEREST data set that contains all of the records not written to the
PUBLISHR data set. The SAVEREST data set might look as follows (several records
are shown for illustrative purposes):
How to Talk to Your Amoeba
What Buzzards Want
Birds of Costa Rica
.
.
.
674
Brent
Davis
Davis
Animals
Animals
Animals
SELECT Operator
Example 6
SELECT FROM(MASTPULL) TO(MATCH) ON(5,8,CH) FIRSTDUP
This example shows how you can use a list of account numbers in a "pull" data set
to only select records with those account numbers from a "master" data set. The
MASTPULL DD would have the "master" data set and "pull" data set concatenated
together (in that order).
The SELECT operator sorts the concatenated data sets and selects only the first
record of those with characters in positions 5-12 that occur more than once (that is,
one record for each duplicate ON field value). Because the "master" data set is first
in the concatenation, the selected records will come from the "master" data set.
If the "master" data set looked like this:
A52
N92
B12
J73
Q28
RB172832
MX328126
LB018725
AB007231
SP973004
2001/03/15
2001/01/27
2000/12/28
2001/02/13
2000/11/19
Note: This example assumes that there are not any duplicate account numbers in
either the "master" or "pull" data sets. If that is not true, you can use SELECT with
FIRST or LAST, for the appropriate data set, to make it true. For example, if your
"master" data set has duplicate account numbers and you want to select the first
account number from the "master" data set for each account number in the "pull"
data set, you could use the following statements:
SELECT FROM(MASTER) TO(TEMP) ON(5,8,CH) FIRST
SELECT FROM(TEMPPULL) TO(MATCH) ON(5,8,CH) FIRSTDUP
The TEMPPULL DD would have the temporary data set and "pull" data set
concatenated together (in that order).
Example 7
SELECT FROM(INPUT) TO(ONLYONE) ON(23,3,FS) NODUPS USING(CTL1)
This example shows how you can use USING(xxxx) to supply an OUTFIL
statement to modify the TO data set. SELECT chooses the same output records as
for Example 2 on page 673, but an OUTFIL statement is used to further modify
those records for output to the ONLYONE data set.
The CTL1CNTL data set contains:
OUTFIL FNAMES=ONLYONE,
REMOVECC,
INCLUDE=(23,3,FS,LT,100),
OUTREC=(1:1,7,8:C|,11:11,7,19:C|,23:23,3,FS,M11,
27:C|,30:30,15),
TRAILER1=(/,TOTAL= ,TOT=(23,3,FS,M11,LENGTH=6))
675
SELECT Operator
and the ONLYONE data set might look as follows:
DFSRT2
DFSRT1
USR002
SYS003
|
|
|
|
EISSLER
PACKER
EISSLER
YAEGER
|
|
|
|
005
008
012
032
|
|
|
|
DOC.EXAMPLES
ICETOOL.SMF.RUN
DOC.EXAMPLES
ICETOOL.TEST.CA
TOTAL= 000057
Example 8
This example shows how you can use USING(xxxx) to supply an OMIT statement
to remove certain input records and an INREC statement to reformat certain input
records before SELECT processing begins.
SELECT FROM(INB) TO(OUTB) ON(8,10,CH) FIRSTDUP USING(BIRD)
CROWS
PIGEONS
HAWKS
ROBINS
SPARROWS
CHICKENS
RAVENS
PIGEONS
ROBINS
HAWKS
TERNS
EAGLES
STARLINGS
We want to remove the TYPE3 records and then select one record for each type of
bird that appears in both a TYPE1 and a TYPE2 record. We could use the following
control statements in BIRDCNTL:
* Remove the TYPE3 records.
OMIT COND=(1,5,CH,EQ,CTYPE3)
* Reformat the TYPE2 records to place the bird name in
* same place as in the TYPE1 records so we can match them.
INREC IFTHEN=(WHEN=(1,5,CH,EQ,CTYPE2),
BUILD=(8:18,10))
HAWKS
PIGEONS
ROBINS
Example 9
This example shows how you can use USING(xxxx) to supply a SORT statement to
alter the records that are selected.
SELECT FROM(IN) TO(OUT) ON(1,5,CH) FIRST(3) USING(CTL1)
676
00015
00012
00003
00018
00005
00035
00022
00007
SELECT Operator
VICKY
VICKY
VICKY
VICKY
00014
00028
00002
00015
We want to select the three records with each name that have the highest counts. If
we just used ON(1,5,CH) without any CTL1CNTL statements, we'd get the first
three records for each name without regard to the count. The OUT data set would
look like this:
FRANK
FRANK
FRANK
VICKY
VICKY
VICKY
00015
00012
00003
00022
00007
00014
To get the three records with the highest counts for each name, we can use the
following SORT statement in CTL1CNTL:
SORT FIELDS=(1,5,CH,A,7,5,ZD,D)
The records will be sorted in ascending order on the name field, and in descending
order on the count field. By sorting descending on the count, we ensure that the
three records with the highest counts are the first three records for each name.
Thus, when ON(1,5,CH) selects the first three records, they will be those with the
highest counts. The OUT data set will look like this:
FRANK
FRANK
FRANK
VICKY
VICKY
VICKY
00035
00018
00015
00028
00022
00015
SORT operator
SORT
FROM(indd)
JKFROM
USING(xxxx)
,
TO( outdd
VSAMTYPE(x)
)
LOCALE(name)
LOCALE(CURRENT)
LOCALE(NONE)
SERIAL
677
SORT Operator
INCLUDE or OMIT operand is specified in the xxxxCNTL data set, the active
locale's collating rules affect INCLUDE and OMIT processing as explained in the
Cultural Environment Considerations discussion in INCLUDE control
statement on page 96.
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for a SORT operator, you can take one of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(,8)
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
JKFROM
Specifies you are using a JOINKEYS application with this SORT operator to
sort the joined records. You must provide a USING(xxxx) operand. In
xxxxCNTL, you must provide a SORT statement, a JOINKEYS statement with
F1=ddname1 for the F1 file, and a JOINKEYS statement with F2=ddname2 for
the F2 file, as well as JOIN and REFORMAT statements as needed.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
An xxxxCNTL DD statement must be present, and the control statements in it
must conform to the rules for DFSORT's SORTCNTL data set.
The xxxxCNTL data set must contain a SORT statement. If TO is not specified,
the xxxxCNTL data set must also contain either one or more OUTFIL
statements or a MODS statement for an E35 routine that disposes of all
records. Other statements are optional.
If you want to override dynamic allocation of work data sets for this operation,
you can use xxxxWKdd DD statements for that purpose.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
TO(outdd,...)
Specifies the ddnames of the output data sets to be written by DFSORT for this
operation. From 1 to 10 outdd names can be specified. An outdd DD statement
must be present for each outdd name specified. If a single outdd data set is
specified, DFSORT is called once to sort the indd data set to the outdd data set
using SORTOUT processing; the outdd data set must conform to the rules for
DFSORT's SORTOUT data set. If multiple outdd data sets are specified and
SERIAL is not specified, DFSORT is called once to sort the indd data set to the
678
SORT Operator
outdd data sets using OUTFIL processing; the outdd data sets must conform to
the rules for DFSORT's OUTFIL data sets.
A ddname specified in the FROM operand must not also be specified in the
TO operand.
Refer to JCL restrictions on page 573 for more information regarding the
selection of ddnames.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(name)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(CURRENT)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LOCALE(NONE)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
SERIAL
Specifies that OUTFIL processing is not to be used when multiple outdd data
sets are specified. DFSORT is called multiple times and uses SORTOUT
processing; the outdd data sets must conform to the rules for DFSORT's
SORTOUT data set. SERIAL is not recommended because the use of serial
processing (that is, multiple calls to DFSORT) instead of OUTFIL processing
can degrade performance and imposes certain restrictions as detailed later in
this section. SERIAL is ignored if a single outdd data set is specified.
DFSORT is called to sort the indd data set to the first outdd data set using the
DFSORT control statements in the xxxxCNTL data set. If the sort operation is
successful, DFSORT is called as many times as necessary to copy the first
outdd data set to the second and subsequent outdd data sets. Therefore, for
maximum efficiency, use a disk data set as the first in a list of outdd data sets
on both disk and tape. If more than one outdd data set is specified, DFSORT
must be able to read the first outdd data set after it is written in order to copy
it to the other outdd data sets. Do not use a SYSOUT or DUMMY data set as
the first in a list of outdd data sets because:
v If the first data set is SYSOUT, DFSORT abends when it tries to copy the
SYSOUT data set to the second outdd data set.
v If the first data set is DUMMY, DFSORT copies the empty DUMMY data set
to the other outdd data sets (that is, all of the resulting outdd data sets are
empty).
Sort examples
This section includes 14 sort examples.
Example 1
* Method 1
SORT FROM(MASTER) TO(PRINT,TAPE,DISK) USING(ABCD)
* Method 2
SORT FROM(MASTER) TO(DISK,TAPE,PRINT) USING(ABCD) SERIAL
679
SORT Operator
This example shows two different methods for creating multiple sorted output data
sets. Assume that the ABCDCNTL data set contains:
SORT FIELDS=(15,20,CH,A,1,5,PD,D)
Method 1 requires one call to DFSORT, one pass over the input data set, and
allows the output data sets to be specified in any order. The SORT operator sorts
all records from the MASTER data set to the PRINT (SYSOUT), TAPE, and DISK
data sets, using the SORT statement in the ABCDCNTL data set and OUTFIL
processing.
Method 2 requires three calls to DFSORT, three passes over the input data set, and
imposes the restriction that the SYSOUT data set must not be the first TO data set.
The SORT operator sorts all records from the MASTER data set to the DISK data
set, using the SORT statement in the ABCDCNTL data set, and then copies the
resulting DISK data set to the TAPE and PRINT (SYSOUT) data sets. Because the
first TO data set is processed three times (written, read, read), placing the DISK
data set first is more efficient than placing the TAPE data set first. PRINT must not
be the first in the TO list because a SYSOUT data set cannot be read.
Example 2
* Method 1
SORT FROM(IN) TO(DEPT1) USING(DPT1)
SORT FROM(IN) TO(DEPT2) USING(DPT2)
SORT FROM(IN) TO(DEPT3) USING(DPT3)
* Method 2
SORT FROM(IN) USING(ALL3)
This example shows two different methods for creating sorted subsets of an input
data set. Assume that:
v The DPT1CNTL data set contains:
SORT FIELDS=(51,2,BI,A,18,5,CH,A,58,4,BI,A)
INCLUDE COND=(5,3,CH,EQ,CD01)
Method 1 requires three calls to DFSORT and three passes over the input data set:
v The first SORT operator sorts the records from the IN data set that contain D01
in positions 5-7 to the DEPT1 data set
v The second COPY operator sorts the records from the IN data set that contain
D02 in positions 5-7 to the DEPT2 data set
v The third COPY operator sorts the records from the IN data set that contain D03
in positions 5-7 to the DEPT3 data set.
Method 2 accomplishes the same result as method 1 but, because it uses OUTFIL
statements instead of TO operands, requires only one call to DFSORT and one pass
over the input data set.
680
SORT Operator
Example 3
SORT FROM(IN1) TO(FRANCE) USING(SRT1) LOCALE(FR_FR)
SORT FROM(IN1) TO(CANADA) USING(SRT1) LOCALE(FR_CA)
SORT FROM(IN1) TO(BELGIUM) USING(SRT1) LOCALE(FR_BE)
This example shows how sorted data for three different countries can be produced.
Assume that the SRT1CNTL data set contains:
SORT FIELDS=(5,20,CH,A,31,15,CH,A,1,4,FI,D,63,10,CH,D)
The first SORT operator sorts all records from the IN1 data set to the FRANCE
data set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_FR
(French language for France).
The second SORT operator sorts all records from the IN1 data set to the CANADA
data set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_CA
(French language for Canada).
The third SORT operator sorts all records from the IN1 data set to the BELGIUM
data set, using the SORT statement in the SRT1CNTL data set. The character (CH)
control fields are sorted according to the collating rules defined in locale FR_BE
(French language for Belgium).
SPLICE operator
WITH(p,m)
WITHALL
WITHANY
WITHEACH
681
SPLICE Operator
KEEPNODUPS
KEEPBASE
USING(xxxx)
VSAMTYPE(x)
UZERO
VLENMAX
VLENOVLY
Splices together specified fields from records with matching numeric or character
field values (that is, duplicate values), but different information. This makes it
possible to join fields from different types of input records to create an output
record with information from two or more records.
Typically, you will want to reformat the records from two or more data sets to a
temporary MOD data set, and use that temporary MOD data set as input to the
SPLICE operator.
SPLICE examples on page 691 shows some techniques for splicing records from
different data sets together in a variety of ways to perform various file "join" and
"match" operations.
By default (when WITHALL, WITHANY and WITHEACH are not specified), one
spliced record is created for each set of duplicates by splicing the first duplicate
with specified fields from the last duplicate.
The first duplicate is treated as a "base record". The last duplicate is treated as an
"overlay record". Specified fields from the overlay record are overlaid on to the
base record. Thus, the output record consists of fields from the base (first) record
intermixed with specified fields from the overlay (last) record.
The records to be spliced can originate from two or more different input data sets.
From 1 to 10 ON fields can be used for the fields to match on. At least one
ON(p,m,f) field must be specified; all such ON fields specified will be used to
determine the matching records to be spliced together.
From 1 to 50 WITH fields can be used to specify the fields to be overlaid on the
base record from the overlay record. At least one WITH(p,m) field must be
specified; all such WITH fields specified will be overlaid on to the base record. All
other fields in the base record will be kept unchanged.
To illustrate the splicing process, if we had the following two fixed-length input
records with the base fields, ON field and WITH fields as shown:
BASE1
ON1
ON1
BASE2
BASE3 BASE4
WITHA
GGGGG
WITHB
ON1
BASE2
WITHA
BASE3 BASE4
WITHB
682
SPLICE Operator
spliced record. For example, if we had the following two records with the lengths
(in the RDW), ON field and WITH fields as shown:
25 | ON1 BASE1
BASE2
35 | ON1
WITH1
WITH2
The WITH2 field is beyond the end of the base record, so it is not spliced.
However, if you specify VLENMAX, the spliced record is given the larger of the
base record length or overlay record length. If we specify VLENOVLY, the spliced
record is given the overlay record length. In either case, if the overlay record
length is larger, bytes in the extended spliced record that are not overlaid are filled
in with blanks.
The resulting spliced output record with either VLENMAX or VLENOVLY would
be:
35
WITH2
You can use VLENMAX when you want the spliced record to have the maximum
length of the base or overlay record. You can use VLENOVLY when you want the
spliced record to have the length of the overlay record, regardless of whether it's
longer or shorter than the base record. Without VLENMAX or VLENOVLY, the
spliced record has the length of the base record regardless of whether it's longer or
shorter than the overlay record.
For fixed-length records, the length of the base, overlay and spliced records are all
the same. Thus, VLENOVLY and VLENMAX have no meaning for fixed-length
records and are ignored.
WITHALL can be used to create multiple spliced records for each set of duplicates.
The first duplicate is spliced with the specified fields from the second duplicate.
Then the first duplicate is spliced with the specified fields from the third duplicate,
and so on.
The first duplicate is treated as a base record. Each subsequent duplicate is treated
as an overlay record. The specified fields from each overlay record are overlaid on
to the base record. Thus, the output records consist of fields from the base record
intermixed with specified nonblank and blank fields from the overlay records.
The records to be spliced can originate from multiple input data sets.
To illustrate the splicing process when WITHALL is specified, if we had the
following four fixed-length records with the base fields, ON field and WITH fields
as shown:
BASE1
ON1
ON1
ON1
ON1
BASE2
BASE3 BASE4
WITHA
WITHC
WITHE
GGGGG
WITHB
WITHF
ON1
ON1
ON1
BASE2
BASE2
BASE2
WITHA
WITHC
WITHE
BASE3 BASE4
BASE3 BASE4
BASE3 BASE4
WITHB
WITHF
683
SPLICE Operator
Note that without WITHALL, the resulting single spliced output record would be:
BASE1
ON1
BASE2
WITHE
BASE3 BASE4
WITHF
| BASE1 ON1
|
ON1
|
ON1
|
ON1
BASE2
WITHA
WITHB
WITHE
WITHC
WITHF
WITHD
WITHA BASE2
WITHB BASE2
WITHE BASE2
The WITHC, WITHD and WITHF fields are beyond the end of the base record, so
they are not spliced.
However, if you specify VLENMAX, the spliced record is given the larger of the
base record length or overlay record length. If we specify VLENOVLY, the spliced
record is given the overlay record length. In either case, if the overlay record
length is larger, bytes in the extended spliced record that are not overlaid are filled
in with blanks. The resulting three spliced output records with WITHALL and
VLENMAX would be:
30 | BASE1 ON1
50 | BASE1 ON1
40 | BASE1 ON1
WITHA BASE2
WITHB BASE2
WITHE BASE2
WITHC
WITHF
WITHD
The resulting three spliced output records with WITHALL and VLENOVLY would
be:
25 | BASE1 ON1
50 | BASE1 ON1
40 | BASE1 ON1
WITHA
WITHB BASE2
WITHE BASE2
WITHC
WITHF
WITHD
WITHANY can be used to create one spliced record for each set of duplicates. The
first duplicate is spliced with the nonblank values of each subsequent duplicate for
specified fields.
The first duplicate is treated as a base record. Each subsequent duplicate is treated
as an overlay record. Each specified field with a nonblank value in each overlay
record is overlaid on to the base record. Thus, the output record consists of fields
from the base record intermixed with specified nonblank fields from each overlay
record. The value from the last overlay record with each nonblank value will
appear in the output record. Note that a specified "field" from an overlay record
can actually consist of multiple fields from the record that have previously been
reformatted into one contiguous field.
The records to be spliced can originate from multiple input data sets.
To illustrate the splicing process when WITHANY is specified, if we had the
following four fixed-length records with the base fields, ON field and WITH fields
as shown:
684
SPLICE Operator
BASE1
ON1
ON1
ON1
ON1
BASE2
WITHC
WITHA
WITHB
ON1
BASE2
WITHB
WITHC
WITHA
For variable-length records, by default (without VLENMAX), the spliced record has
the same length as the base record. For example, with WITHANY, if we had the
following four records with the lengths (in the RDW), ON field and WITH fields as
shown:
30
50
25
40
| BASE1 ON1
|
ON1
|
ON1
|
ON1
BASE2
WITHB
WITHA
WITHC
WITHA BASE2
The WITHB and WITHC fields are beyond the end of the base record, so they are
not spliced. However, if you specify VLENMAX, the spliced record is given the
largest of the base record length or overlay record lengths. If the largest overlay
record length is larger than the base record length, bytes in the extended spliced
record that are not overlaid are filled in with blanks. The resulting spliced output
record with WITHANY and VLENMAX would be:
50 | BASE1 ON1
WITHA BASE2
WITHC
WITHB
ON1
ON1
ON1
ON1
BASE2
WITHA
WITHB
WITHC
ON1
BASE2
WITHA
WITHB
WITHC
685
SPLICE Operator
For variable-length records, by default (without VLENMAX), the spliced record has
the same length as the base record. For example, with WITHEACH, if we had the
following four records with the lengths (in the RDW), ON field and WITH fields as
shown:
30
25
50
40
| BASE1 ON1
|
ON1
|
ON1
|
ON1
BASE2
WITHA
WITHB
WITHC
WITHA BASE2
The WITHB and WITHC fields are beyond the end of the base record, so they are
not spliced.
However, if you specify VLENMAX, the spliced record is given the largest of the
base record length or overlay record lengths. If the largest overlay record length is
larger than the base record length, bytes in the extended spliced record that are not
overlaid are filled in with blanks. The resulting spliced output record with
WITHEACH and VLENMAX would be:
50 | BASE1 ON1
WITHA BASE2
WITHC
WITHB
ONA
ONB
ONB
ONC
OND
OND
WITHA
WITHB
The two unique records (ONA and OND) would be kept along with the two
spliced records (ONB and OND). The resulting four unspliced and spliced output
records would be:
UNIQA
BASEA
UNIQB
BASEB
ONA
ONB
ONC
OND
WITHA
WITHB
Note that without KEEPNODUPS, the two unique records (ONA and ONC) would
not be kept. The resulting two spliced output records would be:
BASEA
BASEB
ONB
OND
WITHA
WITHB
KEEPBASE can be used to keep the base records (first duplicate) as well as the
spliced records. The base records will be unchanged.
To illustrate the splicing process when KEEPBASE is specified, if we had the
following six records with the base fields, ON fields and WITH fields as shown:
686
SPLICE Operator
UNIQA
BASEA
DUPAA
UNIQB
BASEB
DUPBB
ONA
ONB
ONB
ONC
OND
OND
WITHA
WITHB
The two base records with duplicates (first ONB record and first OND record)
would be kept along with the two spliced records (ONB and OND). The resulting
four unspliced and spliced output records would be:
BASEA
BASEA
BASEB
BASEB
ONB
ONB
OND
OND
WITHA
WITHB
Note that without KEEPBASE, the two base records with duplicates (first ONB
record and first OND record) would not be kept. The resulting two spliced output
records would be:
BASEA
BASEB
ONB
OND
WITHA
WITHB
If we used KEEPNODUPS and KEEPBASE with the original six records, the
resulting six unspliced and spliced output records would be:
UNIQA
BASEA
BASEA
UNIQB
BASEB
BASEB
ONA
ONB
ONB
ONC
OND
OND
WITHA
WITHB
DFSORT is called to sort the indd data set. ICETOOL uses its E35 exit to determine
which records to splice and include in the outdd data set. ICETOOL passes the
EQUALS option to DFSORT to ensure that duplicates are kept in their original
input order.
The DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified.
Do not supply your own MODS, SUM, OUTREC, or SORT statement.
You can use comment statements. You can use INCLUDE, OMIT, INREC, OPTION,
and OUTFIL statements providing you observe these rules:
v You can use an INCLUDE or OMIT statement to remove input records before
SPLICE processing.
v You can use an INREC statement to reformat input records before SPLICE
processing; the base and overlay records are reformatted according to the INREC
statement. You can use INREC's PARSE, BUILD (FIELDS), OVERLAY, FINDREP,
IFTHEN, or IFOUTLEN functions. If your INREC statement changes the starting
position of an ON field or WITH field, you must specify the new starting
position for that ON field or WITH field. For example, if your input records
have a CH key at positions 1-5 and a WITH field at 6-8 and you use an INREC
statement like this:
INREC FIELDS=(31:1,50)
687
SPLICE Operator
OUTFIL FNAMES=outdd,...
For example, with TO(OUT1) you could further modify the OUT1 records after
they have been spliced, with a statement like this:
OUTFIL FNAMES=OUT1,FTOV,VLTRIM=X40
Operand descriptions
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
TO(outdd)
Specifies the ddname of the output data set to which DFSORT will write the
records it produces for the operation (that is, the spliced records, the
non-duplicate records if KEEPNODUPS is specified, and the base records if
KEEPBASE is specified).
An outdd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's SORTOUT data set.
The ddname specified in the TO operand must not be the same as the ddname
specified in the FROM operand.
Refer to JCL restrictions on page 573 for more information.
ON(p,m,f)
See the discussion of this operand on the SELECT statement in SELECT
operator on page 668.
WITH(p,m)
Specifies the position and length of a field to be overlaid from the overlay
record on to the base record.
p specifies the first byte of the field relative to the beginning of the overlay
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3 4
| p=
1
2
3
4
5
6
7
8
688
SPLICE Operator
If INREC is specified, p must refer to the record as reformatted by INREC.
m specifies the length of the field in bytes. A field must not extend beyond
position 32752.
A WITH field will not be used to overlay the RDW of a variable-length base
record or to overlay bytes from beyond the end of an overlay record on to a
base record. When necessary, WITH fields will be adjusted to prevent these
situations. For example, if WITH(1,6) is specified for a variable-length record, it
will be treated as WITH(5,2) and if WITH(75,10) is specified for an 80-byte
overlay record, it will be treated as WITH(75,6).
A WITH field will not be used to overlay bytes beyond the end of a base
record. When necessary, WITH fields will be adjusted to prevent this situation.
For example, if WITH(75,10) is specified for an 80-byte base record, it will be
treated as WITH(75,6). However, if you specify VLENMAX or VLENOVLY, a
WITH field can be used to overlay bytes beyond the end of a base record
provided that WITH field is present in the overlay record. For example, if
VLENMAX and WITH(75,10) is specified for an 80-byte base record and a
90-byte overlay record, the spliced record will have a length of 90 bytes and
the WITH(75,10) field will be present at positions 75-84 followed by 6 blanks in
positions 85-90.
WITHALL
Specifies that the first duplicate is spliced with specified fields from the second
duplicate, and then from each subsequent duplicate in turn. All of the WITH
fields (nonblank and blank) from each overlay record are overlaid on to the
base record.
With WITHALL, a spliced output record is created from each base record and
overlay record, resulting in n-1 spliced records for each set of n duplicates.
WITHALL overrides the default of splicing the first duplicate with all of the
specified fields from the last duplicate.
WITHANY
Specifies that the first duplicate is spliced with specified nonblank fields from
each subsequent duplicate. Each nonblank WITH field from each overlay
record is overlaid on to the base record.
With WITHANY, a single spliced output record is created using the base record
and each nonblank field from each overlay record. If more than one overlay
record has a nonblank value for a WITH field, the nonblank value from the
last overlay record for that WITH field will appear in the output record. Note
that the specified "field" from an overlay record can actually consist of multiple
fields from the record that have previously been reformatted into one
contiguous field.
WITHANY overrides the default of splicing the first duplicate with all of the
specified fields from the last duplicate.
VLENOVLY cannot be specified with WITHANY.
WITHEACH
Specifies that the first duplicate is spliced with one specified field from each
subsequent duplicate. One WITH field (nonblank or blank) from each overlay
record is overlaid on to the base record. The first WITH field specifies the
bytes to be overlaid from the second duplicate record on to the first duplicate
record. The second WITH field specifies the bytes to be overlaid from the third
duplicate record on to the first duplicate record, and so on. For any set of
689
SPLICE Operator
duplicates, extra overlay records without matching WITH fields, or extra
WITH fields without matching overlay records are ignored.
With WITHEACH, a single spliced output record is created using the base
record and one field from each overlay record. Note that the specified "field"
from an overlay record can actually consist of multiple fields from the record
that have previously been reformatted into one contiguous field.
WITHEACH overrides the default of splicing the first duplicate with all of the
specified fields from the last duplicate.
VLENOVLY cannot be specified with WITHEACH.
KEEPNODUPS
Specifies that non-duplicate records are to be kept as well as spliced records.
The non-duplicate records will be unchanged.
KEEPBASE
Specifies that base records (first duplicate) are to be kept as well as spliced
records. The base records will be unchanged.
VLENMAX
Specifies that for variable-length records, the length of the spliced record is set
to the maximum length of the base record and overlay record. VLENMAX
overrides the default of setting the length of the spliced record to the length of
the base record.
If VLENMAX is specified with or without WITHALL, the spliced record is
given the larger of the base record length or overlay record length. If the
overlay record length is larger than the base record length, bytes in the
extended spliced record that are not overlaid are filled in with blanks.
If VLENMAX is specified with WITHANY or WITHEACH, the spliced record
is given the largest of the base record length or overlay record lengths. If the
largest overlay record length is larger than the base record length, bytes in the
extended spliced record that are not overlaid are filled in with blanks.
For fixed-length records, VLENMAX is ignored since the base, overlay and
spliced records all have the same length.
VLENOVLY
Specifies that for variable-length records, the length of the spliced record is set
to the length of the overlay record. VLENOVLY overrides the default of setting
the length of the spliced record to the length of the base record.
If VLENOVLY is specified with or without WITHALL, the spliced record is
given the overlay record length. If the overlay record length is larger than the
base record length, the spliced record is padded with blanks from the end of
the base record to the new length. If the overlay record length is smaller than
the base record length, bytes in the extended spliced record that are not
overlaid are filled in with blanks.
VLENOVLY cannot be specified with WITHANY or WITHEACH.
For fixed-length records, VLENOVLY is ignored since the base, overlay and
spliced records all have the same length.
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
690
SPLICE Operator
If USING is specified, an xxxxCNTL DD statement must be present and the
control statements in it:
1. Must conform to the rules for DFSORT's SORTCNTL data set.
2. Should generally be used only for an INCLUDE or OMIT statement, an
INREC statement, comment statements, or appropriate OUTFIL statements
as described for SPLICE operator on page 681.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
UZERO
See the discussion of this operand on the OCCUR statement in OCCUR
operator on page 646.
SPLICE examples
SPLICE normally requires reformatting the records of two or more data sets so
they can be joined, so complete JCL examples are shown in this section to illustrate
the suggested techniques. These techniques and others can be employed with
SPLICE to perform a variety of tasks.
Because SPLICE overlays the WITH fields from the overlay record to the base
record using matching ON fields, it's usually necessary to do some initial setup
before using SPLICE, to ensure that:
v the ON fields are in the same positions in the base and overlay records
v the WITH fields in the overlay records are in the positions they will occupy in
the base records
v the base records and overlay records are the same length. This is always
required for fixed-length records, and is required for variable-length records
unless VLENMAX or VLENOVLY is specified.
For optimum efficiency, it is also a good idea to remove any records that are not
needed for the SPLICE operation as part of the initial setup before the SPLICE
operation, by using appropriate INCLUDE or OMIT statements.
691
SPLICE Operator
* Reformat the File1 records for splicing
COPY FROM(IN1) TO(TEMP1) USING(CTL1)
* Reformat the File2 records for splicing
COPY FROM(IN2) TO(TEMP1) USING(CTL2)
* Splice the needed data from File1 and File2 together
SPLICE FROM(TEMP1) TO(COMBINE) ON(5,5,ZD) WITH(15,17)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,14,
file1 data
31:X)
add blanks for spliced file2 data
/*
//CTL2CNTL DD *
OUTREC FIELDS=(5:1,5,
put file2 key in same place as file1 key
15:7,15,
file2 data
30:33,2)
file2 data
/*
The base records originate from the IN1 data set and are copied and reformatted to
the TEMP1 data set. The reformatted TEMP1 records are 31 bytes long and look
like this:
Y12
Y12
Z35
Y12
Z35
89503
57301
02316
91073
18693
MKT
MKT
DEV
MKT
DEV
The overlay records originate from the IN2 data set and are copied and
reformatted to the end (MOD) of the TEMP1 data set. The reformatted TEMP1
records are 31 bytes long and look like this:
89503
72135
18693
57301
27M $9,185,354 CA
08M
$317,632 MA
10M $8,732,105 NY
50M
$30,000 NJ
Note that MOD is used for the TEMP1 data set, so the reformatted records from
IN1 and IN2 will be output to the TEMP1 data set in that order, ensuring that they
are spliced in that order.
The base and overlay records from the TEMP1 data set are sorted and spliced to
the COMBINE data set.
The records look like this after they are sorted on the 5,5,ZD field, but before they
are spliced. As a visual aid, the WITH fields in the overlay records are shown in
bold.
Z35 02316 DEV
Z35 18693 DEV
18693
Y12 57301 MKT
57301
72135
Y12 89503 MKT
89503
Y12 91073 MKT
10M $8,732,105 NY
50M
08M
$30,000 NJ
$317,632 MA
27M $9,185,354 CA
The spliced COMBINE records are 31 bytes long and look like this:
Z35 18693 DEV 10M $8,732,105 NY
Y12 57301 MKT 50M
$30,000 NJ
Y12 89503 MKT 27M $9,185,354 CA
Note that the base records for 18693, 57301 and 89503 have been spliced together
with their respective overlay records.
692
SPLICE Operator
Here is what the various ICETOOL operators do in this job:
v The first COPY operator creates reformatted IN1 records in TEMP1. The second
COPY operator creates reformatted IN2 records in TEMP1. The reformatted IN1
records have blanks where the reformatted IN2 WITH fields will go. The
reformatted IN2 records have the ON field from IN2 in the same place as in the
reformatted IN1 records, and have the IN2 data where we want it to go in the
reformatted IN1 records. We made the reformatted IN1 and reformatted IN2
records the same size so we can put them all in the TEMP1 data set and use
TEMP1 as input to the SPLICE operator.
v The SPLICE operator sorts the records from TEMP1 using the ON field. TEMP1
has the reformatted IN1 records before the reformatted IN2 records. The spliced
records are created from the base records and the overlay records in TEMP1.
Whenever two records are found with the same ON field, the WITH field from
the second record (reformatted IN2 overlay record) is overlaid on to the first
record (reformatted IN1 base record). The resulting spliced records are written to
the COMBINE data set.
number
number
number
number
693
SPLICE Operator
/*
//CTL4CNTL DD *
* Reformat records to:
* 1
301
701
851
871
* 300 blanks|400 blanks|150 blanks|File4bytes|seqno
OUTREC FIELDS=(851:1,20,871:SEQNUM,8,PD)
/*
//CTL5CNTL DD *
* Remove added sequence number from spliced records to get:
* File1bytes|File2bytes|File3bytes|File4bytes
OUTFIL FNAMES=ALLRCDS,OUTREC=(1,870)
/*
Because the data sets do not have a common key, we add sequence numbers to the
records from each data set and use the sequence numbers as the ON field for
SPLICE. Using this technique, we can splice together the 300-byte records from
FILE1, the 400-byte records from FILE2, the 150-byte records from FILE3 and the
20-byte records from FILE4, to produce 870-byte records in ALLRCDS.
Conceptually, the 870-byte records in ALLRCDS would look like this:
File1 Record1 ... File2Record1 ... File3Record1 ... File4Record1 ...
File1 Record2 ... File2Record2 ... File3Record2 ... File4Record2 ...
...
The base records originate from the FILE1 data set and the overlay records
originate from the FILE2, FILE3 and FILE4 data sets.
Here is what the various ICETOOL operators do in this job:
The first COPY operator creates reformatted records in the T1 data set with the
FILE1 records in positions 1-300, blanks in all other positions up to 870, and a
sequence number in positions 871-878. The sequence number will be 1 for the first
FILE1 record, 2 for the second FILE1 record, and so on.
The second COPY operator creates reformatted records in the T1 data set with the
FILE2 records in positions 301-700, blanks in all other positions up to 870, and a
sequence number in positions 871-878. The sequence number will be 1 for the first
FILE2 record, 2 for the second FILE2 record, and so on.
The third COPY operator creates reformatted records in the T1 data set with the
FILE3 records in positions 701-850, blanks in all other positions up to 870, and a
sequence number in positions 871-878. The sequence number will be 1 for the first
FILE3 record, 2 for the second FILE3 record, and so on.
The fourth COPY operator creates reformatted records in the T1 data set with the
FILE4 records in positions 851-870, blanks in all other positions up to 850, and a
sequence number in positions 871-878. The sequence number will be 1 for the first
FILE4 record, 2 for the second FILE4 record, and so on.
Note that MOD is used for the T1 data set, so the reformatted records from FILE1,
FILE2, FILE3 and FILE4 will be output in that order in T1, ensuring that they are
sorted and spliced in that order.
The SPLICE operator sorts the records from T1 using the sequence number as the
ON field. With WITHEACH, the reformatted FILE1 records are treated as the base
records, and the reformatted FILE2, FILE3 and FILE4 records are treated as the
overlay records; each WITH field is associated with an overlay record in turn. So
the first WITH field specifies the bytes to be used from the second duplicate
694
SPLICE Operator
(FILE2 record), the second WITH field specifies the bytes to be used from the third
duplicate (FILE3 record) and the third WITH field specifies the bytes to be used
from the fourth duplicate (FILE4 record).
SPLICE matches each base and overlay record by their sequence numbers, and
creates a new combined 878-byte record. The OUTFIL statement in CTL5CNTL is
used to remove the sequence number so that the 870-byte spliced record is written
to the ALLRCDS data set.
695
SPLICE Operator
We copy the IN1 records to the T1 data set and add an identifier of '11' to show
they come from FILE1.
We copy the IN2 records to the end (MOD) of the T1 data set and add an identifier
of '22' to show they come from FILE2.
We sort the records of T1 on positions 1-3 and splice the second id byte for
matching records. We use KEEPNODUPS to keep non-duplicate records.
The records look like this after they are sorted, but before they are spliced:
Carrie
Carrie
Frank
Holly
Holly
Karen
Mary
Paul
Vicky
Vicky
11
22
11
11
22
22
22
11
11
22
The records look like this after they are spliced, but before we do the OUTFIL
processing specified by CTL3CNTL with USING(CTL3) for SPLICE:
Carrie
Frank
Holly
Karen
Mary
Paul
Vicky
12
11
12
22
22
11
12
OUT1 contains:
Frank
Paul
OUT2 contains:
Karen
Mary
696
SPLICE Operator
001 3 150
001 2 120
001 1 100
002 2 140
002 3 250
003 1 050
003 3 920
004 3 005
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
* Splice nonblank type 1 values (in 5-7), type 2 values (9-11)
* and type 3 values (13-15) for each key.
SPLICE FROM(IN) TO(OUT) ON(1,3,CH) WITHANY KEEPNODUPS WITH(5,3) WITH(9,3) WITH(13,3) USING(CTL1)
/*
//CTL1CNTL DD *
* Before SPLICE:
* Reformat type 1 records to:
* 1 5
* key val
INREC IFTHEN=(WHEN=(5,1,CH,EQ,C1),
BUILD=(1,3,5:8,3)),
* Reformat type 2 records to:
* 1
9
* key
val
IFTHEN=(WHEN=(5,1,CH,EQ,C2),
BUILD=(1,3,9:8,3)),
* Reformat type 3 records to:
* 1
13
* key
val
IFTHEN=(WHEN=(5,1,CH,EQ,C3),
BUILD=(1,3,13:8,3))
/*
3
2
1
2
3
1
3
3
150
120
100
140
250
050
920
005
We have a key (for example, '001') in positions 1-3, a record type (1, 2 or 3) in
position 5 and a numeric value in positions 8-10. We want to set up a single row
for each key with the values for the three record types and blanks for missing
record types.
Before we SPLICE the records, we use the INREC IFTHEN clauses to put the
values from the type 1 records in positions 5-7, the values from the type 2 records
in positions 9-11 and the values from the type 3 records in positions 13-15. The
reformatted INREC records look like this:
001
150
001
120
001 100
002
140
002
250
003 050
003
920
004
005
697
SPLICE Operator
We use SPLICE with WITHANY and appropriate WITH fields to create one
combined record for each key with the values for the record types. We use
KEEPNODUPS to keep records for keys with only one value (for example, '004').
The OUT records are 15 bytes long and look like this:
001 100 120 150
002
140 250
003 050
920
004
005
Note that if we used WITHEACH instead of WITHANY, the output would not be
what we wanted since record types are missing for some keys (for example, type 1
is missing for key 002), and record types are out of order for some keys (for
example, we have type 3, type 2 and type 1 in that order for key 001). With
WITHEACH, the OUT records would look like this:
001
002
003
004
150
140
005
698
SPLICE Operator
* Remove duplicate overlay records without matching base record.
* Remove base or overlay indicator.
OUTFIL FNAMES=OUT,OMIT=(33,1,CH,EQ,CV),OUTREC=(1,32)
/*
The base records are the records in MAST with an 'A' in column 1. They are
reformatted by the INREC statement as 33 byte records that look like this:
C0000
C1111
F00KRS
F11FLY
G000B
G111B
K002
K003
K004
K005
K006
K007
K008
K009
KRSH02L02
FLYH03L03
VQXH04L04
FLYH05L05
KHNH06L06
KRSH07L07
FLYH08L08
KHNH09L09
V
V
V
V
V
V
V
V
The spliced output records are 33 bytes long and look like this:
I000003C1111K003F11FLYH03L03G111B
I000005C1111K005F11FLYH05L05G111B
I000008C1111K008F11FLYH08L08G111B
I000009
K009
KHNH09L09
V
I000002C0000K002F00KRSH02L02G000B
I000007C0000K007F00KRSH07L07G000B
Note that the base record (type A) for FLY has been spliced together with each of
the three overlay records (type H) for FLY. Likewise, the base record (type A) for
KRS has been spliced together with each of the two overlay records (type H) for
KRS.
But also note that the overlay records (type H) for KHN have been spliced
together. Because KHN does not appear as a base record (type A) we don't want
the KHN records to appear in the OUT data set. So we will use the 'V' we put in
position 33 for the overlay records to identify and delete spliced overlay records
without a matching base record. We only have to do this if we have duplicate
Chapter 7. Using ICETOOL
699
SPLICE Operator
overlay records without a matching base record. Single overlay records without a
matching base record will be deleted automatically (unless you specify
KEEPNODUPS).
After we eliminate the spliced overlay records and the position 33 indicator, the
OUT records are 32 bytes long and look like this:
I000003C1111K003F11FLYH03L03G111
I000005C1111K005F11FLYH05L05G111
I000008C1111K008F11FLYH08L08G111
I000002C0000K002F00KRSH02L02G000
I000007C0000K007F00KRSH07L07G000
Note that if we had not specified WITHALL, only the first and last records for
each set of duplicates would have been spliced, producing the following output:
I000008C1111K008F11FLYH08L08G111
I000007C0000K007F00KRSH07L07G000
700
SPLICE Operator
The base records originate from the PULL data set (VAR.PULL.FILE). The PULL
data set has variable-length (VB) records with the RDW in positions 1-4 and the
variable-length City Name starting in position 5 for 1-20 bytes. Conceptually, the
PULL records look like this:
Length
12
12
11
15
|
|
|
|
|
Data
SAN JOSE
NEW YORK
DENVER
LOS ANGELES
The overlay records originate from the MASTER data set (FIXED.MASTER.FILE).
The MASTER data set has 40-byte fixed-length (FB) records with the City Name in
positions 1-20.
The PULL records are copied and reformatted to the TEMP1 data set as 41-byte
fixed-length (FB) records with the City Name in positions 1-20 (padded on the
right with blanks as necessary), and a 'P' in position 41 to identify them as PULL
records. The VTOF and OUTREC parameters of DFSORT's OUTFIL statement are
used to convert the VB records to FB records with blank padding. The reformatted
PULL records in TEMP1 look like this:
SAN JOSE
NEW YORK
DENVER
LOS ANGELES
P
P
P
P
The MASTER records are copied and reformatted to the end (MOD) of the TEMP1
data set as 41-byte fixed-length (FB) records with an 'M' added in position 41 to
identify them as MASTER records. The reformatted MASTER records in TEMP1
look like this:
SAN JOSE
PHOENIX
LOS ANGELES
SAN JOSE
NEW YORK
SAN JOSE
TUCSON
NEW YORK
PHOENIX
8630 SUSAN
7993 PAUL
9203 MICHAEL
0052 VICKY
5218 CARRIE
3896 FRANK
1056 LISA
6385 MICHAEL
5831 HOLLY
M
M
M
M
M
M
M
M
M
The base and overlay records from the TEMP1 data set are sorted and spliced.
The records look like this after they are sorted on the 1,20,CH field, but before
they are spliced. As a visual aid, the WITH fields in the overlay records are shown
in bold.
DENVER
LOS ANGELES
LOS ANGELES
NEW YORK
NEW YORK
NEW YORK
PHOENIX
PHOENIX
SAN JOSE
SAN JOSE
SAN JOSE
SAN JOSE
TUCSON
9203
MICHAEL
5218
6385
7993
5831
CARRIE
MICHAEL
PAUL
HOLLY
8630 SUSAN
0052 VICKY
3896 FRANK
1056 LISA
P
P
M
P
M
M
M
M
P
M
M
M
M
701
SPLICE Operator
LOS ANGELES
NEW YORK
NEW YORK
PHOENIX
SAN JOSE
SAN JOSE
SAN JOSE
9203
5218
6385
5831
8630
0052
3896
MICHAEL
CARRIE
MICHAEL
HOLLY
SUSAN
VICKY
FRANK
P
P
P
M
P
P
P
Finally, we use the OUTFIL statement for SPLICE to remove each spliced record
with an 'M' in position 41, because that represents a base record without a
matching overlay record. The OUTFIL statement also removes the 'P' indicator in
position 41 from each record, because it is not needed in the OUT data set.
Thus, for each MASTER record that matches a PULL record, we've overlaid the
PULL record with the MASTER record. This effectively selects all of the MASTER
records on the PULL list. The resulting OUT data set (FIXED.OUTPUT.FILE) has
the following 40-byte fixed-length records:
LOS
NEW
NEW
SAN
SAN
SAN
ANGELES
YORK
YORK
JOSE
JOSE
JOSE
9203
5218
6385
8630
0052
3896
MICHAEL
CARRIE
MICHAEL
SUSAN
VICKY
FRANK
702
SPLICE Operator
//CTL2CNTL DD *
* Add sequence number and M identifier to MASTER records.
OUTREC FIELDS=(1,40,41:SEQNUM,8,BI,49:CM)
/*
//CTL3CNTL DD *
* Eliminate MASTER records without matching PULL records.
OUTFIL FNAMES=TEMP2,OMIT=(49,1,CH,EQ,CM)
/*
//CTL4CNTL DD *
* Sort on sequence number and remove id and sequence number.
SORT FIELDS=(41,8,BI,A)
OUTREC FIELDS=(1,40)
/*
The resulting OUT data set (FIXED.OUTPUT.FILE) has the following 40-byte
fixed-length records:
SAN
LOS
SAN
NEW
SAN
NEW
JOSE
ANGELES
JOSE
YORK
JOSE
YORK
8630
9203
0052
5218
3896
6385
SUSAN
MICHAEL
VICKY
CARRIE
FRANK
MICHAEL
703
SPLICE Operator
* Eliminate records with O.
SPLICE FROM(COMBINED) TO(RPT) ON(1,12,CH) WITH(24,10) WITH(40,1) KEEPNODUPS USING(CTL3)
/*
//CTL1CNTL DD *
* Reformat ONHAND records with part in 1-12, Yes in 15-17
* and O in 40.
OUTREC FIELDS=(1:1,12,15:CYes,40:CO)
/*
//CTL2CNTL DD *
* Reformat NEEDED records with part in 1-12, No in 15-17,
* date in 24-33 and N in 40.
OUTREC FIELDS=(1:15,12,15:CNo,24:2,10,40:CN)
/*
//CTL3CNTL DD *
* Eliminate ONHAND parts that do not appear in NEEDED list.
* Create the report showing if needed parts are on-hand.
OUTFIL FNAMES=RPT,OMIT=(40,1,CH,EQ,CO),OUTREC=(1,33),
HEADER2=(1:Part,15:On-Hand,24:Needed by,/,
1:------------,15:-------,24:----------)
/*
The base records originate from the ONHAND data set and are copied and
reformatted to the COMBINED data set. We put an 'O' in position 40 to identify
these records as ONHAND records. The overlay records originate from the
NEEDED data set and are copied and reformatted to the COMBINED data set. We
put an 'N' in position 40 to identify these records as NEEDED records. Because
MOD is used for the COMBINED data set, it contains the reformatted ONHAND
records followed by the reformatted NEEDED records. The COMBINED records
are 40 bytes long and look like this:
P62
P62
G73
A27
L90
P63
A27
P62
A27
M92
L90
Blue
Red
Blue
Green
Red
Blue
Green
Blue
Blue
Yellow
Red
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
No
2003/05/07
2002/12/29
2003/03/17
2003/06/14
2002/12/18
O
O
O
O
O
O
N
N
N
N
N
The base and overlay records from the COMBINED data set are sorted and spliced.
The records look like this after they are sorted on the 1,12,CH field, but before
they are spliced. As a visual aid, the WITH fields in the overlay records are shown
in bold.
A27
A27
A27
G73
L90
L90
M92
P62
P62
P62
P63
Blue
Green
Green
Blue
Red
Red
Yellow
Blue
Blue
Red
Blue
No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
2003/03/17
2003/05/07
2002/12/18
2003/06/14
2002/12/29
N
O
N
O
O
N
N
O
N
O
O
The spliced output records are 40 bytes long and look like this:
704
SPLICE Operator
A27
A27
G73
L90
M92
P62
P62
P63
Blue
Green
Blue
Red
Yellow
Blue
Red
Blue
No
Yes
Yes
Yes
No
Yes
Yes
Yes
2003/03/17
2003/05/07
2002/12/18
2003/06/14
2002/12/29
N
N
O
N
N
N
O
O
On-Hand
------No
Yes
Yes
No
Yes
Needed by
---------2003/03/17
2003/05/07
2002/12/18
2003/06/14
2002/12/29
705
SPLICE Operator
* Add Yes for found and D for delete record.
COPY FROM(ONHAND) TO(COMBINED) USING(CTL1)
* Reformat the NEEDED records for splicing.
* Add No for missing and K for keep record.
COPY FROM(NEEDED) TO(COMBINED) USING(CTL2)
* Splice ONHAND and NEEDED records.
* Splice in Requested by, Ship to and id fields.
* Eliminate spliced records with D.
SPLICE FROM(COMBINED) TO(TEMP1) ON(1,12,CH) WITHALL KEEPBASE KEEPNODUPS USING(CTL3) WITH(24,10) WITH(53,13) WITH(66,1)
* Print report.
DISPLAY FROM(TEMP1) LIST(RPT) INDENT(2) BETWEEN(2) BLANK HEADER(Part) ON(1,12,CH) HEADER(On-Hand) ON(15,3,CH) HEADER(Requested by) ON(24,12,CH) HEADER(Ship from) ON(38,13,CH) HEADER(Ship to) ON(53,13,CH)
/*
//CTL1CNTL DD *
* Reformat ONHAND records with Part in 1-12, Yes for found in
* 15-17, From City in 38-50 and D in 66.
OUTREC FIELDS=(1:1,12,15:CYes,38:20,13,66:CD)
/*
//CTL2CNTL DD *
* Reformat NEEDED records with Part in 1-12, No for missing in
* 15-17, Requester Name in 24-35, n/a for From City in 38-40,
* To City in 53-65 and K in 66.
OUTREC FIELDS=(1:15,12,15:CNo ,24:2,10,38:Cn/a,
53:31,13,66:CK)
/*
//CTL3CNTL DD *
* Eliminate ONHAND parts that do not appear in NEEDED list.
OUTFIL FNAMES=TEMP1,OMIT=(66,1,CH,EQ,CD)
/*
The base records originate from the ONHAND data set. They are copied and
reformatted to the COMBINED data set. The reformatted records look like this:
P62 Blue
G73 Blue
A27 Green
Yes
Yes
Yes
Dallas
San Jose
Vancouver
D
D
D
The overlay records originate from the NEEDED data set and are copied and
reformatted to the COMBINED data set. The reformatted records look like this
A27
P62
A27
M92
M92
A27
Green
Blue
Blue
Yellow
Yellow
Green
No
No
No
No
No
No
Rachel
Monica
Phoebe
Chandler
Joey
Ross
n/a
n/a
n/a
n/a
n/a
n/a
Phoenix
Phoenix
Toronto
Los Angeles
Paris
Paris
K
K
K
K
K
K
The base and overlay records from the COMBINED data set are sorted and spliced.
However, we need to make sure that all parts which appear in more than one
NEEDED record, but do not appear in the ONHAND list, will appear in the
report. For example, we have two M92 Yellow parts in the NEEDED data set that
do not appear in the ONHAND data set. These two records are reformatted and
appear in the COMBINED data set as follows:
M92 Yellow
M92 Yellow
706
No
No
Chandler
Joey
n/a
n/a
Los Angeles
Paris
K
K
SPLICE Operator
ICETOOL would normally treat the first record as the base record and the second
record as the overlay record. As a result, these two records would be spliced
together into one record instead of two. To prevent this, and ensure that we keep
both M92 Yellow parts, we must specify KEEPBASE. As a result, two records are
kept: the unchanged first M92 Yellow record, and the spliced first and second M92
Yellow records (which in this case looks identical to the unspliced second record).
The records look like this after they are sorted on the 1,12,CH field, but before
they are spliced. As a visual aid, the WITH fields in the overlay records are shown
in bold.:
A27
A27
A27
A27
G73
M92
M92
P62
P62
Blue
Green
Green
Green
Blue
Yellow
Yellow
Blue
Blue
No
Yes
No
No
Yes
No
No
Yes
No
Phoebe
Rachel
Ross
Chandler
Joey
Monica
n/a
Vancouver
n/a
n/a
San Jose
n/a
n/a
Dallas
n/a
Toronto
Phoenix
Paris
Los Angeles
Paris
Phoenix
K
D
K
K
D
K
K
D
K
Blue
Green
Green
Green
Blue
Yellow
Yellow
Blue
Blue
No
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Phoebe
Rachel
Ross
Chandler
Joey
Monica
n/a
Vancouver
Vancouver
Vancouver
San Jose
n/a
n/a
Dallas
Dallas
Toronto
Phoenix
Paris
Los Angeles
Paris
Phoenix
K
D
K
K
D
K
K
D
K
Records with 'D' are not needed, so we use the OUTFIL statement for SPLICE to
omit them. The TEMP1 records look like this:
A27
A27
A27
M92
M92
P62
Blue
Green
Green
Yellow
Yellow
Blue
No
Yes
Yes
No
No
Yes
Phoebe
Rachel
Ross
Chandler
Joey
Monica
n/a
Vancouver
Vancouver
n/a
n/a
Dallas
Toronto
Phoenix
Paris
Los Angeles
Paris
Phoenix
K
K
K
K
K
K
Although we could have used the OUTFIL statement for SPLICE to print the
report, we've chosen instead to use a separate DISPLAY operator. DISPLAY
requires an extra pass over the spliced records in TEMP1, but is easier to use than
OUTFIL for reports. The resulting RPT data set looks like this:
Part
-----------A27 Blue
A27 Green
A27 Green
M92 Yellow
M92 Yellow
P62 Blue
707
SPLICE Operator
//S10 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=VAR.INPUT1,DISP=SHR
//
DD DSN=VAR.INPUT2,DISP=SHR
//OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE),
//
SPACE=(CYL,(5,5)),UNIT=SYSDA
//TOOLIN DD *
* Splice the needed data from the two VB files together
SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL WITH(12,5) WITH(22,20) VLENMAX
/*
VAR.INPUT1 has RECFM=VB and LRECL=25. It contains the base records which
look like this:
Length
25
15
25
25
|
|
|
|
|
Data
DIV01
DIV02
DIV03
DIV05
L2
L6
L8
|
|
|
|
|
|
|
Data
DIV01
DIV01
DIV02
DIV05
DIV05
DIV06
83201
73268
00589
57003
01381
37982
Because some of the overlay records are longer than their corresponding base
records, we use VLENMAX to ensure that none of the data from the overlay
records is lost. VLENMAX ensures that the larger length between the base record
and overlay record is used for the spliced record, and that blanks are added to the
end of the spliced record when needed.
The base and overlay records from the concatenated data sets are sorted and
spliced. VAR.OUTPUT has RECFM=VB and LRECL=50. It contains the spliced
records, which look like this:
Length
42
33
39
25
47
|
|
|
|
|
|
Data
DIV01
DIV01
DIV02
DIV05
DIV05
83201
73268
00589
57003
01381
L2
L2
L8
L8
Notice that VLENMAX prevented any data from being lost. Without VLENMAX,
data would have been lost; the spliced records would have looked like this:
Length
25
25
15
25
25
|
|
|
|
|
|
Data
DIV01
DIV01
DIV02
DIV05
DIV05
83201
73268
0058
57003
01381
L2
L2
FERN
ROSS
L8
L8
FLOW
STATS operator
708
STATS Operator
STATS FROM(indd)
ON(p,m,f)
ON(VLEN)
VSAMTYPE(x)
LMSG
Prints messages containing the minimum, maximum, average, and total for
specified numeric fields. From 1 to 10 fields can be specified.
DFSORT is called to copy the indd data set to ICETOOL's E35 user exit. ICETOOL
prints messages containing the minimum, maximum, average, and total for each
field as determined by its E35 exit.
The average (or mean) is calculated by dividing the total by the record count and
rounding down to the nearest integer (examples: 23 / 5 = 4, -23 / 5 = - 4).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement,
because they would override the DFSORT statements passed by ICETOOL for this
operator.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ON(p,m,f)
Specifies the position, length, and format of a numeric field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3
4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as follows:
Format Code
Length
Description
BI
1 to 8 bytes
Unsigned binary
FI
1 to 8 bytes
Signed fixed-point
PD
1 to 16 bytes
ZD
1 to 31 bytes
CSF or FS
UFF
SFF
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
Chapter 7. Using ICETOOL
709
STATS Operator
If the total for a field overflows 31 digits, ICETOOL continues processing, but
prints asterisks for the average and total for that field.
For a CSF, FS, UFF, or SFF format field:
v A maximum of 31 digits is allowed. If a value with more than 31 digits is
found, ICETOOL issues an error message and terminates the operation.
For a ZD or PD format field:
v If a decimal value contains an invalid digit (A-F), ICETOOL identifies the
bad value in a message and prints asterisks for the minimum, maximum,
average and total for that field.
v A value is treated as positive if its sign is F, E, C, A, 8, 6, 4, 2, or 0.
v A value is treated as negative if its sign is D, B, 9, 7, 5, 3, or 1.
For a ZD, PD, CSF, FS, or SFF format field, a negative zero value is treated as a
positive zero value.
ON(VLEN)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
LMSG
Specifies that the minimum, maximum, average and total for all numeric fields
are to be printed using messages that display 31 digits (overriding the default
of printing messages that display 15 digits when possible). LMSG ensures that
only message ICE648I is used to display the statistics. Without LMSG, a
combination of messages ICE608I, ICE609I and ICE648I can be used to display
the statistics.
STATS example
STATS
FROM(DATA1)
ON(VLEN)
ON(15,4,ZD)
Prints messages containing the minimum, maximum, average and total of the
binary values in positions 1-2 of the DATA1 data set. For variable-length records,
this gives statistics about the length of the records. Prints messages containing the
minimum, maximum, average and total of the zoned decimal values in positions
15-18 of the DATA1 data set.
SUBSET operator
SUBSET FROM(indd)
TO(outdd)
DISCARD(savedd)
TO(outdd) DISCARD(savedd)
KEEP
REMOVE
HEADER
FIRST
HEADER(u)
FIRST(u)
710
INPUT
OUTPUT
TRAILER
LAST
TRAILER(v)
LAST(v)
RRN(q)
RRN(q,r)
RRN(r,q)
RRN(q,*)
USING(xxxx)
SUBSET Operator
VSAMTYPE(x)
Keeps or removes input or output records based on meeting criteria for the first n
records, specific relative record numbers, and the last n records. DFSORT writes
the records that are kept or not removed to the outdd data set.
DFSORT is called to copy or sort the indd data set, as appropriate. ICETOOL uses
its E15 or E35 exit to determine which records to include in the outdd or savedd
data set. ICETOOL passes the EQUALS option to DFSORT to ensure that
duplicates are kept in their original input order if records are sorted.
If the criteria includes the last n records, ICETOOL may call DFSORT twice. For
the first pass, ICETOOL counts the indd records without opening the output data
sets. For the second pass, ICETOOL opens the output data sets and does SUBSET
processing against the indd data set using the count obtained in the first pass.
DISCARD(savedd) can be used to write the records that are removed or not kept
in the savedd data set. DISCARD(savedd) can be used with or without TO(outdd).
If you do not specify a header operand (HEADER, FIRST, HEADER(u), FIRST(u)),
a relative record number operand (RRN(q), RRN(q,r), RRN(q,*)), or a trailer
operand (TRAILER, LAST, TRAILER(v), LAST(v)), all of the records will be kept or
removed. You can specify a header operand, relative record number operands, and
a trailer operand in any combination. Records will be kept or removed according
to the criteria you specify.
You can only specify one header operand. You can specify from 1 to 300 relative
record number operands in any combination. You can only specify one trailer
operand.
The DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified.
However, you must observe these rules for control statements in the xxxxCNTL
data set:
v MODS and OUTREC statements should not be present.
v SKIPREC and STOPAFT operands, and INCLUDE and OMIT statements, should
not be present.
v A SORT statement can be present unless INPUT and DISCARD(savedd) are
specified.
v INREC and SUM statements can be present.
v If INPUT is specified, the records selected will not be affected by INREC, SORT
or SUM. If OUTPUT is specified, the records selected will be affected by INREC,
SORT and SUM.
v Comment statements can be present.
v If you specify TO(outdd) without DISCARD(savedd), you can further process
the outdd records after SUBSET processing using an OUTFIL statement like this:
OUTFIL FNAMES=outdd,...
711
SUBSET Operator
v If you specify DISCARD(savedd) without TO(outdd), you can further process
the savedd records after SUBSET processing using one (and only one) OUTFIL
statement like this:
OUTFIL FNAMES=savedd,...
v If you specify TO(outdd) and DISCARD(savedd), you can further process the
outdd and savedd records after SUBSET processing using two (and only two)
OUTFIL statements like this:
OUTFIL FNAMES=outdd,...
Both statements must be specified in the order shown with at least the FNAMES
parameter. For example, to further modify only the DISCARD data set, you
could use statements like this:
OUTFIL FNAMES=OUT
OUTFIL FNAMES=SAVE,OMIT=(21,3,ZD,GT,+25)
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
TO(outdd)
Specifies the ddname of the output data set to which DFSORT will write the
records it selects for the operation (that is, the records that are kept or not
removed according to the specified criteria).
An outdd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's SORTOUT data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the TO operand must not be the same as the ddname
specified in the FROM or DISCARD operand.
Refer to JCL restrictions on page 573 for more information.
DISCARD(savedd)
Specifies the ddname of the output data set to which DFSORT will write the
records it does not select for the operation.
712
SUBSET Operator
A savedd DD statement must be present and must define an output data set
that conforms to the rules for DFSORT's OUTFIL data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must
be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the DISCARD operand must not be the same as the
ddname specified in the FROM or TO operand.
Refer to JCL restrictions on page 573 for more information.
KEEP
Specifies that the records that meet the criteria are to be kept.
REMOVE
Specifies that the records that meet the criteria are to be removed.
INPUT
Specifies that the criteria are to be applied using the first n input records,
relative input record numbers, and the last n input records. Use INPUT if you
want to apply the criteria directly to the records from the indd data set.
The criteria will be applied to keep or remove records before they are
reformatted by INREC, sorted by SORT and summed by SUM. The kept
records will subsequently be reformatted, sorted and summed. OUTFIL will be
applied to the resulting records.
As an example, if the input data set contains these records:
AAAA
AAAA
BBBB
CCCC
CCCC
CCCC
DDDD
DDDD
EEEE
EEEE
EEEE
R01
R02
R03
R04
R05
R06
R07
R08
R09
R10
R11
and the following SUBSET operator and DFSORT control statements were
specified:
...
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(3,10) USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(1,5,CH,D)
SUM FIELDS=NONE
/*
First, input records 3-10 would be kept, so the intermediate result would be:
BBBB
CCCC
CCCC
CCCC
DDDD
DDDD
EEEE
EEEE
R03
R04
R05
R06
R07
R08
R09
R10
Then the SORT statement would be applied, so the intermediate result would
be:
713
SUBSET Operator
EEEE
EEEE
DDDD
DDDD
CCCC
CCCC
CCCC
BBBB
R09
R10
R07
R08
R04
R05
R06
R03
Finally, the SUM statement would be applied, so the final output in the OUT
data set would be:
EEEE
DDDD
CCCC
BBBB
R09
R07
R04
R03
OUTPUT
Specifies that the criteria are to be applied using the first n output records,
relative output record numbers, and the last n output records. Use OUTPUT if
you want to apply the criteria to the indd records after they are processed by
INREC, SORT and SUM as specified.
The criteria will be applied to keep or remove records after they are
reformatted by INREC, sorted by SORT and summed by SUM. OUTFIL will be
applied to the resulting records.
As an example, if the input data set contains these records:
AAAA
AAAA
BBBB
CCCC
CCCC
CCCC
DDDD
DDDD
EEEE
EEEE
EEEE
R01
R02
R03
R04
R05
R06
R07
R08
R09
R10
R11
and the following SUBSET operator and DFSORT control statements were
specified:
...
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP OUTPUT RRN(2,3) USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(1,5,CH,D)
SUM FIELDS=NONE
/*
First, the SORT statement would be applied, so the intermediate result would
be:
EEEE
EEEE
EEEE
DDDD
DDDD
CCCC
CCCC
CCCC
BBBB
AAAA
AAAA
714
R09
R10
R11
R07
R08
R04
R05
R06
R03
R01
R02
SUBSET Operator
Then the SUM statement would be applied, so the intermediate result would
be:
EEEE
DDDD
CCCC
BBBB
AAAA
R09
R07
R04
R03
R01
Finally, output records 2-3 would be kept, so the final output in the OUT data
set would be:
DDDD R07
CCCC R04
HEADER or FIRST
Specifies one header record (the first record) is to be kept or removed.
HEADER and FIRST are equivalent to HEADER(1) and FIRST(1).
HEADER(u) or FIRST(u)
Specifies u header records (the first u records) are to be kept or removed. For
example, HEADER(3) or FIRST(3) keeps or removes the first three records.
u must be specified as n or +n where n can be 1 to 999999999999999.
TRAILER or LAST
Specifies one trailer record (the last record) is to be kept or removed.
TRAILER and LAST are equivalent to TRAILER(1) and LAST(1).
TRAILER(v) or LAST(v)
Specifies v trailer records (the last v records) are to be kept or removed. For
example, TRAILER(4) or LAST(4) keeps or removes the last 4 records.
v must be specified as n or +n where n can be 1 to 999999999999999.
RRN(q)
Specifies relative record number q is to be kept or removed. For example,
RRN(8) keeps or removes the eighth record.
q must be specified as n or +n where n can be 1 to 999999999999999.
RRN(q,r) or RRN(r,q)
Specifies relative record numbers q through r are to be kept or removed. q can
be less than, equal to, or greater than r. For example, RRN(5,10) and RRN(10,5)
both keep or remove the fifth through tenth records.
q and r must be specified as n or +n where n can be 1 to 99999999999999.
RRN(q,*)
Specifies relative record numbers q through the last record are to be kept or
removed. For example, RRN(7,*) keeps or removes the seventh through last
records.
q must be specified as n or +n where n can be 1 to 99999999999999.
Note: RRN(*,q) is not valid
USING(xxxx)
Specifies the first 4 characters of the ddname for the control statement data set
to be used by DFSORT for this operation. xxxx must be four characters that are
valid in a ddname of the form xxxxCNTL. xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present. Control
statements in xxxxCNTL can be used as described for "SUBSET Operator" on
page xxx, and must conform to the rules for DFSORT's SORTCNTL data set.
Chapter 7. Using ICETOOL
715
SUBSET Operator
VSAMTYPE(x)
See the discussion of this operand on the COPY statement in COPY operator
on page 575.
SUBSET examples
Although the SUBSET operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
Example 1
SUBSET FROM(IN1) TO(OUT1) REMOVE INPUT HEADER TRAILER
This example shows how you can remove the header record (first record) and
trailer record (last record).
The variable-length input records look like this:
Len|Data
33|01A
23|01A
26|02B
22|03A
24|04B
21|01A
RODENTS
VOLE
HAMSTER
RAT
MOUSE
COUNT
FFFFF
BINKY
GARFIELD
JUNE
MICKEY
004
We just want to keep the data records. We use REMOVE, INPUT, HEADER and
TRAILER to indicate we want to remove the header and trailer input records.
The output records would look like this:
23|01A
26|02B
22|03A
24|04B
VOLE
HAMSTER
RAT
MOUSE
BINKY
GARFIELD
JUNE
MICKEY
Note that we could use FIRST and LAST instead of HEADER and TRAILER.
Example 2
SUBSET FROM(IN2) TO(OUT2) DISCARD(OUT3) KEEP INPUT RRN(3,4) LAST(3)
This example shows how you can create one output file with relative records and
the last n records, and another output file with the remaining records.
The input records look like this:
Algebra
Astronomy
Biology
Calculus
French
Geography
Geometry
Greek
History
Latin
Psychology
Russian
In the first output file (OUT2), we want the third and fourth input records and the
last three input records. In the second output file (OUT3), we want the records that
are not in the first output file. We use TO(OUT2) and DISCARD(OUT3) for the two
716
SUBSET Operator
output files. We use KEEP, INPUT, RRN(3,4) and LAST(3) to indicate we want to
keep relative input records 3 and 4 and the last 3 input records.
The OUT2 records would look like this:
Biology
Calculus
Latin
Psychology
Russian
Example 3
SUBSET FROM(IN3) TO(OUT4) KEEP OUTPUT LAST(5) USING(CTL1)
This example illustrates how you can keep the last 5 sorted records.
The CTL1CNTL data set contains:
SORT FIELDS=(1,15,CH,A)
We want to sort the records by the CH field in positions 1-15 and keep the last 5
sorted records. We use KEEP, OUTPUT and LAST(5) to keep the last 5 output
records. We use the SORT statement to sort the records before they are output.
After the SORT statement is executed, the intermediate records look like this:
Algebra
Astronomy
Biology
Calculus
French
Geography
Geometry
Greek
History
Latin
Psychology
Russian
717
SUBSET Operator
After the SUBSET operator is executed, the final output records look like this:
Greek
History
Latin
Psychology
Russian
UNIQUE operator
UNIQUE FROM(indd)
ON(p,m,f)
ON(VLEN)
VSAMTYPE(x)
UZERO
Prints a message containing the count of unique values for a specified numeric or
character field.
DFSORT is called to sort the indd data set to ICETOOL's E35 user exit. ICETOOL
prints a message containing the unique count as determined by its E35 user exit.
The DYNALLOC option is passed to DFSORT to ensure that work space is
available for the sort. If your installation defaults for dynamic allocation are
inappropriate for a UNIQUE operator, you can take one of the following actions:
1. Override the DYNALLOC option using an OPTION control statement such as:
OPTION DYNALLOC=(8)
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ON(p,m,f)
Specifies the position, length, and format of a numeric or character field to be
used with this operation.
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
718
UNIQUE Operator
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3
4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as shown in the following table:
Format Code
Length
Description
BI
1 to 256 bytes
Unsigned binary
FI
1 to 256 bytes
Signed fixed-point
PD
1 to 32 bytes
ZD
1 to 32 bytes
CH
1 to 4000 bytes
Character
CSF or FS
1 to 32 bytes
UFF
1 to 44 bytes
SFF
1 to 44 bytes
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
UNIQUE example
UNIQUE FROM(DATAIN)
UNIQUE FROM(DATAIN)
ON(20,40,CH)
ON(5,3,ZD)
The first UNIQUE operator prints a message containing the count of unique
character data in positions 20-59 of the DATAIN data set.
The second UNIQUE operator prints a message containing the count of unique
zoned decimal values in positions 5-7 of the DATAIN data set.
719
VERIFY Operator
VERIFY operator
NOSIGN
LIMIT(n)
VSAMTYPE(x)
Examines particular decimal fields in a data set and prints a message identifying
each invalid value found for each field. From 1 to 10 fields can be specified.
DFSORT is called to copy the indd data set to ICETOOL's E35 user exit. ICETOOL
uses its E35 user exit to examine the digits and sign of each value for validity, and
for each invalid value found, prints an error message containing the record
number and field value (in hexadecimal).
You must not supply your own DFSORT MODS, INREC, or OUTREC statement,
because they would override the DFSORT statements passed by ICETOOL for this
operator.
Note:
1. Values with invalid decimal digits are also identified for the DISPLAY, OCCUR,
RANGE, and STATS operators.
2. The DISPLAY operator can be used to print a report identifying the relative
record number, hexadecimal value, and associated fields for each invalid (and
valid) decimal value, as shown in Example 9 under DISPLAY operator on
page 594.
Operand descriptions
The operands described in this section can be specified in any order.
FROM(indd)
See the discussion of this operand on the DISPLAY statement in DISPLAY
operator on page 594.
ON(p,m,f)
Specifies the position, length, and format of a decimal field to be used for this
operation.
p specifies the first byte of the field relative to the beginning of the input
record. p is 1 for the first data byte of a fixed-length record and 5 for the first
data byte of a variable-length record as illustrated in the following (RRRR
represents the 4-byte record descriptor word):
Fixed-length record
|
Variable-length record
| D | A | T | A | ... |
| R | R | R | R | D | A | T | A | ...
p= 1 2 3 4
| p=
1
2
3
4
5
6
7
8
m specifies the length of the field in bytes. A field must not extend beyond
position 32752 or beyond the end of a record. The maximum length for a field
depends on its format.
f specifies the format of the field as shown later in this section:
720
VERIFY Operator
Format Code
Length
Description
PD
1 to 16 bytes
ZD
1 to 31 bytes
Note: See Appendix C, Data format descriptions, on page 891 for detailed format
descriptions.
VERIFY example
VERIFY FROM(NEW) ON(22,16,PD) ON(7,9,ZD)
VERIFY FROM(NEW) ON(22,16,PD) ON(7,9,ZD) NOSIGN LIMIT(10)
The first VERIFY operator checks for invalid digits (A-F) and invalid signs (0-9) in
the packed decimal values from positions 22-37 and the zoned decimal values from
positions 7-15 of the NEW data set. A message is printed identifying each value (if
any) that contains an invalid digit or sign. If 200 invalid values are found, the
operation is terminated.
The second VERIFY operator checks for invalid digits (A-F) in the packed decimal
values from positions 22-37 and the zoned decimal values from positions 7-15 of
the NEW data set. A message is printed identifying each value (if any) that
contains an invalid digit. If 10 invalid values are found, the operation is
terminated.
Note: The DISPLAY operator can be used to print a report identifying the relative
record number, hexadecimal value, and associated fields for each invalid (and
valid) decimal value, as shown in Example 9 under DISPLAY operator on page
594.
721
TOOLIN interface
With the TOOLIN Interface, you supply ICETOOL statements in the TOOLIN data
set. ICETOOL prints messages in the TOOLMSG data set, but does not return
information directly to your program.
To use the TOOLIN interface, set a value of 0 in register 1, or place the address of
a 4-byte field containing X'80000000' in register 1, before calling ICETOOL as
follows:
...
SLR
R1,R1
LINK EP=ICETOOL
...
LA
R1,NOPLIST
LINK EP=ICETOOL
...
NOPLIST DC
X80,AL3(0)
...
Register 1
Flags
Statement Area 1 Address
Return Area 1 address
722
Explanation of fields
Flags
Bit 0 = 0:
Use the Parameter List Interface. Process ICETOOL statements from
this parameter list and return information to this parameter list. Ignore
TOOLIN.
Bit 0 = 1:
Use the TOOLIN Interface. Process ICETOOL statements from
TOOLIN. Ignore this parameter list.
Bits 1-31:
Reserved. Must be set to zero to ensure future extendability.
Statement Area Address and Statement Area
Each statement area address gives the location of a statement area that
describes an ICETOOL operation to be performed. If the statement area
address is 0, ICETOOL ignores this statement area/return area pair. Otherwise,
the statement area address must point to a statement area in the following
format:
v A 2-byte length field containing the length of the statement area for this
operation. If this field is 0, ICETOOL ignores this statement area/return area
pair.
v One or more 80-character ICETOOL statement images in the format
described in ICETOOL statements on page 574. Each statement area must
have one operator statement. Comment and blank statements before the
operator statement are processed. Comment, blank, and additional operator
statements after the end of the first operator statement are ignored.
Return Area Address and Return Area
Each return area address gives the location of a return area in which ICETOOL
is to return operation-specific information for the operation described in the
corresponding statement area. If the return area address is 0, ICETOOL does
not return any information for this operation. Otherwise, the return area
address must point to a return area in the following general format:
v A 2-byte length field containing the length of the return area for this
operation. If this field is 0, ICETOOL does not return any information for
this operation.
v A 1-byte operation status indicator which is set by ICETOOL as follows:
0=
This operation was not run (for example, scan mode was in effect) or
did not complete with return code 0 or 4. Operation-specific values
(see the following bullet) were not returned.
v Operation-specific values. Each count value returned by ICETOOL is an
8-byte packed decimal value with a C for a positive sign or a D for a
negative sign. For a STATS operator, each minimum, maximum, average and
total value returned by ICETOOL is a 16-byte packed decimal value with a
4=
723
724
Operation-Specific Values
Returned
COPY
None
COUNT
DATASORT
None
DEFAULTS
None
DISPLAY
MERGE
None
MODE
None
OCCUR
17
RANGE
17
RESIZE
None
SELECT
17
SORT
None
SPLICE
17
STATS
64*n+9
SUBSET
None
UNIQUE
17
VERIFY
725
DEPTVIEW CSECT
...
* SET UP PARAMETER LIST AND CALL ICETOOL
LA
R1,PARLST
LOAD ADDRESS OF PARAMETER LIST
LINK EP=ICETOOL
CALL ICETOOL
LTR R15,R15
IF ANY OPERATIONS WERE NOT SUCCESSFUL,
BNZ CKSTAT1
DETERMINE WHICH ONE FAILED
* ALL OPERATIONS WERE SUCCESSFUL
* CHECK EMPLOYEES PER DEPARTMENT AGAINST ACCEPTABLE LEVEL
CP
RT2AVG1,EMAVGCK
IF AVERAGE IS ACCEPTABLE,
BNH CKQUAL
NO MESSAGE IS NEEDED
* ISSUE A MESSAGE SHOWING AVERAGE, MINIMUM, MAXIMUM, AND
* TOTAL NUMBER OF EMPLOYEES PER DEPARTMENT.
...
* CHECK EXPENSES PER DEPARTMENT AGAINST ACCEPTABLE LEVEL
CKQUAL CP
RT2AVG2,TLAVGCK
IF AVERAGE IS ACCEPTABLE,
BNH PCTCALC
NO MESSAGE IS NEEDED
* ISSUE A MESSAGE SHOWING AVERAGE, MINIMUM, MAXIMUM, AND
* TOTAL EXPENSES PER DEPARTMENT.
...
* CALCULATE THE PERCENTAGE OF DEPARTMENTS OVER/UNDER EMPLOYEE LIMIT
PCTCALC MVC WORK+2(4),RT3RCDS+4 COPY NUMBER OF DEPARTMENTS
SP
WORK+2(4),RT3RNG+4(4) SUBTRACT NUMBER WITHIN LIMITS TO
*
GET NUMBER OVER/UNDER LIMIT
CP
WORK+2(4),P0
IF NONE OVER/UNDER LIMIT,
BE
PCTPRT
PERCENTAGE IS ZERO
MP
WORK+2(4),P100
MULTIPLY NUMBER OVER/UNDER BY 100
DP
WORK(6),RT3RCDS+4(4) DIVIDE BY NUMBER OF DEPARTMENTS
* ISSUE A MESSAGE SHOWING THE PERCENTAGE OF DEPARTMENTS THAT ARE
* OVER/UNDER EMPLOYEE LIMIT
PCTPRT UNPK PCTVAL,WORK(2)
CONVERT AVERAGE TO PRINTABLE EBCDIC
OI
PCTVAL+2,XF0
ENSURE LAST DIGIT IS PRINTABLE
...
* ONE OR MORE OPERATIONS FAILED
CKSTAT1 CLI RT1STAT,0
IF OPERATION 1 WORKED,
BNE CKSTAT2
CHECK OPERATION 2
* ISSUE MESSAGE: OPERATION 1 FAILED - CHECK TOOLMSG
...
* PARAMETER LIST
PARLST DC
A(0)
USE PARAMETER LIST INTERFACE
DC
A(ST1A)
STATEMENT AREA 1 ADDRESS
DC
A(RT1A)
RETURN AREA 1 ADDRESS
DC
A(ST2A)
STATEMENT AREA 2 ADDRESS
DC
A(RT2A)
RETURN AREA 2 ADDRESS
DC
A(ST3A)
STATEMENT AREA 3 ADDRESS
DC
A(RT3A)
RETURN AREA 3 ADDRESS
DC
F.*-1
END OF PARAMETER LIST* OPERATOR STATEMENT AREAS
726
* COPY OPERATION
ST1A
DC
AL2(ST1E-ST1)
LENGTH OF STATEMENT AREA 1
ST1
DC
CL80* CREATE TWO COPIES OF THE DENVER SITE
DC
CL80* DEPARTMENT RECORDS
DC
CL80COPY FROM(IN) TO(OUT1,OUT2) USING(CTL1)
ST1E
EQU *
* STATS OPERATION
ST2A
DC
AL2(ST2E-ST2)
LENGTH OF STATEMENT AREA 2
ST2
DC
CL80* GET STATISTICS FOR NUMBER OF EMPLOYEES
DC
CL80* AND TRAVEL EXPENSES PER DEPARTMENT
DC
CL80STATS FROM(OUT1) ON(15,2,PD) ON(28,8,ZD)
ST2E
EQU *
* RANGE OPERATION
ST3A
DC
AL2(ST3E-ST3)
LENGTH OF STATEMENT AREA 3
ST3
DC
CL80* DETERMINE THE NUMBER OF DEPARTMENTS THAT ARE
DC
CL80* WITHIN THE LIMIT FOR NUMBER OF EMPLOYEES
DC
CL80RANGE FROM(OUT1) ON(15,2,PD) -
DC
CL80 HIGHER(10) LOWER(21)
ST3E
EQU *
* RETURN AREAS
COPY OPERATION
RT1A
DC
AL2(RT1E-RT1STAT) LENGTH OF RETURN AREA 1
RT1STAT DS
C
OPERATION STATUS
RT1E
EQU *
* STATS OPERATION
RT2A
DC
AL2(RT2E-RT2STAT) LENGTH OF RETURN AREA 2
RT2STAT DS
C
OPERATION STATUS
RT2RCDS DS
PL8
COUNT OF RECORDS PROCESSED
z/OS V2R2 DFSORT Application Programming Guide
RT2MIN1 DS
PL16
FIELD 1 - MINIMUM VALUE
RT2MAX1 DS
PL16
FIELD 1 - MAXIMUM VALUE
RT2AVG1 DS
PL16
FIELD 1 - AVERAGE VALUE
RT2TOT1 DS
PL16
FIELD 1 - TOTAL VALUE
you cause DFSORT to abend when it issues an error message, thus preventing
ICETOOL from performing subsequent operators.
v Tape work data sets cannot be used with ICETOOL.
v An ON field must not include bytes beyond the fixed part of variable length
input records. The entire field specified must be present in every input record,
otherwise, DFSORT issues message ICE015A, ICE218A, or ICE027A and
terminates.
v
Chapter 7. Using ICETOOL
727
v
v
728
12
16
Message data set error. The TOOLMSG DD statement was not present or
the TOOLMSG data set was not opened.
24
729
730
731
DFSORT example
The example in this section shows the JCL and control statements for a simple
DFSORT job that uses symbols.
Let's say you created a symbols data set named MY.SYMBOLS that contains the
following SYMNAMES statements:
* Fields
First_Name,6,20,CH
Last_Name,*,=,=
Account_Number,53,3,PD
SKIP,2
Balance,*,6,ZD
Type,*,8,CH
* Constants
Loan,LOAN
Check,CHECKING
Level1,50000
Level2,-100
This example is only meant to give you a quick overview of how symbols can be
used. The rest of this chapter will explain all of the details, but here are a few
important things to take note of:
v The SYMNAMES DD indicates you want DFSORT or ICETOOL to do symbol
processing. The SYMNAMES data set contains the symbols for fields and
constants.
v DFSORT or ICETOOL will print your original symbols and the symbol table
constructed from them in the SYMNOUT data set, if you specify it. You might
want to use SYMNOUT while debugging a set of symbols and then remove it,
or you might want to keep SYMNOUT permanently so you can always see your
original symbols and the symbol table.
v The simple, yet flexible, format for SYMNAMES statements is:
symbol,value remark
where value can represent a field (p,m,f or p,m or p), a parsed field (%nn), or a
constant (C'string', c'string', 'string', S'string', s'string', X'string', x'string', B'string',
b'string', n, +n or -n). Leading blanks are allowed before symbol so indentation
can be used. For example, the following SYMNAMES statements could be
specified:
732
Division 1 Department
Research Departments
Marketing Departments
Development Departments
v Symbols are case-sensitive: Frank, FRANK and frank are three different
symbols.
v An asterisk (*) can be used to assign the next position to p. For example:
Symbola,6,20,CH
Symbolb,*,5,BI
Symbolc,*,12,ZD
By using * for p, you can map consecutive fields in your records without having
to compute their actual positions.
v SKIP,n can be used to advance the next position by n bytes so it can be used for *.
For example:
Symbola,6,20,CH
SKIP,2
Symbolb,*,5,BI
SKIP,n gives you an easy way to skip unused bytes. Other mapping aids allow
you to reset the next position (POSITION,q or POSITION,symbol), or align the
next position on a halfword (ALIGN,H), fullword (ALIGN,F) or doubleword
(ALIGN,D).
v An equal sign (=) can be used for p, m or f to assign the previous position,
length or format to p, m, or f, respectively. For example:
Symbola,6,20,CH
Symbola1,=,8,=
Symbola2,*,12,=
Symbold,*,=,ZD
By using = and *, you can easily map fields onto other fields.
v Symbols for fields and constants can be specified in any order. However, the use
of * and = imposes order dependencies on symbols for fields.
v Comment statements and blank statements are allowed in SYMNAMES.
SYMNAMES DD statement
A SYMNAMES DD statement indicates you want DFSORT or ICETOOL to do
symbol processing. It specifies the SYMNAMES data set (SYMNAMES for short),
which can consist of one DFSORT symbol data set or many concatenated symbol
data sets.
733
SYMNOUT DD statement
A SYMNOUT DD statement specifies a data set in which you want DFSORT or
ICETOOL to print your original SYMNAMES statements and the symbol table
constructed from them. DFSORT or ICETOOL uses RECFM=FBA, LRECL=121 and
the specified BLKSIZE for the SYMNOUT data set (SYMNOUT for short).
If the BLKSIZE you specify is not a multiple of 121, or you do not specify the
BLKSIZE:
v the system determined optimum block size is used, if supported
v otherwise, BLKSIZE=121 is used.
For best performance, use a large block size, such as the system determined
optimum block size, for the SYMNOUT data set.
SYMNAMES statements
Each symbol in SYMNAMES must be described using a SYMNAMES statement. A
SYMNAMES statement can be a symbol statement, keyword statement, comment
statement or blank statement.
Symbol statements
The general format for a symbol statement is:
symbol,value remark
734
constant
field
parsed field
735
ONeill
Specify:
CONeill
736
If you used this symbol statement in a job named TEST2 that you ran on sysplex
MAS3 on a Thursday, DFSORT would transform it into the following symbol
statement:
Rpt_hdr,C
&JOBNAME. was replaced with 'TEST2', &SYSPLEX. was replaced with 'MAS3'
and &LWDAY was replaced with 'THU'.
If you used this same symbol statement in a job named BIGTEST that you ran
on sysplex MAS2 on a Monday, DFSORT would transform it into the following
symbol statement:
Rpt_hdr,C
This time &JOBNAME. was replaced with 'BIGTEST', &SYSPLEX. was replaced
with 'MAS2' and &LWDAY was replaced with 'MON'.
You could use the Rpt_hdr symbol in an OUTFIL statement like this:
OUTFIL HEADER2=(Rpt_hdr,5X,Page ,PAGE=(EDIT=(TTT)),/)
and get the heading you needed based on the setting of the system symbol
values where and when the job was run.
The types of system symbols you can use in a system symbol string are:
Dynamic system symbols like &YYMMDD, &LYYMMDD, &HHMMSS,
&LHHMMSS, &DAY, &LDAY, &HR, &LHR, &JDAY, &LJDAY, &JOBNAME,
&MIN, &LMIN, &MON, &LMON, &SEC, &LSEC, &WDAY, &LWDAY, &YR2,
&LYR2, &YR4, and &LYR4.
System-defined static system symbols like &SYSCLONE, &SYSNAME,
&SYSPLEX, &SYSR1, and &SYSALVL.
Installation-defined static system symbols specified by your installation in an
IEASYMxx member of SYS1.PARMLIB.
Note: System symbols must be specified using all uppercase characters.
Lowercase characters are not recognized as system symbols. For example,
&JOBNAME is recognized as a system symbol, but &jobname and &Jobname are
not.
You can use all three types of system symbols separately or in combination
within a system symbol string. You can also use all of the system symbol string
Chapter 8. Using symbols for fields and constants
737
For more information on system symbols, see z/OS MVS Initialization and Tuning
Reference, SA23-1380.
Note: JCL symbols and IPCS symbols are not system symbols and will not be
recognized or replaced in a system symbol string.
s'original_string' will be treated like S'original_string'.
If you want to include a single apostrophe in the system symbol string, you
must specify it as two single apostrophes.
DFSORT uses the ASASYMBM service to transform S'original_string' into
C'result_string'. If your system symbol string has errors involving symbol
names, substring notation, and so on, ASASYMBM transforms the symbol
system string to a character string according to its rules for substitution. For
example, if you specify these symbol statements:
Ok,S&YR4(1:2).&SYSNAME.
Bad,S&YR4(1.2).&SYSNAM.
where the valid substring notation 1:2 and the known system symbol
&SYSNAME. (for example, 'ED53') are used for Ok, but the invalid substring
notation 1.2 and the unknown system symbol &SYSNAM. are used for Bad, the
resulting symbol statements are:
Ok,C20EDS3
Bad,C2006(1.2).&SYSNAM.
See z/OS MVS Programming: Assembler Services Reference ABE-HSP, SA23-1369 for
complete details on the ASASYMBM service.
After a symbol statement containing a system symbol string (S'original_string') is
transformed into a symbol statement containing the resulting character string
(C'result_string'), it will be error checked and processed like any other symbol
statement containing a character string. See the description of character string
previously in this section for details.
If a SYMNOUT data set is specified, it will show the symbol statement
containing the original system symbol string as well as the transformed symbol
statement containing the resulting character string. This can be helpful for
debugging "errors" or unexpected results in your system symbol strings.
v A hexadecimal string in the format X'yy...yy' or x'yy...yy'.
The value yy represents any pair of hexadecimal digits. Each hexadecimal digit
must be 0-9, A-F or a-f. You can specify up to 32 pairs of hexadecimal digits.
x'yy...yy' will be treated like X'yy...yy'. a-f will be treated like A-F.
Some examples of valid hexadecimal strings are: X'F2C3', x'2fa71e', and X'07'.
Some examples of invalid hexadecimal strings are: X'F2G301' (G is not a valid
hexadecimal digit), x'bf3' (unpaired hexadecimal digits) and X'' (no hexadecimal
digits).
v A bit string in the format B'bbbbbbbb...bbbbbbbb' or b'bbbbbbbb...bbbbbbbb'.
The value bbbbbbbb represents 8 bits that constitute a byte. Each bit must be 1,
0 or . (period). You can specify up to 8 groups of 8 bits. b'bbbbbbbb...bbbbbbbb'
will be treated like B'bbbbbbbb...bbbbbbbb'.
738
to set the output column to 15, because column notation is allowed in the BUILD,
OVERLAY or PUSH operand of an INREC or OUTREC statement and in the
BUILD, OVERLAY, PUSH, TRLUPD, HEADERx, or TRAILERx operand of an
OUTFIL statement. However, Field1: will result in an error message if used in any
other operand, such as WHEN.
Chapter 8. Using symbols for fields and constants
739
740
By using * for p, you can map consecutive fields in your records without having
to compute their actual positions. You can also map fields added between other
fields without having to change the p values for the original or inserted fields. *
is also useful for creating mappings of contiguous fields using concatenated
symbol data sets. As a simple example, if you specify:
//SYMNAMES DD DSN=MY.SYMPDS(RDW),DISP=SHR
//
DD DSN=MY.SYMPDS(SECTION1),DISP=SHR
//
DD DSN=MY.SYMPDS(SECTION2),DISP=SHR
An equal sign (=) can be used to assign the previous position to p. Each time a
symbol for p,m,f or p,m is read, the previous position is set to p. Additionally, the
previous position can be modified by a POSITION keyword statement (see later in
Chapter 8. Using symbols for fields and constants
741
By using = and * for p, you can easily map fields onto other fields.
Whenever you use = for p, you must ensure that the previous position is the one
you want. In particular, if you insert a new field symbol with the wrong position
before a symbol that uses = for p, you will need to change = to the actual
position you want.
v m can be an equal sign (=) or a number from 1 to 32752. An equal sign (=) can
be used to assign the previous length to m. Each time a symbol for p,m,f or p,m is
read, the previous length is set to m. When = is specified for m, the previous length
is assigned to m. If the previous length has not been set when = is used for m, an
error message is issued.
The symbol table printed in the SYMNOUT data set (if specified) will show you
the actual lengths assigned when you specify = for m.
As an example of how = can be used for m, if you specify the following
SYMNAMES statements:
Flags1,5,1,BI
Error1,X08
Flags2,15,=,BI
Error2,X04
Flags3,22,=,BI
Error3,X23
Whenever you use = for m, you must ensure that the previous length is the one
you want. In particular, if you insert a new field symbol with the wrong length
before a symbol that uses = for m, you will need to change = to the actual
length you want.
v f can be an equal sign (=) or one of the following formats: AC, AQ, ASL, AST,
BI, CH, CLO, CSF, CSL, CST, CTO, DC1, DC2, DC3, DE1, DE2, DE3, DT1, DT2,
DT3, D1, D2, FI, FL, FS, LS, OL, OT, PD, PD0, SFF, SS, TC1, TC2, TC3, TC4, TE1,
TE2, TE3, TE4, TM1, TM2, TM3, TM4, TS, UFF, Y2B, Y2C, Y2D, Y2DP, Y2P, Y2PP,
Y2S, Y2T, Y2TP, Y2U, Y2UP, Y2V, Y2VP, Y2W, Y2WP, Y2X, Y2XP, Y2Y, Y2YP, Y2Z,
Y4T, Y4U, Y4V, Y4W, Y4X, Y4Y or ZD.
742
Whenever you use = for f, you must ensure that the previous format is the one
you want. In particular, if you insert a new field symbol with the wrong format
before a symbol that uses = for f, you will need to change = to the actual format
you want.
Parsed field: A parsed field can be specified as %nnn with nnn as 000-999, %nn
with nn as 00-99 or as %n with n as 0-9. %0n will be substituted for %n and %00n.
%nn will be substitued for %0nn. A symbol for a parsed field must be used only
where such a field is allowed and has the desired result. Otherwise, substitution of
%nn for the symbol will result in an error message. For example, if the following
SYMNAMES statement is specified:
Revenue,%03
because a parsed field is allowed in the PARSE operand and the OVERLAY
operand. However, Revenue will result in an error message if used in a SORT
statement such as:
SORT FIELDS=(Revenue,UFF,A)
743
Keyword statements
The general format for a keyword statement is:
keyword,value remark
744
POSITION,q
POSITION,symbol
SKIP,n
ALIGN,H
ALIGN,F
ALIGN,D
Keyword statements can help you map the fields in your records by letting you set
a starting position, skip unused bytes and align fields on specific boundaries.
v POSITION,q can be used to set the next position and the previous position to q.
As discussed under p previously, the next position is used when an asterisk (*) is
specified for p in a symbol statement, and the previous position is used when an
equal sign (=) is specified for p in a symbol statement. q can be a number from 1
to 32752. When you use POSITION,q you can use either * or = interchangably
for p of the next symbol.
As an example of how POSITION,q can be used, if you specify the following
SYMNAMES statements:
POSITION,27
Account_Balance,*,5,PD
Account_Id,*,8,CH
POSITION,84
New_Balance,=,20
v POSITION,symbol can be used to set the next position and the previous position
to the position established for the indicated symbol. As discussed under p
previously, the next position is used when an asterisk (*) is specified for p in a
symbol statement, and the previous position is used when an equal sign (=) is
specified for p in a symbol statement. When you use POSITION,symbol you can
use either * or = interchangeably for p of the next symbol.
symbol can be any previously defined field symbol. Thus, POSITION,symbol
can be used like the Assembler ORG instruction to map different fields onto the
same area.
As an example of how POSITION,symbol can be used, if you specify the
following SYMNAMES statements:
Workarea,21,100
volser1,=,6,CH
volser2,*,6,CH
POSITION,Workarea
status,=,1,BI
dsname,*,44,CH
v SKIP,n can be used to add n bytes to the next position. As discussed under p
previously, the next position is used when an asterisk (*) is specified for p in a
symbol statement. n can be a number from 1 to 32752.
745
v ALIGN,H can be used to align the next position on a halfword boundary, that is,
1, 3, 5 and so on. As discussed under p previously, the next position is used when
an asterisk (*) is specified for p in a symbol statement. ALIGN,h will be treated
like ALIGN,H.
As an example of how ALIGN,H can be used, if you specify the following
SYMNAMES statements:
A1,7,3,CH
ALIGN,H
A2,*,2,BI
v ALIGN,F can be used to align the next position on a fullword boundary, that is,
1, 5, 9 and so on. As discussed under p previously, the next position is used when
an asterisk (*) is specified for p in a symbol statement. ALIGN,f will be treated
like ALIGN,F.
As an example of how ALIGN,F can be used, if you specify the following
SYMNAMES statements:
B1,7,3,CH
ALIGN,f
B2,*,4,BI
v ALIGN,D can be used to align the next position on a doubleword boundary, that
is, 1, 9, 17 and so on. As discussed under p previously, the next position is used
when an asterisk (*) is specified for p in a symbol statement. ALIGN,d will be
treated like ALIGN,D.
As an example of how ALIGN,D can be used, if you specify the following
SYMNAMES statements:
C1,7,3,CH
ALIGN,D
C2,*,8,BI
746
Once you've "debugged" your SYMNAMES statements, you can use them in
DFSORT and ICETOOL statements.
747
Example 2
MERGE FIELDS=(Any_Format,A,C_Field1,A),FORMAT=CH
748
SUM
FIELDS operand: You can use symbols where you can use fields (p,m,f and p,m).
A symbol for p,m,f results in substitution of p,m if FORMAT=f or symbol,f is
specified.
Example 1
SUM FIELDS=(Z_Field1,C_Field1,ZD)
Example 2
SUM FORMAT=ZD,FIELDS=(C_Field1,Any_Format)
Example 2
OMIT FORMAT=BI,COND=(C_Field1,EQ,Code_1,OR,
Any_Format,EQ,Stopper,OR,
Flags,EQ,Full)
Example 3
INCLUDE COND=(25,8,CH,EQ,Sysplex)
If the value for the system symbol &SYSPLEX. is 'MAS3', the INCLUDE statement
will be transformed to:
INCLUDE COND=(25,8,CH,EQ,CMAS3)
749
750
Example 2
OUTREC FIELDS=(RDW, ** Record Descriptor Word **
Z_Field1,2Z,
3CSymbol cannot be used for a repeated constant,
Code_1,Flags,
Variable_Fields) ** Variable part of input record
751
Note: You can use a symbol for Y'DATEx', Y'DATEx'+n or Y'DATEx'-n (where x is
1, 2 or 3) in the WHEN, BEGIN or END operand, but you cannot use symbol+n or
symbol-n to substitute Y'DATEn'+n or Y'DATEn'-n in the WHEN, BEGIN or END
operand. See the discussion of "INCLUDE and OMIT" for further details.
KEYWORD=n operands: You can use a symbol where you can use a number (n)
with the IFOUTLEN, RECORDS, ABSPOS, SUBPOS, ADDPOS, FIXLEN, REPEAT,
STARTPOS, ENDPOS, MAXLEN, DO, ID, SEQ, START, INCR and LENGTH
operands.
Example 1
OUTREC IFOUTLEN=len80,
IFTHEN=(WHEN=GROUP,RECORDS=n5,PUSH=(at81:ID=n6))
OUTFIL
INCLUDE, OMIT, IFTRAIL TRLID=(logexp), IFTHEN WHEN=(logexp), IFTHEN
BEGIN=(logexp) and IFTHEN END=(logexp) operands: You can use symbols
where you can use fields (p1,m1,f1 and p1,m1 and p2,m2,f2 and p2,m2) and
constants (n, +n, -n, C'xx...x', X'yy...yy', Y'yyx...x' and B'bbbbbbbb...bbbbbbbb'). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified. A symbol for
'string' always results in substitution of C'string'.
Note: You can use a symbol for Y'DATEx', Y'DATEx'+n or Y'DATEx'-n (where x is
1, 2 or 3) in the INCLUDE, OMIT, TRLID, WHEN, BEGIN or END operand, but
you cannot use symbol+n or symbol-n to substitute Y'DATEn'+n or Y'DATEn'-n in
752
753
754
Example 2
OUTFIL FNAMES=REPORT,
OUTREC=(6:Branch_Office,24:Profit_or_Loss,M5,LENGTH=20,75:X),
SECTIONS=(Division,SKIP=P,
HEADER3=(2:Div_Title,Division,5X,Page:,&PAGE,2/,
6:BO_Title,24:PL_Title,/,
6:BO_Hyphens,24:PL_Hyphens),
TRAILER3=(6:BO_Equals,24:PL_Equals,/,
6:Total,24:TOTAL=(Profit_or_Loss,M5,LENGTH=20),/,
6:Lowest,24:MIN=(Profit_or_Loss,M5,LENGTH=20)))
Example 3
OUTFIL IFTHEN=(WHEN=INIT,
PARSE=(Class_value=(STARTAFT=Class_constant,
ENDBEFR=End_constant,FIXLEN=8),
Students_value=(STARTAFT=Students_constant,
ENDBEFR=End_constant,FIXLEN=n5)),
BUILD=(1:Class_value)),
IFTHEN=(WHEN=(1,8,SS,EQ,CBiology ,Algebra ,Geometry),
BUILD=(CThere are ,Students_value,UFF,M10,X,
Class_value,C Students)),
IFTHEN=(WHEN=NONE,
BUILD=(C*Not relevant*))
755
JOINKEYS
FIELDS operand: You can use symbols where you can use fields (p,m). A symbol
for p,m,f results in substitution of p,m.
INCLUDE and OMIT operands: You can use symbols where you can use fields
(p1,m1,f1 and p1,m1 and p2,m2,f2 and p2,m2) and constants (n, +n, -n, C'xx...x',
X'yy...yy', Y'yyx...x' and B'bbbbbbbb...bbbbbbbb'). A symbol for p,m,f results in
substitution of p,m if symbol,f is specified. A symbol for 'string' always results in
substitution of C'string'.
Note: You can use a symbol for Y'DATEx', Y'DATEx'+n or Y'DATEx'-n (where x is
1, 2 or 3) in the INCLUDE or OMIT operand, but you cannot use symbol+n or
symbol-n to substitute Y'DATEn'+n or Y'DATEn'-n in the INCLUDE or OMIT
operand. See the discussion of "INCLUDE and OMIT" for further details.
STOPAFT=n operand: You can use a symbol where you can use a number (n)
with the STOPAFT operand.
Example 1
JOINKEYS FILE=F1,FIELDS=(Division,A),
INCLUDE=(Substring,EQ,Depts)
REFORMAT
FIELDS operand: You can use symbols where you can use fields (p,m and p). A
symbol for p,m,f results in substitution of p,m.
FILL operand: You can use symbols where you can use constants (C'x' and X'yy').
A symbol for 'string' always results in substitution of C'string'.
Example 1
REFORMAT FIELDS=(F1:RDW,Profit_or_Loss,F2:Any_Format,
F1:Variable_Fields),FILL=filler
OPTION
KEYWORD=n operands: You can use a symbol where you can use a number (n)
with the SKIPREC and STOPAFT operands.
Example 1
OPTION SKIPREC=n5,MAINSIZE=MAX,STOPAFT=n6
756
COUNT
HIGHER, LOWER, EQUAL and NOTEQUAL operands: You can use symbols
where you can use constants (x, y, v, and w).
SUB and ADD operands: You can use symbols where you can use constants (q
and r).
TEXT operand: You can use symbols where you can use constants ('string'). A
symbol for C'string' always results in substitution of 'string'.
DATASORT
HEADER, FIRST, TRAILER and LAST operands: You can use symbols where you
can use constants (u and v).
DISPLAY
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f or symbol,HEX is
specified.
BREAK operand: You can use symbols where you can use fields (p,m,f and p,m).
A symbol for p,m,f results in substitution of p,m if symbol,f is specified.
TITLE, HEADER, TOTAL, MAXIMUM, MINIMUM, AVERAGE, COUNT,
BTITLE, BTOTAL, BMAXIMUM, BMINIMUM, BAVERAGE and BCOUNT
operands: You can use symbols where you can use constants ('string'). A symbol
for C'string' always results in substitution of 'string'.
757
OCCUR
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f or symbol,HEX is
specified.
TITLE and HEADER operands: You can use symbols where you can use constants
('string'). A symbol for C'string' always results in substitution of 'string'.
HIGHER, LOWER and EQUAL operands: You can use symbols where you can
use constants (x, y and v).
RANGE
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified.
HIGHER, LOWER, EQUAL and NOTEQUAL operands: You can use symbols
where you can use constants (x, y, v and w).
SELECT
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified.
FIRST, FIRSTDUP, HIGHER, LOWER and EQUAL operands: You can use
symbols where you can use constants (u, v, w, x, and y).
SPLICE
ON operand: You can use symbols where you can use fields (p,m,f and p,m). A
symbol for p,m,f results in substitution of p,m if symbol,f is specified.
WITH operand: You can use symbols where you can use fields (p,m). A symbol for
p,m,f results in substitution of p,m.
SUBSET
HEADER, FIRST, RRN, TRAILER and LAST operands: You can use symbols
where you can use constants (q, r, u and w).
ICETOOL Example
//TOOLSYM JOB A402,PROGRAMMER
//DOIT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
//SYMNAMES DD *
Rdw,1,4,BI
Account_Code,12,1,CH
Dept_Code,*,=,=
Customer_Name,*,20,CH
SKIP,2
Customer_Balance,*,10,ZD
Customer_Flags,*,1,BI
* Department Codes
758
If the value for the system symbol &LWDAY. is 'FRI', SYMNOUT will show the
following:
------- ORIGINAL STATEMENTS FROM SYMNAMES ------Rdw,1,4,BI
Account_Code,12,1,CH
Dept_Code,*,=,=
Customer_Name,*,20,CH
SKIP,2
Customer_Balance,*,10,ZD
Customer_Flags,*,1,BI
* Department Codes
Research,R
Marketing,M
* Balance Cutoffs
Cancel,+10000
100.00
Gift,+1000000
10,000.00
Stop_Check,-500
-5.00
* Headings and Titles
Title,SCustomer Report for &LWDAY.
Head1,Customer Name
Head2,Customer Balance
Head3,Customer Flags
------------------ SYMBOL TABLE ----------------Rdw,1,4,BI
Account_Code,12,1,CH
Dept_Code,13,1,CH
Customer_Name,14,20,CH
Customer_Balance,36,10,ZD
Customer_Flags,46,1,BI
Research,CR
Marketing,CM
Cancel,+10000
Gift,+1000000
Stop_Check,-500
Chapter 8. Using symbols for fields and constants
759
For each JPn"string" parameter found in EXEC PARM, a DFSORT symbol in the
following form is constructed, and treated as if it was specified in the SYMNAMES
data set (even if a SYMNAMES data set is not actually present):
JPn,Sstring
When JP1 and JP2 are used in the OMIT statement, the statement is transformed
to:
760
If the job is run on Friday, 'FRI' is substituted for the &WDAY system symbol and
the following is placed in the Symbol Table:
JP0,CReport for disks 339001 and 339002 on FRI
When JP0 is used in the DISPLAY statement, the statement is transformed to:
DISPLAY TITLE(Report for disks 339001 and 339002 on FRI)FROM(IN) LIST(OUT) ON(1,5,CH)
Note: For a JOINKEYS application, you can use JCL SET and PROC symbols (JPn)
in DFSORT control statements for the main task, but you cannot use JCL SET and
PROC symbols (JPn) in DFSORT control statements for the subtasks.
option can be JPn"string" or one of the other valid DFSORT options (for example,
VLSCMP or DSA=8). JPn"string" options are used to construct DFSORT symbols.
Other DFSORT options are passed to DFSORT as EXEC PARM options in the
normal way.
PGM=ICEMAN or one of the other aliases can be used instead of PGM=SORT.
Normal system JCL rules for the EXEC PARM operand apply. In addition:
v JPn"string" parameters can only be used when DFSORT is invoked directly (for
example, with PGM=SORT), not when DFSORT is invoked from a program (for
example, with LINK EP=SORT).
v If the length of the EXEC PARM options is greater than the JCL limit of 100
bytes, JPn"string" options will not be processed.
761
Description of JPn"string"
Only JP0 through JP9 can be used for a symbol name where 'JP' must be uppercase
EBCDIC (X'D1D7') and n must be '0'-'9' (X'F0'-X'F9').
A quote must appear before and after the string. A quote must not appear within
the string (it would be interpreted as the ending quote). PARM='...,JPn"string' (a
missing ending quote) will be interpreted as PARM='...,JPn"string"'.
If the keyword does not appear as JPn"string", it will not be used as a JPn symbol.
For example, JP1"ABC" would be used as a JP1 symbol, but JP1="ABC",
JP1("ABC"), JP1=("ABC") or jp1"ABC" would not.
Any or all of the following can appear in the string:
v any EBCDIC character (except quote). If you want to include a single apostrophe
in the character string, you must specify it as two single apostrophes
v a JCL SET or PROC symbol (&SYMBOL). Normal system rules for SET and
PROC symbols apply.
v a system symbol (for example, &JOBNAME, &SYSPLEX, etc). Normal system
rules for system symbols apply.
The symbol will be constructed as:
JPn,Sstring
and must conform to the rules for a system symbol string as documented earlier in
this Chapter.
If you specify:
//SYMNOUT DD SYSOUT=*
the JPn symbols will be listed along with any other DFSORT symbols you specify
in SYMNAMES.
If you specify a SYMNAMES data set, the JPn symbols will be processed before
the first SYMNAMES symbol.
Note: Here is an example of one suggested way of specifying multiple options in
EXEC PARM:
// SET X1=ANY-STRING
// SET X2=ANOTHER-STRING
//S1 EXEC PGM=SORT,
// PARM=(RESALL=12K,
//
VLLONG,
//
JP1"&X1",
//
JP2"&X2")
Example 1
MYPROC procedure
//MYPROC PROC DAY=
//STEP01 EXEC PGM=SORT,PARM=JP1"&DAY"
//SYSOUT DD SYSOUT=*
//SYMNOUT DD SYSOUT=*
762
Execution of MYPROC
//S1 EXEC MYPROC,DAY=2
This example illustrates how you can use a JCL PROC symbol in a DFSORT
control statement.
The JCL PROC symbol is DAY which will be set to a 1 character numeric value (2
in this example), and used to overlay the number of days in the SELECT statement
(in the SEL member).
PARM='JP1"&DAY"' is used to create a DFSORT symbol named JP1 containing a
string with the DAY value.
The SYMNOUT listing will show the following:
------ SYMNAMES STATEMENTS FROM EXEC PARM ------JP1,S2
------------------ SYMBOL TABLE ----------------JP1,C2
The DFSORT INREC statement in the OVLY member uses JP1. It will be
transformed to:
INREC OVERLAY=(59:C2)
Example 2
// SET JOBNM=FRANK2
//S1
EXEC PGM=ICETOOL,
// PARM=(JP1"&JOBNM",
//
JP2"&JOBNM STEP",
//
JP3"&JOBNM EXCPS")
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYMNAMES DD *
JOBN,5,8,CH
STEPN,*,8,CH
EXCPS,*,5,ZD
//SYMNOUT DD SYSOUT=*
//IN DD *
FRANK2 S1
00008
FRANK2 S2
00123
FRANK2 S3
00023
FRANK3 S1
00016
FRANK3 S2
00152
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
Chapter 8. Using symbols for fields and constants
763
This example illustrates how you can use a JCL SET symbol in ICETOOL and
DFSORT control statements.
The JCL SET symbol is JOBNM which is set to a constant ('FRANK2' for this
example).
//
//
//
PARM=(JP1"&JOBNM",
JP2"&JOBNM STEP",
JP3"&JOBNM EXCPS")
is used to create DFSORT symbols named JP1, JP2 and JP3 containing strings
including the JOBNM value. ICETOOL treats these JPn symbols as if they were
specified before the Symbols in SYMNAMES.
The SYMNOUT listing will show the following:
------ SYMNAMES STATEMENTS FROM EXEC PARM ------JP1,SFRANK2
JP2,SFRANK2 STEP
JP3,SFRANK2 EXCPS
------- ORIGINAL STATEMENTS FROM SYMNAMES ------JOBN,5,8,CH
STEPN,*,8,CH
EXCPS,*,5,ZD
------------------ SYMBOL TABLE ----------------JP1,CFRANK2
JP2,CFRANK2 STEP
JP3,CFRANK2 EXCPS
JOBN,5,8,CH
STEPN,13,8,CH
EXCPS,21,5,ZD
The DFSORT INCLUDE statement in CTL1CNTL uses the JOBN and JP1 symbols.
It will be transformed to:
INCLUDE COND=(5,8,CH,EQ,CFRANK2)
The ICETOOL DISPLAY statement uses the JP2, JP3, STEPN and EXCPS symbols.
It will be transformed to:
DISPLAY FROM(T1) LIST(RPT) BLANKHEADER(FRANK2 STEP) ON(13,8,CH)HEADER(FRANK2 EXCPS) ON(21,5,ZD)
764
FRANK2 EXCPS
-----------8
123
23
the statement:
INCLUDE COND=(Sym1,EQ,Con1)
An ICE114A message with a $ marker under C'1234' will then be issued for the
statement because a ZD field cannot be compared to a character constant. In this
example, the error could be fixed by using Con2 (a decimal constant) in the
statement instead of Con1 or by redefining Con1 as a decimal constant.
v If you use a temporary or permanent message data set, it is best to specify a
disposition of MOD to ensure you see all messages and control statements in the
message data set. In particular, if you use symbols processing and do not use
MOD, you will not see the original control statements unless Blockset is selected.
v If you rearrange your records in any way (for example, using E15, E35, INREC,
OUTREC or OUTFIL) and want to use symbols for the rearranged records, be
sure to use symbols that map to the new positions of your fields. For example, if
you use a SYMNAMES data set with the following statements:
Field1,1,5,ZD
Field2,*,6,ZD
Field3,*,3,ZD
Field4,*,4,ZD
765
the resulting records will only contain Field2 and Field4. If you want to use
symbols for the rearranged records (for example, in a SORT statement), you will
need to use a SYMNAMES data set with symbols that map to the rearranged
records, such as:
New_Field2,1,6,ZD
New_Field4,*,4,ZD
If you use unique symbols for the rearranged fields, as in the previous example,
you can concatenate the old and new symbol data sets together and use the old
and new symbols where appropriate, as in this example:
INREC FIELDS=(Field2,Field4)
SORT FIELDS=(New_Field2,A,New_Field4,A)
766
767
DFSORT
EFS Program
EFS
Interface
Processing
Input
Data
Set
EFS
Interface
EFS
Interface
Processing
Output
Data
Set
768
Initialization Phase
DFSORT
Major Call 1
EFS
Processing
Major Call 2
EFS
Program
Major Call 3
DFSORT
Input Phase
EFS01 and
EFS02
Parameter
List
Processing
EFS01
DFSORT
Termination Phase
Major Call 4
EFS
Processing
Major Call 5
EFS
Program
Figure 36. EFS Program Calls for a Sort. The figure also shows the calls to the EFS program
EFS01 and EFS02 exit routines.
769
Initialization Phase
DFSORT
Major Call 1
EFS
Processing
Major Call 2
EFS
Program
Major Call 3
DFSORT
Input and
Output Phase
EFS01 and
EFS02
Parameter
List
Processing
EFS01
(Merge
Only)
DFSORT
Termination Phase
Major Call 4
EFS
Processing
Major Call 5
EFS
Program
Figure 37. EFS Program Calls for a Merge or Copy. The figure also shows the calls to the
EFS program EFS01 and EFS02 exit routines.
Initialization phase
DFSORT runs Major Calls 1 through 3 during the initialization phase.
Major call 1: The EFS program can perform initialization processing such as
opening data sets and obtaining storage.
Information is passed in both directions between DFSORT and the EFS program
across the EFS interface.
At Major Call 1, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 1 is in effect
v Informational flags that describe current processing.
770
v
v
v
v
Major call 3: At Major Call 3, your EFS program can provide DFSORT with
user-written messages to print to the message data set. DFSORT can call the EFS
program once for the Blockset technique and once for the Peerage/Vale techniques.
DFSORT obtains more information at this call from the EFS program to process the
EFS01 and EFS02 exit routines.
At Major Call 3, DFSORT supplies your EFS program with fields in the EFS
interface containing:
v An action code indicating that Major Call 3 is in effect
Chapter 9. Using extended function support
771
When the EFS program returns control to DFSORT, it can supply fields in the EFS
interface containing:
v An EFS01 exit routine address
v An EFS02 exit routine address
v A list of messages for printing to the message data set
v A return code in general register 15.
Input phase
DFSORT runs the two exit routines, EFS01 and EFS02, during the input phase. The
EFS01 routine supports sorting or merging user-defined data types with
user-defined collating sequences and is called once for each record. The EFS02
routine provides logic to include or omit records on user-defined data types and is
called one or more times for each record, according to the logic.
Information is passed in both directions between DFSORT and the exit routines
across the EFS01 and EFS02 parameter lists.
DFSORT supplies the EFS01 routine with fields in the parameter list containing:
v An Extract Buffer Area to which the EFS01 routine must move all EFS control
fields. See EFS01 user exit routine on page 789 for more information.
v The input data record.
v An EFS Program Context Area (a private communication area for the EFS
program).
When the EFS01 routine returns control to DFSORT, it must return a return code in
general register 15.
DFSORT supplies the EFS02 routine with fields in the parameter list containing:
v A Correlator Identifier, which identifies a relational condition containing EFS
fields. See EFS02 user exit routine on page 790 for more information.
v The input data record.
When the EFS02 routine returns control to DFSORT, it must return a return code in
general register 15.
Termination phase
DFSORT runs Major Calls 4 and 5 during the termination phase. Only one call is
made at each of these Major Calls.
Note: If a system abend occurs while DFSORT's ESTAE recovery routine is in
effect, and Major Calls 4 and 5 have not already been run, the ESTAE routine runs
them. If an EFS abend occurs during Major Call 1, the ESTAE routine does not run
Major Calls 4 and 5. See Appendix E, DFSORT abend processing, on page 907 for
more information about ESTAE.
Major call 4: The EFS program provides any final user-written messages for
printing to the message data set.
772
Input Phase
Termination Phase
EFS Program
Examining, altering,
EFS Program
or ignoring DFSORT
and non-DFSORT
control statements
prior to processing by
DFSORT
Sorting or merging
user-defined data
types with
user-defined collating
sequences
EFS01
EFS02
Supplying messages
to DFSORT for
printing to the
message data set
EFS Program
Terminating DFSORT
EFS Program
EFS Program
EFS01, EFS02
EFS Program
773
Input Phase
Termination Phase
EFS Program
774
DFSPARM
SYSIN
SORTCNTL
DFSORT processing of
SYSIN control statements
and JCL EXEC statement
PARM options not requested
by the EFS program
DFSORT processing of
SYSIN control statements
and JCL EXEC statement
PARM options returned by
the EFS program
SYSOUT
775
Terminating DFSORT
Your EFS program can terminate DFSORT at any of the five Major Calls and also
from either of the two EFS program exit routines during the input phase.
776
777
Action code
4 bytes
Address of
Control Statement list
4 bytes
Address of
original Control Statement
including all keywords and
corresponding subparameters
Control statement
request list
** bytes
Original control
statement string
* bytes
4 bytes
Address of
modified Control Statement
including all keywords and
corresponding subparameters
4 bytes
Length of
original Control Statement
including all keywords and
corresponding subparameters
4 bytes
Length of
modified Control Statement
including all keywords and
corresponding subparameters
4 bytes
Address of
EFS context area
4 bytes
778
Address of
Extract buffer offsets
(zeros if no EFS fields exist)
4 bytes
Address of
Record lengths list
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
Information flags
4 bytes
Address of
message list
(zeros if none)
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
RESERVED
4 bytes
Address of
f
EFS01 extract routine
(zeros if none)
4 bytes
Address of
EFS02 INCLUDE/OMIT
f
routine (zeros if none)
4 bytes
List end indicator (X'FFFFFFFF')
Modified control
statement string
* bytes
Record lengths
list
8 bytes
4 bytes
Action codes
DFSORT sets one of five action codes before a call to the EFS program:
0
Indicates Major Call 1 to the EFS program. DFSORT sends this action code
once.
Indicates Major Call 2 to the EFS program. DFSORT might send this action
code several times at Major Call 2 depending on how many control
statements are requested and found. For example, if the SORT, MERGE,
and INCLUDE control statements are all supplied in SYSIN and are
requested, the EFS program is called twice: once for the SORT control
statement (because SORT and MERGE are mutually exclusive, and
assuming the SORT statement is specified first, only the SORT statement is
taken) and once for the INCLUDE control statement.
Indicates Major Call 3 to the EFS program. DFSORT can send this action
code once for the Blockset technique and once for the Peerage/Vale
technique.
12
Indicates Major Call 4 to the EFS program. DFSORT sends this action code
once.
16
Indicates Major Call 5 to the EFS program. DFSORT sends this action code
once.
Chain pointer to
next operation
definer or EXEC
PARM option name,
or zero for end
of list
4 bytes
Length of
operation definer
or EXEC PARM
option name
Operation definer
or EXEC PARM
option name
(variable-length)
2 bytes
* bytes
The asterisk (*) indicates that the length is determined by the corresponding length
field (maximum of 8 bytes).
779
780
781
LIST
NOLIST
LISTX
NOLISTX
LOCALE
MSGDDN
MSGDD
MSGPRT
SMF
v SORTDD
v SORTIN
v SORTOUT
v USEWKDD
The following EXEC PARM options will be ignored by DFSORT if returned by an
EFS program:
v EFS
v LIST
v
v
v
v
v
782
NOLIST
LISTX
NOLISTX
LOCALE
MSGDDN
SORT
MERGE
FIELDS= ( mp,mm,mf,ms
Where Represents
mp
mm
field length
mf
ms
Table 88 on page 784 gives an example of using the D1 format for a SORT control
statement returned to DFSORT by the EFS program.
You must adhere to the following requirements for the D1 format:
v The mp, mm, and ms values returned must be valid SORT or MERGE control
statement values, except:
The combined value of mp and mm may exceed the record length.
CHALT will have no effect on EFS fields and will not limit the length to 256.
Value E for ms will not be allowed; EFS fields may not be altered by an E61.
FORMAT=D1 will not be allowed.
783
AND ,
OR
AND ,
OR
constant
mask
Where Represents
mc
mm
field length
mf
operator
a valid DFSORT comparison or bit logic operator
constant
a valid DFSORT decimal, character, hexadecimal or bit constant.
mask
Table 89 on page 785 gives an example of using a correlator identifier and the D2
format for an INCLUDE control statement returned to DFSORT by the EFS
program.
Note: The values for the correlator identifiers assigned to each relational condition
by the EFS program can be in any chosen order. The example in Table 89 on page
785 shows a sequential ordering for the correlator identifiers.
You must adhere to the following requirements for the D2 format:
v The mc, mm, or constant values returned must be valid INCLUDE or OMIT
control statement values, except:
The combined value of mc and mm might exceed the record length.
784
785
Offset n
4 bytes
4 bytes
4 bytes
Output record
length
4 bytes
Information flags
The information flags are defined in the figure that follows:
786
0 1 2 3 45 6 7
0 0 000 0 0 0
0 0000000
00000000
00000000
Reserved
Bit
Description
Bits 0 and 1
Indicate the source of the control statement being processed. Information
flags 0 and 1 are set by DFSORT before a call to the EFS program at Major
Call 2 (multiple calls are possible at Major Call 2).
Bit 2
Bit 3
Bits 4 and 5
Indicate the DFSORT function being run. Information flags 4 and 5 are set
by DFSORT before each call at Major Call 2 and Major Call 3 to the EFS
program (multiple calls are possible at Major Call 2 and Major Call 3).
Bit 6
Bit 7
Bit 8
Set by the EFS program to inform DFSORT whether to parse or ignore the
control statement returned by the EFS program. Printing of the control
statement is managed by the LISTX/NOLISTX parameters (see OPTION
Chapter 9. Using extended function support
787
Message list
Your EFS program can return informational or critical messages. A return code of 0
in general register 15 indicates an informational message while a return code of 16
indicates a critical message. If the EFS program has no messages to send after a
Major Call, it must zero the message list address in the EFS interface parameter
list.
At Major Call 2, if the EFS program finds a syntax error in a control statement, it
can return an offset relative to the start of the string to indicate the location of the
error. DFSORT first prints the control statement in error and then prints another
line containing a dollar symbol ($) at the location indicated by the offset.
Because DFSORT associates the relative offset with a critical message, the EFS
program must return with a return code of 16 in general register 15. If a relative
offset is returned for an EXEC PARM, the relative offset will be ignored. The EFS
program must free any storage it acquired for its messages.
The length field values must not include their own length.
The message list format follows:
Pointer to
next
message or
zero for
list end
4 bytes
Relative offset
(to syntax
error) or
zero
2 bytes
Length of
the message
text
2 bytes
Message
text
(variable
length)
* bytes
An asterisk (*) indicates that the length is determined by the corresponding length
field.
DFSORT imposes no restrictions on the format of the messages returned by an EFS
program. If you wish, you can use the DFSORT message format so that messages
in the message data set are consistent in appearance. For a description of the
message format used by DFSORT, see z/OS DFSORT Messages, Codes and Diagnosis
Guide
788
Register
Use
1
13
DFSORT places the address of a standard save area in this register. The area can
be used to save contents of registers used by the EFS program exit routine. The
first word of the area contains the characters SM1 in its three low-order bytes.
14
15
Contains the address of the EFS program exit routine. This register can be used
as the base register for EFS program exit routine. This register is also used by
the EFS program exit routine to pass return codes to DFSORT.
789
The EFS01 routine must return one of the following return codes in general register
15:
0
16
790
Relational
condition
with
Correlator
Identifier
1
Relational
condition
with
Correlator
Identifier
2
Relational
condition
with
Correlator
Identifier
3
EFS02 returns
a return code
of 0=True or
4=False
True
False
EFS02 returns
a return code
of 0=True or
4=False
True
False
EFS02 returns
a return code
of 0=True or
4=False
True
False
791
Byte 2
Byte 3
Byte 4
00
00
00
Correlator identifier
The EFS02 exit routine must return one of the following return codes in general
register 15:
0
True
The record passed the INCLUDE or OMIT test for the relational condition
of an EFS field. If applicable, processing continues with the next relational
condition. Otherwise, DFSORT accepts the record if INCLUDE is specified
or omits the record if OMIT is specified.
False
The record did not pass the INCLUDE or OMIT test for the relational
condition of an EFS field. If applicable, processing continues with the next
relational condition. Otherwise, DFSORT omits the record if INCLUDE is
specified or includes the record if OMIT is specified.
16
Terminate
An error occurred in processing the INCLUDE or OMIT logic; terminate
DFSORT.
Enter the EFS program exit routine with 24-bit addressing in effect.
Enter the EFS program exit routine with 31-bit addressing in effect.
The EFS program user exit routine can return to DFSORT with either 24-bit or
31-bit addressing in effect. The return address that DFSORT placed in register 14
must be used.
Except for the EFS program context area address (which DFSORT sends to the EFS
program user exit routine unchanged), DFSORT handles the EFS program exit
routine parameter list addresses (that is, the pointer to the EFS program exit
routine parameter list and the addresses in the parameter list) as follows:
792
Continue Processing
If you want DFSORT to continue processing for this Major Call, return
with a return code of zero in general register 15.
16
Terminate DFSORT
If you want DFSORT to terminate processing for this Major Call, return
with a return code of 16 in general register 15.
If the EFS program returns a return code of 16 from a Major Call prior to
Major Call 4 or one of its generated user exit routines returns a return code
of 16, DFSORT will skip interim Major Calls, where applicable, to the EFS
program or user exit routine, and will call the EFS program at Major Call 4
and at Major Call 5.
Multiple calls are possible at Major Call 2 and Major Call 3. If the EFS
program returns with a return code of 16 from one of the multiple calls at
Major Call 2, subsequent calls at Major Call 2, if applicable, will be
completed. If the EFS program returns with a return code of 16 from one
of the multiple calls at Major Call 3, subsequent calls at Major Call 3, if
applicable, will not be completed.
If the EFS program returns a return code of 16 at Major Call 4, DFSORT
will still call the EFS program at Major Call 5.
793
Merge Application
SORTIN
SORTINnn
SKIPREC
E15 or
COBOL E15
E15 or
COBOL E15
INCLUDE
OMIT
EFS02
E32
INCLUDE
OMIT
EFS02
STOPAFT
INREC
INREC
SORT
SUM
EFS01
OUTREC
MERGE
SUM
OUTREC
E35 or
COBOL E35
E35 or
COBOL E35
E35 or
COBOL E35
E35 or
COBOL E35
SORTOUT
OUTFIL
SORTOUT
OUTFIL
794
EFS01
SKIPREC
E15 or
COBOL E15
E15 or
COBOL E15
INCLUDE
OMIT
EFS02
STOPAFT
INREC
COPY
OUTREC
E35 or
COBOL E35
E35 or
COBOL E35
SORTOUT
OUTFIL
795
Major call 2
Prior to Major Call 2, DFSORT sets the following fields in the EFS interface
parameter list:
v Action code=4
Major Call 2 is in effect.
v Informational bit flag 4=0 and informational bit flag 5=0
No application is in effect.
796
Major call 3
Prior to Major Call 3, DFSORT sets the following fields in the EFS interface
parameter list:
v Action code=8
Major Call 3 is in effect.
v Informational bit flag 4=0 and informational bit flag 5=1
Chapter 9. Using extended function support
797
Major call 5
Prior to Major Call 5, DFSORT sets the following fields in the EFS interface
parameter list:
v Action Code=16
Major Call 5 is in effect.
DFSORT calls EFS program EFSPGM at Major Call 5, and EFSPGM does not set
any fields in the EFS interface parameter list but sets general register 15 to zero.
798
The DFSORT z/OS DFSORT Tuning Guide provides additional information related
to many of the topics covered in this chapter.
799
Efficient blocking
You can improve the performance of DFSORT significantly by blocking your input
and output records efficiently. Whenever possible, use system-determined optimum
block sizes for your data sets.
For more information about letting DFSORT select system-determined optimum
block sizes for your output data sets, see the discussion of the SDB option in
OPTION control statement on page 173.
Sorting techniques
One condition that affects which sorting technique DFSORT selects is the type of
device used for intermediate storage. If you use a tape device, the Conventional
technique is used, which is less efficient. For more information on using tape
devices for intermediate storage, see Tape work storage devices on page 811.
The Blockset and Peerage/Vale techniques can be used only with disk work data
sets. These techniques are discussed later in this section.
Blockset sorting techniques: DFSORT's most efficient techniques, FLR-Blockset
(for fixed-length records) and VLR-Blockset (for variable-length records), will be
used for most sorting applications.
800
Merging techniques
For merging applications, DFSORT uses the Blockset and Conventional techniques.
Blockset merging techniques: DFSORT's most efficient techniques, FLR-Blockset
(for fixed-length records) and VLR-Blockset (for variable-length records), will be
used for most merging applications.
Note: If Blockset is not selected, you can use a SORTDIAG DD statement to force
message ICE800I, which gives a code indicating why Blockset cannot be used.
Conventional merging technique: When the conditions for use of the Blockset
merging technique are not met, DFSORT uses the Conventional merge technique,
which is less efficient.
Variable-length records
When the input data set consists of variable-length records and dynamic allocation
of intermediate data sets is used, specify the average record length as accurately as
possible using AVGRLEN=n in the OPTION statement.
Disk devices
System performance is improved if storage is specified in cylinders rather than
tracks or blocks. Storage on sort work data sets will be readjusted to cylinders if
possible. The number of tracks per cylinder for disk devices is shown in Table 91.
Table 91. Number of Tracks per Cylinder for Disk Devices
Tracks per Cylinder
3380
15
3390
15
9345
15
If WRKSEC is in effect and the work data set is not allocated to virtual I/O,
DFSORT allocates secondary extents as required, even if not requested in the JCL.
Chapter 10. Improving efficiency
801
Care should be taken to ensure that the LRECL parameter of the DCB corresponds
to the actual maximum record length contained in your data set.
802
CFW
Blockset sorting performance may be improved by using the Cache Fast Write
(CFW) capability of IBM's storage controllers. Because IBM's latest storage
subsystems have large cache sizes and high speed disk arrays, the use of CFW
may not produce a significant performance gain.
The CFW parameter specifies whether DFSORT can use CFW when processing
SORTWKdd data sets. The default is CFW=YES.
If you use the Hyperswap function in an environment that has a high availability
configuration, you should specify CFW=NO to prevent DFSORT from abending
when a Hyperswap is initiated.
DSA
Performance can be improved for Blockset sort applications by using Dynamic
Storage Adjustment (DSA).
The DSA parameter sets the maximum amount of storage available to DFSORT for
dynamic storage adjustment of a Blockset sort application when
SIZE/MAINSIZE=MAX is in effect. If you specify a DSA value greater than the
TMAXLIM value, you allow DFSORT to use more storage than the TMAXLIM
value if doing so should improve performance. DFSORT only tries to obtain as
much storage as needed to improve performance up to the DSA value.
DSPSIZE
Performance can be improved for sort applications that use the Blockset technique
by using dataspace sorting.
The DSPSIZE parameter sets the maximum size of a data space to be used during
a run. Specifying DSPSIZE=MAX allows DFSORT to optimize the maximum size of
a data space to be used during a run, subject to other system and concurrent
Hipersorting, memory object sorting and dataspace sorting activity throughout the
run. Total dataspace sorting activity on a system can be further limited by the
EXPMAX, EXPOLD, and EXPRES installation options. See the description of
DSPSIZE in OPTION control statement on page 173 for more information.
FASTSRT
By specifying the COBOL FASTSRT compiler option, you can significantly reduce
DFSORT processor time, EXCPs, and elapsed time. With FASTSRT, DFSORT
input/output operations are more efficient because DFSORT rather than COBOL
does the input/output (see Figure 45 on page 804). For more details, see the
COBOL publications.
The FASTSRT option does not take effect for input and output if input and output
procedures are used in the SORT statement. Many of the functions usually
performed in an input or output procedure are the same as those done by DFSORT
INREC, OUTFIL, OUTREC, INCLUDE or OMIT, STOPAFT, SKIPREC, and SUM
functions. You might be able to eliminate your input and output procedures by
coding the appropriate DFSORT program control statements and placing them in
either the DFSPARM (DFSORT), SORTCNTL (DFSORT), or IGZSRTCD (COBOL)
data set, thereby allowing your SORT statement to qualify for FASTSRT.
803
SDB
To improve Blockset elapsed time, and disk and tape utilization, specify
installation option SDB=LARGE as your site's installation (SDB=INPUT is the
IBM-supplied default). SDB=LARGE allows DFSORT to select the
system-determined optimum block size for your disk and tape output data sets,
when appropriate.
HIPRMAX
Blockset sorting performance can be improved by using Hiperspace along with
disk for temporary storage.
The HIPRMAX parameter sets the maximum amount of Hiperspace to be used
during a run. Specifying HIPRMAX=OPTIMAL allows DFSORT to optimize the
maximum amount of Hiperspace to be used during a run, subject to other system
and concurrent Hipersorting, memory object sorting and dataspace sorting activity
throughout the run. Total Hipersorting activity on a system can be further limited
by the EXPMAX, EXPOLD, and EXPRES installation options. See the description of
HIPRMAX in OPTION control statement on page 173 for more information.
MOSIZE
Blockset sorting performance can be improved by using memory object sorting.
The MOSIZE parameter sets the maximum amount of memory object storage to be
used during a run. Specifying MOSIZE=MAX allows DFSORT to optimize the
maximum size of a memory object to be used during a run, subject to other system
and concurrent Hipersorting, memory object sorting and dataspace sorting activity
throughout the run. Total memory object sorting activity on a system can be
further limited by the EXPMAX, EXPOLD, and EXPRES installation options. See
the description of MOSIZE in OPTION control statement on page 173 for more
information.
804
OUTFIL
If you need to create multiple output data sets from the same input data set, you
can use OUTFIL to read the input data set only once, thus improving performance.
OUTFIL can be used for sort, merge, and copy applications to provide
sophisticated filtering, editing, conversion, lookup and replace, and report features.
If you are creating only a single output data set and do not need the features of
OUTFIL, use SORTOUT rather than OUTFIL for best performance.
LOCALE
You can use the LOCALE option to sort, merge, and compare character data based
on collating rules in an active locale; this enables you to obtain results with
DFSORT that were previously possible only through pre-processing or
post-processing of your data. By eliminating such costly processing, you can save
time and processing resources.
SUM
You can improve performance by using SUM to add the contents of fields. The
SUM statement adds the contents of specified SUM fields in records with identical
control fields. The result is placed in one record while the other record is deleted,
thus reducing the number of records to be output by DFSORT.
You can use installation option ZDPRINT=YES or run-time option ZDPRINT to
specify that positive zoned decimal fields that result from summing are to be
printable. That is, you can tell DFSORT to change the last digit of the zone from
hex C to hex F.
Eliminating duplicate records: You can eliminate records with duplicate keys by
specifying
SUM FIELDS=NONE
805
ICETOOL
ICETOOL is a multi-purpose utility that allows you to use DFSORT's highly
efficient I/O and processing to perform multiple operations on one or more data
sets in a single job step. ICETOOL's 17 operators allow you to perform sort, copy,
statistical, and report operations quickly and efficiently.
CKPT
The CKPT option might preclude the use of the more efficient Blockset technique.
Note: If installation option IGNCKPT=YES has been selected, DFSORT ignores the
checkpoint/restart request and selects the Blockset technique.
EQUALS
The EQUALS option increases the time needed for comparison of records and for
data transfer.
EQUCOUNT
The EQUCOUNT option takes additional time to count the number of records with
equal keys.
LOCALE
The LOCALE option may increase the time required to run an application.
NOCINV
The NOCINV option precludes the use of control interval access for more efficient
VSAM processing.
NOBLKSET
The NOBLKSET option precludes the use of the more efficient Blockset technique.
VERIFY
The VERIFY option degrades performance, because it involves extra processing.
806
EFS programs
When EFS programs are included in an application, the time required to run the
application might increase.
807
808
809
v Provide adequate virtual storage when work data sets are allocated on
non-synchronous devices, as explained in Non-synchronous storage
subsystems on page 855.
Elapsed time is decreased when DFSORT can both read input while writing to
SORTWKdd and write output while reading from SORTWKdd. If, for example,
you have two channels, the best allocation of them is to have SORTIN, SORTOUT,
and OUTFIL data sets on one and the SORTWKdd data sets on the other.
Storage requirements for different disk techniques can be estimated by using the
guidelines found in Appendix A, Using work space, on page 853.
810
Use Hipersorting
Hipersorting uses Hiperspace to improve the performance of sort applications that
use DFSORT's Blockset Technique. A Hiperspace is a high-performance data space
that resides in central storage and is backed by auxiliary storage when necessary.
With Hipersorting, Hiperspace is used in place of and along with disk for
temporary storage of records during a Blockset sort. Hipersorting reduces I/O
processing, which in turn reduces elapsed time, EXCPs, and channel usage.
Hipersorting is recommended when the input or output is a compressed sequential
or VSAM data set.
You can control the maximum amount of Hiperspace for a Hipersorting application
with the HIPRMAX parameter. HIPRMAX can direct DFSORT to dynamically
determine the maximum amount of Hiperspace, subject to the available storage at
811
Use Hipersorting
the start of the run. You can also use HIPRMAX to suppress Hipersorting when
optimizing CPU time is your major concern because Hipersorting can slightly
degrade CPU time.
The actual amount of Hiperspace a Hipersorting application uses depends upon
several factors. See the HIPRMAX description in OPTION control statement on
page 173 for more details. Most important, throughout the run, DFSORT
determines the amount of available storage as well as the amount of storage
needed by other concurrent Hipersorting, memory object sorting, and datapace
sorting applications. Based on this information, DFSORT switches dynamically
from using Hiperspace to using disk work data sets when either a storage shortage
is predicted or the total Hipersorting, memory object sorting and dataspace sorting
activity on the system reaches the limits set by the EXPMAX, EXPOLD, and
EXPRES installation options. See z/OS DFSORT Installation and Customization for a
complete description of these installation options.
812
813
814
and ICEGENER uses DFSORT copy, any incomplete spanned records DFSORT
detects in a variable spanned input data set are eliminated.
If your site has installed ICEGENER to be invoked by the name IEBGENER, you
need not make any changes to your applications to use ICEGENER. If your site
has not chosen automatic use of ICEGENER, you can use ICEGENER by
substituting the name ICEGENER for IEBGENER on the EXEC statement (when
DFSORT is directly invoked) or LINK macro (when DFSORT is program-invoked)
in any applications you choose. Program-invoked applications must be recompiled.
Following is an example of how an IEBGENER application can be changed to use
ICEGENER by substituting the name ICEGENER for the name IEBGENER in the
EXEC statement.
//GENER JOB...
// EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=CONTROL.MASTER,DISP=OLD,UNIT=3380,VOL=SER=MASTER
//SYSUT2 DD DSN=CONTROL.BACKUP,DISP=OLD,UNIT=3380,VOL=SER=BACKUP
//SYSIN DD DUMMY
815
816
12
24
817
818
Input
Output
Functions/Options
Sort
Disk
Tape
ALTSEQ
Sort
Disk
Disk
Sort
Tape
Tape
ASCII Tapes
Sort
Tape
Disk
Sort
Disk
Disk
Sort
Disk
Disk
Sort
Disk
Disk
Sort
Disk
Disk
Sort
E15
Disk
Sort
10
Disk
Disk and
SYSOUT
OUTFIL
Sort
11
Pipe
Pipes
Sort
12
Disk
Disk
INCLUDE, LOCALE
Sort
13
Sort
14
Disk
Disk
IFTHEN
Sort
15
E15
Disk
Merge
Disk
Disk
EQUALS
Merge
Disk
Disk
LOCALE, OUTFIL
Copy
Tape
Disk
Copy
Disk
Disk
INCLUDE, VLSHRT
Copy
Disk
Disk
ICEGENER
Disk
Disk
ICETOOL
Disk
Disk
819
Summary of Examples
DCOLEX2
DCOLLECT Example 2: Conversion reports
DCOLEX3
DCOLLECT Example 3: Capacity planning analysis and reports
DFHSMEX1
DFHSM Example 1: Deciphering Activity Logs
DFHSMEX2
DFHSM Example 2: Recover a DFHSM CDS with a broken index
RMMEX1
DFSMSrmm Example 1: SMF audit report
RMMEX2
DFSMSrmm Example 2: Create ADDVOLUME commands
REXX examples
Both DFSORT and ICETOOL can be called from REXX. The key is to specify
ALLOCATE statements for the data sets you need and then use an ADDRESS
statement like this:
ADDRESS LINKMVS name
which says to fetch the named program using the standard system search list.
Here is an example of a REXX CLIST to call DFSORT:
/* Simple REXX CLIST to call DFSORT */
"FREE FI(SYSOUT SORTIN SORTOUT SYSIN)"
"ALLOC FI(SYSOUT) DA(*)"
"ALLOC FI(SORTIN) DA(Y897797.INS1) REUSE"
"ALLOC FI(SORTOUT) DA(Y897797.OUTS1) REUSE"
"ALLOC FI(SYSIN)
DA(Y897797.SORT.STMTS) SHR REUSE"
ADDRESS LINKMVS ICEMAN
Here are the DFSORT control statements that might appear in the
Y897797.SORT.STMTS data set:
SORT FIELDS=(5,4,CH,A)
INCLUDE COND=(21,3,SS,EQ,CL92,J82,M72)
820
Summary of Examples
CLIST examples
Both DFSORT and ICETOOL can be called from a CLIST. They key is to specify
ALLOCATE statements for the data sets you need and then use a CALL statement
like this:
CALL *(name)
Here are the DFSORT control statements that might appear in the
Y897797.SORT.STMTS data set:
SORT FIELDS=(5,4,CH,A)
INCLUDE COND=(21,3,SS,EQ,CL92,J82,M72)
Sort examples
This section includes 14 sort examples.
JOB A400,PROGRAMMER
EXEC PGM=SORT
DD SYSOUT=A
DD DSN=A123456.IN5,DISP=SHR
01
02
03
04
Chapter 11. Examples of DFSORT job streams
821
Sort Examples
//SORTOUT DD DSN=OUT1,UNIT=3490,DISP=(,KEEP),VOL=SER=VOL001
//SORTWK01 DD UNIT=3390,SPACE=(CYL,(10,10))
//SORTWK02 DD UNIT=3390,SPACE=(CYL,(10,10))
//SYSIN
DD *
* COLLATE $, # and @ AFTER Z
SORT FIELDS=(7,5,AQ,A)
ALTSEQ CODE=(5BEA,7BEB,7CEC)
05
06
07
08
09
10
11
Line
Explanation
01
02
03
04
05
06
07
08
09
10
11
ALTSEQ statement. CODE specifies that the three characters $, # and @ are
to collate in that order after Z.
822
01
02
03
04
05
06
07
Sort Examples
//SYSIN
DD *
OMIT COND=(5,1,CH,EQ,CM)
SORT FIELDS=(20,8,CH,A,10,3,FI,D)
SUM FIELDS=(16,4,ZD)
OPTION DYNALLOC,ZDPRINT
OUTREC FIELDS=(10,3,20,8,16,4,2Z,5,1,C SUM)
08
09
10
11
12
13
Line
Explanation
01
02
03
04-05
06-07
08
09
10
11
12
13
4-11
12-15
16-17
Zeros
18
Input position 5
19-22
823
Sort Examples
824
01
02
03
04
05
06
07
08
09
10
11
Line
Explanation
01
02
03-05
SORTIN DD statement. The input data set is named SRTFIL and resides on
3590 volume 311500. It is to be deleted after this job step. It has a RECFM
of D (variable-length ASCII records), a maximum LRECL of 400, a
BLKSIZE of 404 and an ASCII label. For this job, the buffer offset is the
block length indicator. The records are to be translated from ASCII to
EBCDIC.
06-07
08
09
10
11
Sort Examples
01
02
03
04
05
06
07
08
09
10
11
12
13
Line
Explanation
01
02
03
04-05
SORTIN DD statement. The input data set is named INPUT and resides on
3490 volume FLY123. DFSORT determines from the data set label of this
standard labeled tape that the RECFM is V, the LRECL is 120 and the
BLKSIZE is 124.
06-07
08-09
MODLIB DD statement. Specifies the load libraries that contain the exit
routines. When exit routines reside in more than one library, the libraries
must be concatenated using a single DD statement.
10
11
12
825
Sort Examples
be able to determine the file size accurately unless the data set is managed
by DFSMSrmm or a tape management system that uses ICETPEX.
Specification of FILSZ can make a significant difference in work space
optimization when tape input data sets are not managed.
13
826
JOB A400,PROGRAMMER
EXEC PGM=MYPGM
DD DSN=M999999.LOAD,DISP=SHR
DD SYSOUT=A
DD SYSOUT=A
DD DSN=M999999.INPUT(MASTER),DISP=OLD
DD DSN=M999999.OUTPUT.FILE,DISP=OLD
DD *
CHALT,DYNALLOC=(,3),FILSZ=U25000
01
02
03
04
05
06
07
08
09
Line
Explanation
01
02
03
04
05
06
07
Sort Examples
08
09
01
02
03
04
05
06
07
08
09
10
For purposes of illustration, assume that none of the standard installation defaults
for batch direct invocation of DFSORT have been changed by the site.
Line
Explanation
01
02
03
04
05
06
827
Sort Examples
and overrides options and statements from all other sources. Certain
operands, such as MSGPRT and LIST/NOLIST, are used if supplied in
DFSPARM, the EXEC PARM or the invocation parameter list, but not used
if supplied in SYSIN or SORTCNTL.
07
08
09-10
828
01
02
03
04
05
06
07
08
09
10
11
12
13
Line
Explanation
01
02
Sort Examples
MSGDDN=DFSOUT specifies an alternate message data set for DFSORT
messages and control statements to prevent the COBOL messages in
SYSOUT from being interleaved with the DFSORT messages and control
statements.
03
04
05
06
EXITC statement. Specifies the load library that contains the exit routine.
07
08-09
10
11
12
13
01
02
03
04
05
06
07
08
829
Sort Examples
//SORTMODS DD UNIT=SYSDA,SPACE=(TRK,(10,,3))
//SYSIN
DD *
SORT FIELDS=(1,8,CH,A,20,4,BI,D)
MODS E11=(EXIT11,1024,EXIT,S),
E15=(E15,1024,SYSIN,T),
E17=(EXIT17,1024,EXIT2,T),
E18=(EXIT18,1024,EXIT,T),
E19=(E19,1024,SYSIN,T),
E31=(PH3EXIT,1024,EXIT,T),
E35=(PH3EXIT,1024,EXIT,T),
E38=(PH3EXIT,1024,EXIT,T),
E39=(E39,1024,SYSIN,T)
END
<object deck for E15 exit here>
<object deck for E19 exit here>
<object deck for E39 exit here>
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Line
Explanation
01
02
03
04-05
06
07
EXIT DD statement. Specifies the partitioned data set containing the object
decks for the E11, E18, E31, E35 and E38 exit routines.
08
09
10
11
12-20
830
Sort Examples
21
END statement. Marks the end of the DFSORT control statements and the
beginning of the exit routine object decks.
22-24
Object decks. The three object decks for the E15, E19, and E39 exit routines
follow the END statement.
831
Sort Examples
OUT
E15
832
DCB DDNAME=MSGOUT,...
DS
0H
E15 ROUTINE
.
.
.
L
R2,4(,R1)
GET ADDRESS OF GETMAINED AREA
.
.
.
BR
R14
RETURN TO DFSORT
.
.
.
30
31
32
33
Line
Explanation
01
02
03
04
05
06-07
08
09
10
11
12-13
14-15
MYSORT places the address of the GETMAINed work area in the user exit
address constant field in the extended parameter list. DFSORT will pass
this address to the E15 routine (in the second word of the E15 parameter
list) when it is entered.
16
17-21
The extended parameter list specifies: the address of the control statements
area, the address of the E15 routine, that no E35 routine is present, and the
address of the GETMAINed work area. F'-1' indicates the end of the
Sort Examples
extended parameter list. Subsequent parameter list fields, such as the
address of an ALTSEQ table, are not used in this application.
Because the address of the E15 routine is passed in the parameter list,
SORTIN cannot be used; if a SORTIN DD statement were present, it would
be ignored.
22-23
This is the start of the control statements area. The total length of the
control statements is specified.
24
25
RECORD statement. TYPE=F and LENGTH=80 specify that the E15 inserts
fixed-length records of 80 bytes. In this case, TYPE=F could be omitted,
because DFSORT would automatically set a record type of F. However,
LENGTH must be specified when an E15 supplies all of the input records.
26-27
28
29
30
31-33
This is MYSORT's E15 routine. The E15 routine loads the address of the
GETMAINed work area from the second word of the E15 parameter list.
The E15 routine must supply each input record by placing its address in
register 1 and placing a 12 (insert) in register 15. When all the records have
been passed, the E15 routine must place an 8 (do not return) in register
15.
JOB A400,PROGRAMMER
EXEC PGM=SORT
DD SYSOUT=A
DD DSN=GRP.RECORDS,DISP=SHR
DD DSN=GRP.ALLGRPS,DISP=OLD
01
02
03
04
05
Chapter 11. Examples of DFSORT job streams
833
Sort Examples
//ALLBU
DD DSN=GRP.BU,DISP=(NEW,CATLG,DELETE),
//
UNIT=3390,SPACE=(TRK,(10,10))
//G1STATS DD SYSOUT=A
//G2STATS DD SYSOUT=A
//SYSIN
DD
*
SORT FIELDS=(6,5,CH,A)
834
06
07
08
09
10
11
OUTFIL FNAMES=(ALLGPS,ALLBU)
12
OUTFIL FNAMES=G1STATS,
INCLUDE=(1,3,CH,EQ,CG01),
HEADER2=(1:GROUP 1 STATUS REPORT FOR ,&DATE,
- PAGE ,&PAGE,2/,
6:ITEM ,16:STATUS
,31:PARTS,/,
6:-----,16:------------,31:-----),
OUTREC=(6:6,5,
16:14,1,CHANGE=(12,
C1,CSHIP,
C2,CHOLD,
C3,CTRANSFER),
NOMATCH=(C*CHECK CODE*),
31:39,1,BI,M10,LENGTH=5,
120:X)
13
14
15
16
17
18
19
20
21
22
23
24
25
26
OUTFIL FNAMES=G2STATS,
INCLUDE=(1,3,CH,EQ,CG02),
HEADER2=(1:GROUP 2 STATUS REPORT FOR ,&DATE,
- PAGE ,&PAGE,2/,
6:ITEM ,16:STATUS
,31:PARTS,/,
6:-----,16:------------,31:-----),
OUTREC=(6:6,5,
16:14,1,CHANGE=(12,
C1,CSHIP,
C2,CHOLD,
C3,CTRANSFER),
NOMATCH=(C*CHECK CODE*),
31:39,1,BI,M10,LENGTH=5,
120:X)
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Line
Explanation
01
02
03
04
05
06-07
08
09
Sort Examples
sysout class A. Because this is an OUTFIL report data set, DFSORT sets the
RECFM to FBA (FB from SORTIN and A for ANSI control characters) and
the LRECL to 121 (1 byte for the ANSI control character and 120 bytes for
the data). DFSORT sets an appropriate BLKSIZE.
10
11
12
OUTFIL statement. The sorted input records are written to the ALLGPS
and ALLBU data sets.
13-26
27-40
01
02
03
04
05
06
07
08
09
10
11
12
13
Line
Explanation
01
02
03
04-05
06-07
835
Sort Examples
the 'PIPE' subsystem for the pipe named OUTPUT.PIPE1. The DCB
statement describes the data set characteristics to subsystem PIPE.
08-09
10
11
12
13
OUTFIL statement. The records from the SORTIN pipe are sorted and
written alternatively to the OUT1 and OUT2 pipes (that is, the sorted
records are split evenly between the two output pipes).
836
01
02
03
04
05
06
07
08
09
Line
Explanation
01
02
EXEC statement. Calls DFSORT directly by its alias name SORT. LOCALE
specified in EXEC PARM overrides the installation default for LOCALE.
The locale for the French language and the cultural conventions of Canada
will be active.
03
04
05
Sort Examples
INPUT.FRENCH.CANADA and is cataloged. DFSORT determines the
RECFM, LRECL and BLKSIZE from the data set label.
06
07
08
09
INCLUDE statement. COND specifies that only input records with equal
6-byte character compare fields starting in position 40 and position 50 are
to be included in the output data set. The character (CH) compare fields
will be compared according to the collating rules defined in locale FR_CA.
01
02
03
04
05
06
07
08
09
10
11
Line
Explanation
01
02
03
04-05
SORTIN DD statement. The first input file is a z/OS UNIX file named
/user/hfs.inp1.txt. Only read access is allowed. The file is defined as a text
file. It has fixed-length records with a record size of 80 and a block size of
240.
06-07
The second input file is a z/OS UNIX file named /user/hfs.inp2.txt. Only
read access is allowed. The file is defined as a text file. It has fixed-length
records with a record size of 80 and a block size of 80.
Chapter 11. Examples of DFSORT job streams
837
Sort Examples
08-09
10
11
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
This example shows how you can use three input files, each with a header record
('HDR'), detail records ('DTL') and a trailer record ('TRL'), and create an output file
with one header record with the current date, the sorted detail records, and one
trailer record with the current date.
838
01
02
03
04-06
07-08
09
Sort Examples
10-15
16
17-19
Example 15. Sort with 64-bit parameter lists, E15, E35 and
OUTFIL
INPUT
Variable-length records from E15
OUTPUT
Variable-length output data set
WORK DATA SETS
Dynamically allocated (by default)
USER EXITS
E15 and E35
839
Sort Examples
FUNCTIONS/OPTIONS
64-bit parameter lists, OUTFIL
The JCL for running program PGM1, and the code used by PGM1 to invoke
DFSORT with the 64-bit invocation parameter list and use the 64-bit E15 and E35
parameter lists, are shown below.
//EXAMP
JOB A400,PROGRAMMER
01
//STEP1
EXEC PGM=PGM1
02
//SYSOUT
DD SYSOUT=A
03
//SORTOUT DD DSN=PL64.OUTPUT,DISP=(NEW,CATLG,DELETE),
04
// SPACE=(CYL,(8,4)),UNIT=SYSDA
05
--------------------------------------------------------------------------------------------------------------------------------------------PGM1
CSECT
06
PGM1
AMODE 64
PGM1
RMODE 31
STM
14,12,12(13)
SAVE LOW PART REGS
BASR 15,0
SET THE TEMPORARY
USING *,15
BASE REG
M0
DS
0H
STMH 0,15,HIGHREGS
SAVE HIGH PART REGS
LLGTR 12,15
SET THE PERMANENT
DROP 15
BASE
USING M0,12
REG
LMH
0,15,HIGHZERO
SET HIGH PART OF REGS TO ZERO
ST
13,SAVE+4
SAVE SAVE AREA ADDR
LR
11,13
RELOAD SAVE AREA ADDR
LA
13,SAVE
LOAD NEW SAVE AREA ADDR
ST
13,8(11)
SAVE NEW SA ADDR INTO OLD SA
* Obtain 64-bit storage (memory object):
* - for 64-bit Invocation Parameter List
* - for 64-bit Control Statements Area
* - for work area passed to E15, E35 exits via USER ADDRESS CONSTANT
STG
12,MOTOKEN
SAVE USERTOKEN
LA
2,2
SET NUMBER OF SEGMENTS
STG
2,MOSEGM
FOR MEMORY OBJECT (MO) - 2MB
IARV64 REQUEST=GETSTOR, GET MEMORY OBJECT
+
ORIGIN=MOADDR,
ADDRESS OF MEMORY OBJECT
+
USERTKN=MOTOKEN,
USERTOKEN
+
SEGMENTS=MOSEGM,
SIZE OF MEMORY OBJECT
+
COND=YES,
CONDITIONAL REQUEST
+
MF=(E,MOWORK)
LTR
15,15
IF MEMORY OBJECT NOT OBTAINED,
BNZ
NOMO
EXIT WITH ERROR RETURN CODE
LG
10,MOADDR
GET 64-BIT ADDR IN MO FOR
*
64-BIT INVOCATION PARMLIST
USING ICE64INV,10
MAKE ADDRESSABLE
XC
0(ICE64LNG,10),0(10) CLEAR 64-BIT INVOCATION PARM LIST
MVC
ICEPLID(8),PL64SORT MOVE 64-BIT PARM LIST IDENTIFIER
LA
2,1024(,10)
GET 64-BIT ADDR IN MEMORY OBJECT
*
FOR 64-BIT CONTROL STATEMENTS AREA
STG
2,ICECTL
AND STORE IN 64-BIT PARM LIST
MVC
0(CTLNG,2),CTLST
MOVE CONTROL STATEMENTS INTO MO
*
LA
2,1024(,2)
GET 64-BIT ADDR IN MO FOR WORK AREA
STG
2,MOWA
USED IN E15, E35 EXITS
MVC
ICEUC(8),UADCON
MOVE USER EXIT ADDRESS CONSTANT
*
LLGF 2,=A(E15)
STORE E15 ADDR
840
Sort Examples
STG
OI
OI
2,ICE15E32
ICEMDEX1,ICE15A64
ICEMDEX2,ICE15PLT
LLGF 2,=A(E35)
STG
2,ICE35
OI
ICEMDEX1,ICE35A64
OI
ICEMDEX2,ICE35PLT
*
LGR
1,10
*
FREEMO
*
EXITALL
*
NOMO
*
SAVE
HIGHREGS
HIGHZERO
*
CTLST
LINK EP=SORT64
LR
11,15
DS
0H
IARV64 REQUEST=DETACH,
MATCH=USERTOKEN,
USERTKN=MOTOKEN,
COND=YES,
MF=(E,MOWORK)
LR
15,11
DS
LMH
L
L
LM
BSM
0H
0,14,HIGHREGS
13,SAVE+4
14,12(13)
1,12,24(13)
0,14
LA
B
15,20
EXITALL
DC
DC
DC
18F0
16F0
16F0
+
+
+
+
SAVE AREA
DS
0H
ADDR OF CONTROL STMTS
DC
AL2(CTL2-CTL1)
LENGTH OF CONTROL STATEMENT STRING
CTL1
EQU
*
DC
C SORT FIELDS=(5,4,BI,A)
DC
C RECORD LENGTH=(80,80,80),TYPE=V
DC
C OPTION FILSZ=E1000
DC
C OUTFIL FNAMES=SORTOUT
CTL2
EQU
*
CTLNG
EQU
*-CTLST
LENGTH OF CONTROL STATEMENTS AREA
PL64SORT DC
CPL64SORT
IDENTIFIER OF 64-BIT PARM LIST
UADCON DC
F0,A(MOWA)
USER ADDRESS CONSTANT
MOWA
DC
D0
ADDR OF WORK AREA IN MO
*
MOTOKEN DC
D0
USERTOKEN
MOSEGM DC
D0
SIZE OF MO (IN MB)
MOADDR DC
D0
ADDR OF MO
*
MOWORK DS
0D
IARV64 MACRO WORK AREA
IARV64 MF=(L,MOV64L)
*
LTORG
*
ICEPL64
MAPPING OF 64-BIT PARM LISTS
*
DROP 12
Chapter 11. Examples of DFSORT job streams
841
Sort Examples
PGM1
CSECT
************** E15 **********************************************
*
E15
DS
0H
* THIS E15 EXIT ROUTINE FORMS ALL RECORDS IN MEMORY OBJECT
* AND INSERTS THEM TO DFSORT AS 64-BIT ADRESSED RECORDS.
*
STMG 14,12,8(13)
SAVE CALLERs REGISTERS
BASR 11,0
SET
USING *,11
ADDRESSABILITY
LLGTR 11,11
SET CLEAN BASE REG
LARL 14,SAVEE15
GET NEW SAVE AREA ADDRESS
STG
13,128(,14)
CHAIN TO PREVIOUS SAVE AREA
STG
14,136(,13)
CHAIN TO NEW SAVE AREA
LGR
13,14
SET R13 TO SAVE AREA ADDRESS
LMH
0,15,E15HZERO
SET HIGH PART OF REGS TO ZERO
LR
10,1
SAVE EXIT PARAMETER LIST ADDRESS
USING ICE64E15,10
SET ADDRESSABILITY
ICM
15,15,COUNT
EXIT IF ALL RECORDS WERE
BZ
EOF
INSERTED
LLGF 1,ICE15UC+4
GET USER CONSTANT ADDR
LG
1,0(1)
GET ADDR OF THE WORK AREA IN MO
MVC
0(80,1),RECE15
MOVE RECORD INTO MEMORY OBJECT
BCTR 15,0
SET NEW
ST
15,COUNT
SORT FIELD
*
LA
15,12
RC=12 (INSERT RECORD)
* RETURN TO DFSORT
BACKE15 DS
0H
LG
13,128(,13)
RESTORE CALLERs R13
LG
14,8(,13)
RESTORE CALLERs R14
LMG
2,12,40(13)
RESTORE CALLERs R2-R12
BSM
0,14
RETURN
*
EOF
DS
0H
* Create final record in MO for its insert to DFSORT as 64-bit
* addressed record in the E35 exit
LLGF 15,ICE15UC+4
GET USER CONSTANT ADDR
LG
15,0(15)
GET ADDR IN MO FOR FINAL RECORD
XC
0(80,15),0(15)
CLEAR RECORDs DATA
MVI
1(15),8
SET NEW LENGTH OF FINAL RECORD
MVC
4(4,15),RECNUM
SET NUMBER OF INSERTED RECORDS
LA
15,8
SET RETURN CODE
B
BACKE15
RETURN CODE
*
E15HZERO DC
18F0
SAVEE15 DC
0D0,F0,CF4SA,17FD0
HIGHE15 DC
16F0
FLAGE15 DC
X00
E15MOADR DC
D0
ADDR OF MO
E15SEGM DC
D0
SIZE OF MO (IN MB)
E15TOKEN DC
D0
USERTOKEN
RECNUM
DC
F1000
NUMBER OF RECORDS
RECE15
DC
H80
LENGTH OF RECORD
DC
H0
COUNT
DC
F1000
SORT FIELD
DC
6CABCDEF
DATA
DC
6C123456
FIELDS
*
LTORG
842
Sort Examples
*
DROP
PGM1
CSECT
************** E35 ********************************************
E35
DS
0H
*
* THIS E35 EXIT ACCEPTS ALL RECORDS FROM DFSORT
* AND AT EOF INSERTS ONE RECORD TO DFSORT AS 64-BIT RECORD.
* THE ADDRESS OF THE FINAL RECORD IN MEMORY OBJECT IS PASSED
* VIA USER ADDRESS CONSTANT FIELD OF 64-BIT PARAMETER LIST.
*
STMG 14,12,8(13)
SAVE CALLERs REGISTERS
BASR 11,0
SET
USING *,11
ADDRESSABILITY
LLGTR 11,11
SET CLEAN BASE REG
LARL 14,SAVEE35
GET NEW SAVE AREA ADDRESS
STG
13,128(,14)
CHAIN TO PREVIOUS SAVE AREA
STG
14,136(,13)
CHAIN TO NEW SAVE AREA
LGR
13,14
SET R13 TO SAVE AREA ADDRESS
LMH
0,15,E35HZERO
SET HIGH PART REGS TO ZERO
LR
10,1
SAVE EXIT PARM LIST ADDRESS
USING ICE64E35,10
SET ADDRESSABILITY
ICM
1,15,ICE35RL+4
GET ADDR OF NEW RECORD
* IF ADDR OF NEW RECORD IT IS ZERO, EOF IS INDICATED
BZ
RC8E35
BR IF EOF
*
LA
15,0
ACCEPT RETURN CODE
* RETURN TO DFSORT
BACKE35 DS
0H
LG
13,128(,13)
RESTORE CALLERs R13
LG
14,8(,13)
RESTORE CALLERs R14
LMG
2,12,40(13)
RESTORE CALLERs R2-R12
BSM
0,14
RETURN
*
RC8E35 DS
0H
TM
FLAGE35,X01
IF FINAL FLAG IS ON
BO
RC8E35A
EXIT WITH 8 RETURN CODE
MVI
FLAGE35,X01
SET FINAL FLAG
LLGF 1,ICE35UC+4
GET USER CONSTANT ADDR
LG
1,0(1)
GET MO ADDR WITH FINAL RECORD
LA
15,12
SET INSERT RETURN CODE
B
BACKE35
RETURN TO DFSORT
RC8E35A DS
0H
LA
15,8
SET RETURN CODE
B
BACKE35
RETURN TO DFSORT
*
E35HZERO DC
18F0
HIGHE35 DC
18F0
SAVEE35 DC
0D0,F0,CF4SA,17FD0
FLAGE35 DC
X00
*
LTORG
*
END
Line
Explanation
01
02
EXEC statement. Calls a program named PGM1 that in turn calls DFSORT.
843
Sort Examples
03
04-05
06
Start of the complete source code for PGM1. PGM1 uses the ICEPL64
mapping macro in the DFSORT target library, SICEUSER, to provide
separate Assembler DSECTs for the 64-bit invocation and exit parameter
lists.
PGM1 LINKs to DFSORT using the name SORT64 to indicate that it is
using the 64-bit invocation parameter list. PGM1 passes SORT, RECORD,
OPTION and OUTFIL statements in the control statement area.
PGM1's E15 user exit passes 64-bit addressed records to DFSORT.
PGM1's E35 user exit accepts all of the sorted records and inserts one
additional record at EOF. DFSORT writes all of the records to the OUTFIL
data set.
MERGE examples
Although the MERGE operators in the examples in this section could all be
contained in a single ICETOOL job step, they are shown and discussed separately
for clarity.
844
01
02
03
04
05
06
07
08
09
10
11
Line
Explanation
01
02
03
Merge Examples
04
05
06
07-08
09
10
25
Line
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
Explanation
Chapter 11. Examples of DFSORT job streams
845
Merge Examples
01
02
03
04
05
06
07
08
09
10
11
12
13
14-15
OUTFIL statement. The subset of records with character values less than or
equal to '' in position 23 are written to the GP1 output data set. The
character (CH) compare field and character constant will be compared
according to the collating rules defined in locale De_DE.IBM-1047.
16-18
19
OUTFIL statement. Any records not written to the GP1 or GP2 output data
sets are written to the GP3 output data set.
Copy examples
This section contains 2 copy examples.
846
Copy Examples
01
02
03
04
05
06
07
08
09
10
Line
Explanation
01
02-03
04
05-07
08
09
10
847
Copy Examples
WORK DATA SETS
Not applicable
USER EXITS
None
FUNCTIONS/OPTIONS
INCLUDE, VLSHRT
//EXAMP
JOB A400,PROGRAMMER
//COPY
EXEC PGM=SORT
//SYSOUT
DD SYSOUT=A
//SORTIN
DD DSN=SMF.DATA,DISP=SHR
//SORTOUT DD DSN=SMF.VIOL,DISP=(,KEEP),SPACE=(CYL,(2,5)),
// UNIT=SYSDA
//SYSIN
DD *
INCLUDE COND=(6,1,FI,EQ,80,AND,19,1,BI,EQ,B1.......)
OPTION COPY,VLSHRT
01
02
03
04
05
06
07
08
09
Line
Explanation
01
02
03
04
05-06
07
08
INCLUDE statement. COND specifies that only input records with decimal
80 in the 1-byte fixed-point field at position 6 and bit 0 on in the 1-byte
binary field at position 19 are to be included in the output data set.
09
848
01
02
03
04
05
06
07
08
09
10
11
12
13
Copy Examples
18:%00,JFY=(SHIFT=RIGHT,LEAD=C(,TRAIL=C),LENGTH=7),
30:%02,SFF,TO=ZD,LENGTH=7,
40:%01,60:X)
14
15
16
Line
Explanation
01
02
03
04
05
06
07
08-16
ICEGENER example
This section contains an ICEGENER example.
INPUT
Same as for IEBGENER job
OUTPUT
Same as for IEBGENER job
WORK DATA SETS
Not applicable
USER EXITS
None
FUNCTIONS/OPTIONS
None
//EXAMP
//GENR
//SYSPRINT
//SYSUT1
//SYSUT2
//SYSIN
JOB A400,PROGRAMMER
EXEC PGM=ICEGENER
DD SYSOUT=A
DD DSN=CTL.MASTER,DISP=SHR
DD DSN=CTL.BACKUP,DISP=OLD
DD DUMMY
01
02
03
04
05
06
This example shows how to use the ICEGENER facility for an IEBGENER job if
your site has not installed ICEGENER as an automatic replacement for IEBGENER.
The ICEGENER facility selects the more efficient DFSORT copy function for this
IEBGENER job.
Line
Explanation
01
849
ICEGENER Example
02
03-06
ICETOOL example
This section contains an example of ICETOOL with various operators.
INPUT
Multiple data sets
OUTPUT
Multiple data sets
WORK DATA SETS
Dynamically allocated (automatic)
USER EXITS
ICETOOL's E35 (automatic)
FUNCTIONS/OPTIONS
OCCUR, COPY, SORT, MODE, VERIFY, STATS, DISPLAY
//EXAMP
JOB A400,PROGRAMMER
//TOOLRUN EXEC PGM=ICETOOL,REGION=1024K
//TOOLMSG DD SYSOUT=A
//DFSMSG
DD SYSOUT=A
//TOOLIN
DD *
* Print report showing departments with less than 5 employees
OCCUR FROM(IN1) LIST(LT5) LOWER(5) BLANK TITLE(Small Departments) PAGE HEADER(Department) HEADER(Employees) ON(45,3,CH)
ON(VALCNT)
* Sort by last name and first name
SORT FROM(IN1) TO(DEPTSD,DEPTSP) USING(ABCD)
* Do following operators even if a previous operator failed,
* but stop processing if a subsequent operator fails.
MODE STOP
* Verify decimal fields
VERIFY FROM(IN2) ON(22,6,PD) ON(30,3,ZD)
* Print statistics for record length and numeric fields
STATS FROM(IN2) ON(VLEN) ON(22,6,PD) ON(30,3,ZD)
* Sort and produce total for each unique key
SORT FROM(IN2) TO(OUT4) USING(CTL1)
* Print report containing:
*
- key and total for each unique key
*
- lowest and highest of the totals
DISPLAY FROM(OUT4) LIST(LIST1) TITLE(Unique key totals report) DATE TIME ON(5,10,CH) ON(22,6,PD) ON(30,3,ZD) MINIMUM(Lowest) MAXIMUM(Highest) PLUS
//LT5
DD SYSOUT=A
//IN1
DD DSN=FLY.INPUT1,DISP=SHR
//ABCDCNTL DD *
* Sort by last name, first name
SORT FIELDS=(12,15,CH,A,1,10,CH,A)
//DEPTSD
DD DSN=FLY.OUTPUT1,DISP=SHR
//DEPTSP
DD SYSOUT=A
//IN2
DD DSN=FLY.INPUT2,DISP=SHR
//OUT4
DD DSN=FLY.OUTPUT2,DISP=OLD
//CTL1CNTL DD *
* Sort and produce totals in one record for each unique key
SORT FIELDS=(5,10,CH,A)
SUM FIELDS=(22,6,PD,30,3,ZD)
//LIST1
DD SYSOUT=A
850
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
ICETOOL Example
This example shows how ICETOOL can be used to perform multiple operations in
a single step.
Line
Explanation
01
02
03
04
05
06
07-10
OCCUR operator. Prints, in the LT5 data set, a report detailing each value
for the specified field in the IN1 data set and the number of times that
value occurs.
11
Comment statement.
12
SORT operator. Records from the IN1 data set are sorted to the DEPTSD
and DEPTSP data sets using the DFSORT control statements in the
ABCDCNTL data set. As a result, FLY.OUTPUT1 and DEPTSP (SYSOUT)
contain the sorted records from FLY.INPUT1.
13-14
Comment statements.
15
MODE operator. The MODE is reset to STOP (needed in case SCAN mode
was entered due to an error for a previous operator). If an error is detected
for a subsequent operator, SCAN mode will be entered. This divides the
previous operators and subsequent operators into two unrelated groups.
16
Comment statement.
17
18
Comment statement.
19
STATS operator. Prints the minimum, maximum, average, and total for the
specified fields of the IN2 data set.
ON(VLEN) operates on the record length of the records in FLY.INPUT2.
Thus, the values printed for ON(VLEN) represent the shortest record, the
longest record, the average record length, and the total number of bytes for
FLY.INPUT2.
20
Comment statement.
21
SORT operator. Records from the IN2 data set are sorted and summarized
to the OUT4 data set using the DFSORT control statements in the
CTL1CNTL data set. As a result, FLY.OUTPUT2 contains one record from
FLY.INPUT2 for each unique sort field with totals for the sum fields.
22-24
Comment statements.
25-28
DISPLAY operator. Prints, in the LIST1 data set, a report detailing each sort
Chapter 11. Examples of DFSORT job streams
851
ICETOOL Example
and sum value for the OUT4 data set resulting from the previous
operation, and the lowest and highest value for each sum field.
29-42
852
DD statements. Defines the data sets and DFSORT control statements used
for the ICETOOL operations described previously in this section.
Central storage
DFSORT leverages central storage as intermediate work space through the use of
either memory objects or Hiperspaces. Using the installation defaults of
HIPRMAX=OPTIMAL, MOSIZE=MAX and MOWRK=YES ensures that DFSORT
will use memory object or Hiperspace whenever possible. Sites can tune their
definition of HIPRMAX=OPTIMAL and MOSIZE=MAX through use of the
EXPMAX, EXPOLD, EXPRES and TUNE installation options. See z/OS DFSORT
Installation and Customization for more information.
DFSORTs use of memory object or Hiperspace storage depends upon the
availability of central storage, the needs of other concurrent memory object sorting,
Hipersorting, and dataspace sorting applications throughout the time the
application runs, and the settings of the EXPMAX, EXPOLD, EXPRES and TUNE
installation options. Consequently, it is possible for the same application to use
varying amounts of memory object or Hiperspace storage from run to run. If
enough memory object or Hiperspace storage is available, DFSORT uses it
exclusively for intermediate storage. If the amount of available storage is
insufficient, DFSORT uses a combination of work data sets with Hiperspace or
memory object storage, or even work data sets alone.
DFSORT's use of memory object and Hiperspace storage is very dynamic; multiple
concurrent sort applications always know each other's storage needs and never try
to back their memory objects or Hiperspaces with the same portion of storage. In
addition, DFSORT checks the available storage prior to creating each memory
object or Hiperspace. Depending on the TUNE installation default each SORT
application can be more or less dynamic:
Copyright IBM Corp. 1973, 2015
853
Number of devices
Although one work data set is sufficient, using two or more work data sets on
separate devices usually reduces the elapsed time of the application significantly.
In general, using more than three work data sets does not reduce elapsed time any
further, and is only necessary if the work data sets are small or the file size is
large.
For optimum allocation of resources such as virtual storage, avoid specifying a
large number of work data sets unnecessarily.
854
4MB
200MB to 500MB
8MB
500MB to 1GB
16MB
16-32MB
855
856
Device defaults
When the device type, or the number of devices for dynamic allocation, is not
explicitly specified, DFSORT obtains the missing information from the DYNALOC
installation option information supplied by your system programmer.
Note: In rare cases where DFSORT is unable to dynamically allocate the required
space using the value supplied by d, allocation may be attempted with a more
generic unit name (such as 3390) in an effort to allocate the required space on
volumes from a different storage group. Refer to "System Managed Storage" in
z/OS DFSORT Tuning Guide for recommendations on controlling data set allocation.
857
858
Max LRECL
Cylinders (3390)
BLKSIZE
FLR
80
27920
Input Data
Set
Work Data
Set
6
FLR
160
27840
20
FLR
80
27920
26
36
20
FLR
160
27840
26
36
20
FLR
1000
27000
26
36
40
FLR
80
27920
51
56
40
FLR
160
27840
51
56
40
FLR
1000
27000
52
56
150
FLR
160
27840
189
198
VLR
300
27998
40
VLR
300
27998
51
63
40
VLR
6000
27998
55
59
150
VLR
300
27998
188
200
150
VLR
6000
27998
203
200
859
3380
15
47476
3390
15
56664
9345
15
46456
If WRKSEC is in effect and the work data set is not allocated to VIO, DFSORT
allocates secondary extents as required, even if not requested in the JCL.
Balanced tape
(BALN)
15 volumes
Polyphase tape
(POLY)
1 volume
860
Max. No. of
Work Areas
17 volumes
Comments
15 volumes
Max. No. of
Work Areas
Min=V+2* or 4 tape
units, whichever is
greater
17 volumes
Comments
File size must be given. The
tape drive containing SORTIN
cannot be used as a work
unit.
Note:
V = Number of input volumes. Number of input volumes of blocking equals work space blocking.
861
862
863
Specification/Override Of Options
//DFSPARM DD *
EQUAL,ABEND
5. For the DEBUG and OPTION statements, override is at the option level. For
example, with:
//DFSPARM DD *
OPTION EQUALS
//SYSIN DD *
OPTION NOEQUALS,SKIPREC=50
864
Specification/Override Of Options
Parameter lists
v Use with program invocation only.
v Extended parameter list accepts all DFSORT program control statements,
including those OPTION statement parameters ignored by SYSIN and
SORTCNTL.
v 24-bit parameter list accepts a subset of DFSORT program control statements.
v Using multiple parameter lists to rename the SORTCNTL data set permits
different control statements to be used for a program that invokes DFSORT more
than once.
v Can be used to pass the addresses of any user exits that your program has
placed in main storage.
Note: The extended parameter list can perform a superset of the functions in the
24-bit parameter list.
Override tables
The following tables show the possible sources of specification and order of
override for individual options.
v The order of override between sources of specification is from left to right. A
specification overrides all specifications to its right.
v The order of override within a source is from top to bottom. A specification
overrides all specifications below it.
865
Specification/Override Of Options
v For DFSPARM, 'keyword' (for example, BSAM) indicates a PARM option,
whereas 'operation keyword' (for example, DEBUG BSAM) indicates a control
statement option.
v The Function columns indicate which functions (S=sort, M=merge, or C=copy)
can use the option.
v Although alias names are available for many of the options, they are not shown
here.
866
NO
DSA
DSPSIZE
NO
DSA
OPTION DSA
DSPSIZE
OPTION DSPSIZE
CINV|NOCINV
OPTION CINV|NOCINV
NO
CINV|NOCINV
OPTION CHECK|NOCHECK
NO
NO
OPTION CHALT|NOCHALT
NO
NO
DEBUG CFW|NOCFW
DEBUG CTRx
NO
BSAM
DEBUG BSAM
NO
BSAM
AVGRLEN
OPTION AVGRLEN
OPTION COPY
SORT|MERGE FIELDS
AVGRLEN
DEBUG NOASSIST
NO
NO
ARESALL
OPTION ARESALL
INCLUDE|OMIT COND|FORMAT
ARESALL
ALTSEQ CODE
COBEXIT
NO
DEBUG ABSTP
COBEXIT
OPTION COBEXIT
NO
NO
NO
OPTION DSPSIZE
OPTION DSA
NO
NO
DEBUG CTRx
OPTION COPY
SORT|MERGE FIELDS
INCLUDE|OMIT COND|FORMAT
OPTION COBEXIT
OPTION CINV|NOCINV
OPTION CHECK|NOCHECK
OPTION CHALT|NOCHALT
DEBUG CFW|NOCFW
DEBUG BSAM
OPTION AVGRLEN
DEBUG NOASSIST
OPTION ARESALL
ALTSEQ CODE
DEBUG ABSTP
NO
DSPSIZE
DSA
DIAGSIM
Time-of-day for
activation
NO
NO
NO
COBEXIT
CINV
CHECK
CHALT
CFW
NO
NO
NO
ARESALL
ALTSEQ
NO
ABCODE
Installation (JCL,
TSO or TDx)
S,M
S,M,C
S,M,C
Function
S,M
S,M,C
Dataspace sorting
Dynamic storage
adjustment limit
Simulate
SORTDIAG DD
Statement
Simulate
SORTDIAG DD
Statement
ABEND record
count
Copy records
Include|Omit
fields
COBOL library
Control interval
access
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
CH field sequence
Force BSAM
Average record
length
Bypass Sorting
Instructions
System storage
S,M,C
above 16MB virtual
Alternate sequence
Abnormal stop
ABEND code
Description of
Option
Table 96. Directly Invoked DFSORT Option Specification/Override. Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
867
868
OPTION DYNALLOC
SORT DYNALLOC
NO
OPTION EQUALS|NOEQUALS
SORT|MERGE EQUALS|NOEQUALS
DYNALLOC
DYNAPCT
DYNSPC
EFS
NO
EQUALS|NOEQUALS
NO
ABEND|NOABEND
NO
NO
NO
NO
NO
DYNALLOC
OPTION DYNALLOC|USEWKDD
SORT DYNALLOC
DYNAPCT
OPTION DYNAPCT
DYNSPC
OPTION DYNSPC
EFS
OPTION EFS
NO
EQUALS|NOEQUALS
OPTION EQUALS|NOEQUALS
SORT|MERGE EQUALS|NOEQUALS
DEBUG EQUCOUNT
NO
NO
NO
NO
NO
OPTION EXITCK
DEBUG ESTAE|NOESTAE
DEBUG ABEND|NOABEND
DEBUG EQUCOUNT
EFS
NO2
EXPRES
EXPOLD
EXPMAX
EXITCK
ESTAE
ERET
NO
EQUALS
ENABLE
DYNSPC
DYNAPCT
DYNAUTO
DYNALOC
Installation (JCL,
TSO or TDx)
OPTION DYNSPC
OPTION DYNAPCT
OPTION DYNALLOC
SORT DYNALLOC
DYNALLOC
DYNALLOC
OPTION DYNALLOC
SORT DYNALLOC
Function
S,M,C
S,M,C
S,M,C
S,M,C
S,M
Available expanded S
storage reserved
for
non-Hipersorting
use
Old expanded
storage limit for all
DFSORT
Hiperspaces
Available expanded S
storage limit for all
DFSORT
Hiperspaces
E15/E35 return
code checking
ESTAE routine
Error action
EFS program
specified
Dynamic allocation
default space
Additional work
data sets
Automatic dynamic S
allocation
Dynamic
SORTWKs
Description of
Option
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
MODS Exx|HILEVEL=YES
E15=COB E35=COB
NO
NO
E15=COB
PARM E35=COB
MODS Exx|HILEVEL=YES
INREC parameters
JOINKEYS parameters
NO
NO
LIST|NOLIST
RECORD LENGTH
LIST|NOLIST
OPTION LIST|NOLIST
NO
NO
OPTION CKPT
SORT CKPT4
NO
4
NO
FILSZ
FILSZ
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO
NO
MERGE FILES
NO
NO
SUM FIELDS/FORMAT
HIPRMAX
NO
SORT|MERGE FIELDS|FORMAT
HIPRMAX
OPTION HIPRMAX
MERGE FILES
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO
REFORMAT parameters
JOIN parameters
OUTREC parameters
NO
RECORD LENGTH
NO
OPTION CKPT
SORT CKPT4
NO
NO
OPTION HIPRMAX
SUM FIELDS/FORMAT
SORT|MERGE FIELDS|FORMAT
REFORMAT parameters
OUTREC parameters
NO
NO
JOIN parameters
JOINKEYS parameters
INREC parameters
LIST
NO
IOMAXBF
IGNCKPT
IEXIT
IDRCPCT
HIPRMAX
FSZEST
NO
NO
NO
NO
NO
NO
NO
NO
NO
Installation (JCL,
TSO or TDx)
Print DFSORT
control statements5
Record lengths
Maximum
SORTIN/
SORTOUT
data set buffer
space
Checkpoints
ICEIEXIT
IDRC compaction
Hipersorting
File size
Sum fields
Control fields
REFORMAT fields
OUTREC
reformatting
JOIN options
JOINKEYS
processing
INREC
reformatting
Description of
Option
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M
S,M
S,C
S,M,C
S,C
S,C
S,M,C
S,M,C3
Function
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
869
870
LISTX|NOLISTX
LOCALE
NO
NO
NO
MOSIZE
MOWRK|NOMOWRK
MSGDDN
NO
MSGPRT
NO
NO
NULLOUT
ODMAXBF
OUTFIL9
OUTREL|NOOUTREL
LOCALE
OPTION LOCALE
NO
OPTION MERGEIN
NO
MOSIZE
OPTION MOSIZE
MOWRK|NOMOWRK
OPTION MOWRK|NOMOWRK
MSGDDN
OPTION MSGDDN
NO
MSGPRT
OPTION MSGPRT
OPTION NOBLKSET
NO
NULLOUT
OPTION NULLOUT
ODMAXBF
OPTION ODMAXBF
OUTFIL9
OUTREL|NOOUTREL
OPTION NOOUTREL
LISTX|NOLISTX
OPTION LISTX|NOLISTX
OUTFIL9
OPTION ODMAXBF
OPTION NULLOUT
NO
OUTREL
NO
ODMAXBF
NULLOUT
NOMSGDD
NO
MSGPRT
NO2
OPTION NOBLKSET
MSGCON
MSGDDN
NO2
NO
MOWRK
MOSIZE
OPTION MOWRK|NOMOWRK
OPTION MOSIZE
MINLIM
NO
NO2
NO
MAXLIM
LOCALE
LISTX
Installation (JCL,
TSO or TDx)
NO
NO2
NO
Function
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
OUTFIL processing
Maximum OUTFIL
data set buffer
space
Action when no
records for
SORTOUT
Action when
message data set
missing
Bypass Blockset
Print messages
Write messages on
master console
Alternate message
data set
Memory objects as
work storage
Memory object
sorting
Minimum storage
Alternate MERGE
ddnames
Maximum storage
below 16MB
virtual6
Locale processing
Print control
S,M,C
statements returned
by an EFS
program5
Description of
Option
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
NO
NO
OPTION SORTDD
7
OPTION SORTIN
SOLRF|NOSOLRF
NO
NO
NO
NO2
2
SOLRF
SMF
NO
SIZE
SDBMSG
SDB
RESET
RESALL
PARMDDN
PAD
OVFLO
OVERRGN
OUTSEC
Installation (JCL,
TSO or TDx)
OPTION SOLRF|NOSOLRF
NO
NO
SOLRF|NOSOLRF
OPTION SOLRF|NOSOLRF
NO
OPTION SDB
OPTION SMF
SDB
SDB
OPTION SDB
OPTION RESET|NORESET
OPTION SKIPREC
SORT SKIPREC
RESET|NORESET
RESET|NORESET
OPTION RESET|NORESET
OPTION RESALL
SKIPREC
RESALL
RESALL
OPTION RESALL
NO
SKIPREC
OPTION SKIPREC
SORT SKIPREC
NO
NO
OPTION PAD
OPTION MAINSIZE
PAD
PAD
OPTION PAD
OPTION OVFLO
SIZE
OVFLO
OVFLO
OPTION OVFLO
NO
SIZE
OPTION MAINSIZE
NO
NO
OPTION NOOUTSEC
NO
NO
OPTION NOOUTSEC
NO
Alternate SORTIN
ddname
ddname prefix
SORTOUT length
SMF records
Skip records
Storage
Systemdetermined
block size for
message and
list data sets
Systemdetermined
output data
set block size
NEW or MOD
VSAM output
System reserved
storage6
Alternate ddname
for DFSPARM
DFSORT LRECL
padding action
Summary fields
overflow action
Storage over
REGION
Description of
Option
S,C
S,M,C
S,M,C
S,M,C
S,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
Function
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
871
872
OPTION SPANINC
OPTION STOPAFT
SORT STOPAFT
NO
SPANINC
STOPAFT
NO
SZERO|NOSZERO
NO
NO
NO
TRUNC
NO
VERIFY|NOVERIFY
NO
VLLONG|NOVLLONG
VLSCMP|NOVLSCMP
VLSHRT|NOVLSHRT
NO
OPTION SORTOUT8
SPANINC
OPTION SPANINC
STOPAFT
OPTION STOPAFT
SORT STOPAFT
NO
SZERO|NOSZERO
OPTION SZERO|NOSZERO
NO
NO
TRUNC
OPTION TRUNC
RECORD TYPE
VERIFY|NOVERIFY
OPTION VERIFY|NOVERIFY
NO
VLLONG|NOVLLONG
OPTION VLLONG|NOVLLONG
VLSCMP|NOVLSCMP
OPTION VLSCMP|NOVLSCMP
VLSHRT|NOVLSHRT
OPTION VLSHRT|NOVLSHRT
NO
NO
OPTION VLSHRT|NOVLSHRT
OPTION VLSCMP|NOVLSCMP
OPTION VLLONG|NOVLLONG
NO
OPTION VERIFY|NOVERIFY
RECORD TYPE
OPTION TRUNC
NO
NO
NO
OPTION SZERO|NOSZERO
NO
NO2
NO
NO
NO
VSAMBSP
VLSHRT
VLSCMP
VLLONG
VIO
VERIFY
NO
TRUNC
TUNE
TMAXLIM
TEXIT
SZERO
SVC
NO
SPANINC
NO
SORTLIB
Installation (JCL,
TSO or TDx)
S,M,C
S,C
S,M,C
S,M,C
S,M
Function
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
Truncate long
output records
SORTWK virtual
I/O
Sequence check
Record format
DFSORT LRECL
truncation action
Optimize central
storage or disk
work space
Maximum storage
above and below
16MB virtual6
ICETEXIT
DFSORT SVC
Information
Input limit
Incomplete
spanned records
action
Alternate
SORTOUT ddname
Conventional
modules library
Description of
Option
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
OPTION WRKSEC|NOWRKSEC
OPTION Y2PAST
SORT|MERGE Y2PAST
WRKREL|NOWRKREL
WRKSEC|NOWRKSEC
Y2PAST
ZDPRINT|NZDPRINT
WRKREL|NOWRKREL
OPTION WRKREL|NOWRKREL
WRKSEC|NOWRKSEC
OPTION WRKSEC|NOWRKSEC
Y2PAST
OPTION Y2PAST
SORT|MERGE Y2PAST
ZDPRINT|NZDPRINT
OPTION ZDPRINT|NZDPRINT
OPTION ZDPRINT|NZDPRINT
OPTION WRKREL|NOWRKREL
OPTION VSAMIO|NOVSAMIO
VSAMIO|NOVSAMIO
VSAMIO|NOVSAMIO
OPTION VSAMIO|NOVSAMIO
OPTION VSAMEMT|NVSAMEMT
VSAMEMT|NVSAMEMT
VSAMEMT|NVSAMEMT
OPTION VSAMEMT|NVSAMEMT
ZDPRINT
Y2PAST
WRKSEC
WRKREL
VSAMIO
VSAMEMT
Installation (JCL,
TSO or TDx)
ZD SUM results
Set century
window
SORTWK
secondary
allocation
Release SORTWK
space
Description of
Option
S,M
S,M,C
S,M,C
Function
Table 96. Directly Invoked DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in
the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
873
Specification/Override Of Options
All functions do not apply to all exits. See Table 62 on page 491 and
Table 63 on page 491 for applicable exits.
874
ALTSEQ CODE
OPTION ARESALL
OPTION ARESINV
DEBUG NOASSIST
OPTION AVGRLEN
DEBUG BSAM
DEBUG CFW|NOCFW
OPTION CHALT|NOCHALT
OPTION CHECK|NOCHECK
OPTION CINV|NOCINV
OPTION COBEXIT
DEBUG ABSTP
ALTSEQ CODE
ARESALL
OPTION ARESALL
OPTION ARESINV
DEBUG NOASSIST
AVGRLEN
OPTION AVGRLEN
BSAM
DEBUG BSAM
DEBUG CFW|NOCFW
OPTION CHALT|NOCHALT
OPTION CHECK|NOCHECK
CINV|NOCINV
OPTION CINV|NOCINV
COBEXIT
OPTION COBEXIT
OPTION COBEXIT
OPTION CINV|NOCINV
OPTION CHECK|NOCHECK
OPTION CHALT|NOCHALT
DEBUG CFW|NOCFW
DEBUG BSAM
OPTION AVGRLEN
DEBUG NOASSIST
OPTION ARESINV
OPTION ARESALL
Offset 16 entry
ALTSEQ CODE
DEBUG ABSTP
NO
COBEXIT
CINV
CHECK
CHALT
CFW
NO
NO
NO
ARESINV
ARESALL
ALTSEQ
NO
ABCODE
OPTION COPY
SORT|MERGE FIELDS2
DEBUG CTRx
NO
NO
OPTION DSA
OPTION DSPSIZE
OPTION COPY
SORT|MERGE FIELDS
DEBUG CTRx
NO
NO
DSA
OPTION DSA
DSPSIZE
OPTION DSPSIZE
OPTION DSPSIZE
OPTION DSA
NO
NO
DEBUG CTRx
OPTION COPY
SORT|MERGE FIELDS
DSPSIZE
DSA
DIAGSIM
day
NO
NO
NO
DEBUG ABSTP
NO
dataspace sorting
Dynamic storage
adjustment limit
Simulate SORTDIAG
DD statement
Time-of-day for
activation
Copy records
Include|Omit fields
COBOL library
CH field sequence
Force BSAM
Bypass Sorting
Instructions
Alternate sequence
Abnormal stop
ABEND code
Description of Option
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
Function
Table 97. Extended Parameter List DFSORT Option Specification/Override. Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
875
876
OPTION DYNALLOC|
USEWKDD
SORT DYNALLOC
OPTION DYNSPC
OPTION EFS
NO
OPTION EQUALS|NOEQUALS
SORT|MERGE
EQUALS|NOEQUALS
NO
Offset 4 entry4
MODS E154|HILEVEL=YES
OPTION DYNALLOC
SORT DYNALLOC2
OPTION DYNALLOC
SORT DYNALLOC
OPTION DYNAPCT
OPTION DYNSPC
NO3
NO
OPTION EQUALS|NOEQUALS
SORT|MERGE
EQUALS|NOEQUALS2
DEBUG EQUCOUNT
DEBUG ABEND|NOABEND
DEBUG ESTAE|NOESTAE
OPTION EXITCK
NO
NO
NO
MODS E154|HILEVEL=YES
DYNALLOC
OPTION DYNALLOC
SORT DYNALLOC
DYNALLOC
OPTION DYNALLOC|
USEWKDD
SORT DYNALLOC
DYNAPCT
OPTION DYNAPCT
DYNSPC
OPTION DYNSPC
EFS
OPTION EFS
NO
EQUALS|NOEQUALS
OPTION EQUALS|NOEQUALS
SORT|MERGE
EQUALS|NOEQUALS
DEBUG EQUCOUNT
NO
NO
E15=COB
MODS E154|HILEVEL=YES
NO
NO
OPTION EXITCK
DEBUG ESTAE|NOESTAE
DEBUG ABEND|NOABEND
DEBUG EQUCOUNT
OPTION DYNAPCT
OPTION DYNALLOC
SORT DYNALLOC
NO
EXPRES
EXPOLD
EXPMAX
EXITCK
ESTAE
ERET
Exit E15
Available expanded
storage reserved for
non-Hipersorting use
Available expanded
storage limit for all
DFSORT Hiperspaces
ESTAE routine
Error action
EQUALS
NO
Enable Time-of-Day
modules
Dynamic allocation
default space
Automatic
DYNALLOC
Dynamic SORTWKs
Description of Option
ENABLE
EFS
DYNSPC
DYNAPCT
DYNAUTO
DYNALOC
S,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
Function
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
REFORMAT parameters
NO
NO
NO
NO
OPTION HIPRMAX
NO
NO
OPTION CKPT6
SORT|MERGE CKPT2,6
NO
NO
NO
HIPRMAX
OPTION HIPRMAX
NO
NO
OPTION CKPT6
SORT|MERGE CKPT6
OPTION CKPT6
SORT|MERGE CKPT6
NO
NO
OPTION HIPRMAX
NO
NO
IGNCKPT
IEXIT
IDRCPCT
HIPRMAX
GNTRUNC
GNPAD
GENER
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE2
NO
NO
FSZEST
MERGE FILES
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
MERGE FILES
FILSZ
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO
NO
MERGE FILES
SUM FIELDS|FORMAT
SORT|MERGE FIELDS|FORMAT
NO
NO
NO
NO
NO
SUM FIELDS|FORMAT
SORT|MERGE FIELDS|FORMAT
SORT|MERGE FIELDS|FORMAT
OUTREC parameters
JOIN parameters
JOINKEYS parameters
INREC parameters
MODS Exx
NO
NO
NO
NO
SUM FIELDS|FORMAT
REFORMAT parameters
REFORMAT parameters
JOINKEYS parameters
JOINKEYS parameters
JOIN parameters
INREC parameters
INREC parameters
OUTREC parameters
MODS Exx
MODS Exx
OUTREC parameters
MODS E394
MODS E394
JOIN parameters
Offset 8 entry4
MODS E354|HILEVEL=YES
MODS E354|HILEVEL=YES
Offset 28 entry4
MODS E394
Offset 4 entry
NO
Offset 24 entry
MODS E184
E35=COB
MODS E354|HILEVEL=YES
MODS E18
NO
MODS E18
Checkpoints
ICEIEXIT
IDRC compaction
Hipersorting
ICEGENER LRECL
truncation action
ICEGENER LRECL
padding action
IEBGENER name
File size
Sum fields
Control fields
REFORMAT fields
OUTREC reformatting
JOIN options
JOINKEYS processing
INREC reformatting
Exit E39
Exit E35
Exit E32
Exit E18
Description of Option
S,M,C
S,M
S,M
S,M
S,C
S,M,C
S.C
S,C
S,M,C
S,M,C5
S,M,C
S,M,C
Function
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
877
878
RECORD LENGTH
RECORD LENGTH
OPTION LOCALE
OPTION MOWRK|NOMOWRK
OPTION MSGDDN
NO
OPTION MSGPRT
NO3
NO3
NO
NO
NO
OPTION MOSIZE
OPTION MOWRK|NOMOWRK
NO3
NO
NO3
OPTION NOBLKSET
NO
OPTION NULLOUT
OPTION ODMAXBF
OUTFIL11
LISTX|NOLISTX
OPTION LISTX|NOLISTX
LOCALE
OPTION LOCALE
NO
OPTION MERGEIN
NO
OUTFIL11
OPTION ODMAXBF
OPTION NULLOUT
NO
OPTION NOBLKSET
OPTION MOSIZE
NO
OPTION MERGEIN
NO
OPTION LISTX|NOLISTX
NO
OPTION LIST|NOLIST
RECORD LENGTH
NO
NO
ODMAXBF
NULLOUT
NOMSGDD
NO
MSGPRT
MSGCON
MSGDDN
MOWRK
MOSIZE
MINLIM
NO
MAXLIM
LOCALE
LISTX
LIST
NO
IOMAXBF
LIST|NOLIST
OPTION LIST|NOLIST
NO
NO
S,M,C
S,M,C
S,M,C
Function
OUTFIL processing
Maximum OUTFIL
data set buffer space
Action when no
records for SORTOUT
Bypass Blockset
Print messages
Write messages on
master console
Alternate message
ddname
Memory objects as
work storage
Minimum storage
Alternate MERGE
ddnames
Maximum storage
below 16MB virtual8
Locale processing
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
Record lengths
Maximum
SORTIN/SORTOUT
data set buffer space
Description of Option
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
NO
OPTION SORTDD
NO3
OPTION SORTDD
OPTION SORTIN
OPTION SOLRF|NOSOLRF
OPTION SOLRF|NOSOLRF
OPTION SORTIN
OPTION SMF
OPTION SKIPREC
SORT|MERGE SKIPREC
OPTION MAINSIZE
NO
NO
OPTION SDB
OPTION RESINV
SOLRF|NOSOLRF
OPTION SOLRF|NOSOLRF
OPTION RESINV
OPTION RESINV
OPTION RESET|NORESET
OPTION SMF
OPTION RESET|NORESET
RESET|NORESET
OPTION RESET|NORESET
OPTION RESALL
OPTION SKIPREC
SORT|MERGE SKIPREC2
OPTION RESALL
RESALL
OPTION RESALL
NO
SKIPREC
OPTION SKIPREC
SORT|MERGE SKIPREC
NO
NO
OPTION PAD
OPTION MAINSIZE
OPTION PAD
PAD
OPTION PAD
OPTION OVFLO
NO
SIZE
OPTION MAINSIZE
OPTION OVFLO
OVFLO
OPTION OVFLO
NO
NO
NO
OPTION NOOUTSEC
NO
OPTION NOOUTSEC
OPTION NOOUTSEC
OPTION NOOUTREL
OPTION SDB
OPTION NOOUTREL
OUTREL|NOOUTREL
OPTION NOOUTREL
NO
NO
SOLRF
SMF
NO
SIZE
SDBMSG
SDB
RESINV
RESET
RESALL
PARMDDN
PAD
OVFLO
OVERRGN
OUTSEC
OUTREL
SDB
OPTION SDB
Alternate SORTIN
ddname
ddname prefix
SORTOUT length
SMF records
Skip records
Storage
System-determined
block size for message
and list data sets
System-determined
output data set block
size
Program reserved
storage8
System reserved
storage8
DFSORT LRECL
padding action
Summary fields
overflow action
Description of Option
S,C
S,M,C
S,M,C
S,M,C
S,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S,M,C
Function
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
879
880
OPTION SPANINC
OPTION STOPAFT
SORT|MERGE STOPAFT
NO
NO3
OPTION SPANINC
OPTION STOPAFT
SORT|MERGE STOPAFT2
NO
OPTION SZERO|NOSZERO
NO
NO
NO
OPTION TRUNC
RECORD TYPE
OPTION VERIFY|NOVERIFY
NO
OPTION VLLONG|NOVLLONG
OPTION VLSCMP|NOVLSCMP
OPTION VLSHRT|NOVLSHRT
NO
NO
OPTION SORTOUT10
SPANINC
OPTION SPANINC
STOPAFT
OPTION STOPAFT
SORT|MERGE STOPAFT
NO
SZERO|NOSZERO
OPTION SZERO|NOSZERO
NO
NO
NO
NO
OPTION VLSHRT|NOVLSHRT
OPTION VLSCMP|NOVLSCMP
OPTION VLLONG|NOVLLONG
NO
OPTION VERIFY|NOVERIFY
RECORD TYPE
OPTION TRUNC
NO
NO
NO
OPTION SZERO|NOSZERO
NO
OPTION SORTOUT10
NO
VSAMBSP
VLSHRT
VLSCMP
VLLONG
VIO
VERIFY
NO
TRUNC
TUNE
TMAXLIM
TEXIT
SZERO
SVC
NO
SPANINC
NO
SORTLIB
S,M,C
S,M,C
S,M,C
S,C
S,M,C
S,M,C
S,M
Function
S,M,C
S,M,C
S,M
S,M,C
S,M,C
Sequence check
Record format
DFSORT LRECL
truncation action
Optimize central
storage or disk work
space
Maximum storage
S,M,C
above and below 16MB
virtual8
ICETEXIT
Signed or unsigned
zero
DFSORT SVC
information
Input limit
Incomplete spanned
records action
Alternate SORTOUT
ddname
Conventional modules
library
Description of Option
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
OPTION VSAMIO|NOVSAMIO
OPTION WRKREL|NOWRKREL
OPTION WRKSEC|NOWRKSEC
OPTION Y2PAST
SORT|MERGE Y2PAST
OPTION VSAMIO|NOVSAMIO
OPTION WRKREL|NOWRKREL
OPTION WRKSEC|NOWRKSEC
OPTION Y2PAST
SORT|MERGE Y2PAST2
OPTION ZDPRINT|NZDPRINT
VSAMIO|NOVSAMIO
OPTION VSAMIO|NOVSAMIO
WRKREL|NOWRKREL
OPTION
WRKREL|NOWRKREL
WRKSEC|NOWRKSEC
OPTION WRKSEC|
NOWRKSEC
Y2PAST
OPTION Y2PAST
SORT|MERGE Y2PAST
ZDPRINT|NZDPRINT
OPTION ZDPRINT|NZDPRINT
OPTION ZDPRINT|NZDPRINT
OPTION VSAMEMT|NVSAMEMT
OPTION VSAMEMT|NVSAMEMT
VSAMEMT|NVSAMEMT
OPTION VSAMEMT|
NVSAMEMT
ZDPRINT
Y2PAST
WRKSEC
WRKREL
VSAMIO
VSAMEMT
S,M,C
Function
ZD SUM results
SORTWK secondary
allocation
S,M
S,M,C
Description of Option
Table 97. Extended Parameter List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is
specified in the Installation column, move to the next column to the left and so on. The order of override is from left to right and from top to bottom within a row.
Specification/Override Of Options
881
Specification/Override Of Options
DFSORT terminates if the exit is specified via the parameter list entry and
the exit is specified in a MODS statement.
All functions do not apply to all exits. See Table 62 on page 491 and
Table 63 on page 491 for applicable exits.
10
11
882
NO
DEBUG ABSTP
ALTSEQ CODE
OPTION ARESALL
OPTION ARESINV
DEBUG NOASSIST
OPTION AVGRLEN
DEBUG BSAM
DEBUG CFW|NOCFW
OPTION CHALT|NOCHALT
OPTION CHECK|NOCHECK
OPTION CINV|NOCINV
OPTION COBEXIT
INCLUDE|OMIT COND|FORMAT
OPTION COPY
SORT|MERGE FIELDS
DEBUG CTRx
NO
NO
OPTION DSA
NO
DEBUG ABSTP
ALTSEQ CODE
ARESALL
OPTION ARESALL
OPTION ARESINV
DEBUG NOASSIST
AVGRLEN
OPTION AVGRLEN
BSAM
DEBUG BSAM
DEBUG CFW|NOCFW
OPTION CHALT|NOCHALT
OPTION CHECK|NOCHECK
CINV|NOCINV
OPTION CINV|NOCINV
COBEXIT
OPTION COBEXIT
INCLUDE|OMIT COND|FORMAT
OPTION COPY
SORT|MERGE FIELDS
DEBUG CTRx
NO
NO
DSA
OPTION DSA
NO
NO
NO
DEBUG CTRx
SORT|MERGE FIELDS
INCLUDE|OMIT
COND|FORMAT
NO
NO
NO
NO
DEBUG CFW|NOCFW
DEBUG BSAM
NO
DEBUG NOASSIST
NO
NO
X'F6' entry
ALTSEQ CODE
DEBUG ABSTP
NO
DSA
DIAGSIM
day
NO
NO
NO
COBEXIT
CINV
CHECK
CHALT
CFW
NO
NO
NO
ARESINV
ARESALL
ALTSEQ
NO
ABCODE
S,M
S,M,C
S,M,C
Function
S,M,C
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
Dynamic storage
adjustment limit
Simulate SORTDIAG
DD statement
Time-of-day for
activation
S,M,C
S,M,C
Copy records
Include|Omit fields
COBOL library
Control interval
access
CH field sequence
Force BSAM
Average record
length
Bypass Sorting
Instructions
Alternate sequence
Abnormal stop
ABEND code
Table 98. 24-Bit List DFSORT Option Specification/Override. Options are arranged alphabetically on the Installation column. If NO is specified in the Installation
column, move to the next column to the left and so on.
Specification/Override Of Options
883
884
NO
SORT DYNALLOC
SORT DYNALLOC
NO
NO
OPTION DSPSIZE
OPTION DYNALLOC
SORT DYNALLOC
OPTION DYNALLOC
SORT DYNALLOC
OPTION DYNAPCT
OPTION DYNSPC
NO2
NO
OPTION EQUALS|NOEQUALS
SORT|MERGE EQUALS|
NOEQUALS
DEBUG EQUCOUNT
DEBUG ABEND|NOABEND
DEBUG ESTAE|NOESTAE
OPTION EXITCK
NO
NO
NO
DSPSIZE
OPTION DSPSIZE
DYNALLOC
OPTION DYNALLOC
SORT DYNALLOC
DYNALLOC
OPTION DYNALLOC|USEWKDD
SORT DYNALLOC
DYNAPCT
OPTION DYNAPCT
DYNSPC
OPTION DYNSPC
EFS
OPTION EFS
NO
EQUALS|NOEQUALS
OPTION EQUALS|NOEQUALS
SORT|MERGE EQUALS|
NOEQUALS
NO
NO
NO
EQUALS
ENABLE
EFS
DYNSPC
DYNAPCT
NO
NO
NO
NO
DEBUG ESTAE|NOESTAE
EXPRES
EXPOLD
EXPMAX
EXITCK
ESTAE
Function
S,M,C
S,M,C
S,M,C
S,M
S,M,C
S,M,C
S
Available expanded
storage reserved for
non-Hipersorting use
S
Old expanded
storage limit for all
DFSORT Hiperspaces
S
Available expanded
storage limit for all
DFSORT Hiperspaces
ESTAE routine
Error action
Enable Time-of-Day
modules
EFS program
specified
Dynamic allocation
default space
Automatic
DYNALLOC
Dynamic SORTWKs
DYNALOC1
DYNAUTO
dataspace sorting
DSPSIZE
DEBUG EQUCOUNT
SORT|MERGE
EQUALS|NOEQUALS
NO
NO
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
NO
MODS E35 |HILEVEL=YES
MODS Exx
NO
E35=COB
MODS E353|HILEVEL=YES
MODS Exx
X'04' entry
MERGE FILES
SORT|MERGE FILSZ|SIZE
JOIN parameters
OUTREC parameters
REFORMAT parameters
SORT|MERGE FIELDS|FORMAT
SUM FIELDS|FORMAT
MERGE FILES
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO
NO
NO
OPTION HIPRMAX
NO
NO
JOIN parameters
OUTREC parameters
REFORMAT parameters
SORT|MERGE FIELDS|FORMAT
SUM FIELDS|FORMAT
MERGE FILES
FILSZ
OPTION FILSZ|SIZE
SORT|MERGE FILSZ|SIZE
NO
NO
NO
HIPRMAX
OPTION HIPRMAX
NO
NO
INREC parameters
NO
NO
NO
NO
NO
SUM FIELDS|FORMAT
SORT|MERGE
FIELDS|FORMAT
REFORMAT parameters
OUTREC parameters
JOIN parameters
JOINKEYS parameters
INREC parameters
JOINKEYS parameters
JOINKEYS parameters
MODS Exx
Offset 22 entry
MODS E353|
HILEVEL=YES
Offset 18 entry
Offset 18 entry
MODS E153|
HILEVEL=YES
INREC parameters
MODS E15 |
HILEVEL=YES
E15=COB
MODS E153|
HILEVEL=YES
IEXIT
IDRCPCT
HIPRMAX
GNTRUNC
GNPAD
GENER
FSZEST
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
NO
ICEIEXIT
IDRC compaction
Hipersorting
ICEGENER LRECL
truncation action
ICEGENER LRECL
padding action
IEBGENER name
File size
Sum fields
Control fields
REFORMAT fields
OUTREC
reformatting
JOIN options
JOINKEYS
processing
INREC reformatting
S,M,C
S,M
S,M
S,M,C
S,C
S,M,C
S,C
S,C
S,M,C
S,M,C4
S,M,C
S,C
Function
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
885
886
z/OS V2R2 DFSORT Application Programming Guide
NO
NO
NO
NO
NO
X'03' entry
NO
X'FF' entry
NO2
NO2
NO
NO2
NO
OPTION MOSIZE
OPTION MOWRK|NOMOWRK
NO2
NO
NO2
OPTION NOBLKSET
NO
LISTX|NOLISTX
OPTION LISTX|NOLISTX
LOCALE
OPTION LOCALE
NO
OPTION MERGEIN
NO
MOSIZE
OPTION MOSIZE
MOWRK|NOMOWRK
OPTION MOWRK|NOMOWRK
MSGDDN
OPTION MSGDDN
NO
MSGPRT
OPTION MSGPRT
OPTION NOBLKSET
NO
NO
NO
NO
NO
NO
RECORD LENGTH
NO
RECORD LENGTH
RECORD LENGTH
NO
LIST|NOLIST
OPTION LIST|NOLIST
NO
NO
SORT|MERGE CKPT
OPTION CKPT
SORT|MERGE CKPT5
OPTION CKPT
SORT|MERGE CKPT5
NOMSGDD
NO
MSGPRT
MSGCON
MSGDDN
MOWRK
MOSIZE
MINLIM
NO
MAXLIM
LOCALE
LISTX
LIST
NO
IOMAXBF
IGNCKPT
Action when
message data set
missing
Bypass Blockset
Print messages
Write messages on
master console
Alternate message
ddname
Memory objects as
work storage
Memory object
sorting
Minimum storage
Alternate MERGE
ddnames
Maximum storage
below 16MB virtual7
Locale processing
Print control
statements returned
by an EFS program6
Print DFSORT
control statements6
Record lengths
Maximum
SORTIN/
SORTOUT
data set buffer
space
Checkpoints
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
Function
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
OPTION ODMAXBF
OUTFIL10
OPTION NOOUTREL
OPTION NOOUTSEC
NO
OPTION OVFLO
OPTION PAD
NO
OPTION RESALL
OPTION RESET|NORESET
OPTION RESINV
OPTION SDB
NO
OPTION MAINSIZE
OPTION SKIPREC
SORT|MERGE SKIPREC
SIZE
OPTION MAINSIZE
SKIPREC
OPTION SKIPREC
SORT|MERGE SKIPREC
SORT|MERGE SKIPREC
X'00' entry
NO
NO
X'01' entry
NO
NO
NO
NO
NO
NO
NO
NO
OUTFIL10
NO
NO
NO
SIZE
SDBMSG
SDB
RESINV
RESET
RESALL
PARMDDN
PAD
OVFLO
OVERRGN
OUTSEC
OUTREL
NO
ODMAXBF
NULLOUT
S,M,C
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
Function
S,M,C
S,M,C
S,M,C
S,M,C
Skip records
Storage
S,C
S,M,C
S,M,C
System-determined
block size for
message and list data
sets
System-determined
output data set block
size
Program reserved
storage7
NEW or MOD
VSAM output
System reserved
storage7
DFSORT LRECL
padding action
Summary fields
overflow action
Storage over
REGION
OUTFIL processing
Maximum OUTFIL
data set buffer space
Action when no
records for
SORTOUT
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
887
888
OPTION SORTDD
8
OPTION TRUNC
TRUNC
OPTION TRUNC
VLLONG|NOVLLONG
OPTION VLLONG|NOVLLONG
NO
NO
NO
NO
NO
NO
NO
NO
RECORD TYPE
OPTION SZERO|NOSZERO
SZERO|NOSZERO
OPTION SZERO|NOSZERO
OPTION VERIFY|NOVERIFY
NO
NO
VERIFY|NOVERIFY
OPTION VERIFY|NOVERIFY
SORT|MERGE STOPAFT
OPTION STOPAFT
SORT|MERGE STOPAFT
STOPAFT
OPTION STOPAFT
SORT|MERGE STOPAFT
RECORD TYPE
NO
OPTION SPANINC
SPANINC
OPTION SPANINC
NO
NO
NO
RECORD TYPE
NO
NO
NO
NO
NO
NO
NO
NO2
OPTION SORTOUT9
NO
NO
NO
NO
NO
NO2
SOLRF|NOSOLRF
OPTION SOLRF|NOSOLRF
OPTION SORTIN
Prefix entry
OPTION SOLRF|NOSOLRF
NO
OPTION SMF
NO
NO
VLLONG
VIO
VERIFY
NO
TRUNC
TUNE
TMAXLIM
TEXIT
SZERO
SVC
NO
SPANINC
NO
SORTLIB
NO
NO
SOLRF
SMF
S,M
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,M,C
S,C
S,M,C
S,M,C
S,M
S,C
S,M,C
S,M,C
S,M,C
Function
S,M,C
Sequence check
Record format
DFSORT LRECL
truncation action
Optimize central
storage or disk work
space
Maximum storage
above and below
16MB virtual7
ICETEXIT
Signed or unsigned
zero
DFSORT SVC
information
Input limit
Incomplete spanned
records action
Alternate SORTOUT
ddname
Conventional
modules library
Alternate SORTIN
ddname
ddname prefix
SORTOUT length
SMF records
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
NO
SORT|MERGE Y2PAST
OPTION VSAMEMT|NVSAMEMT
OPTION VSAMIO|NOVSAMIO
OPTION WRKREL|NOWRKREL
OPTION WRKSEC|
NOWRKSEC
OPTION Y2PAST
SORT|MERGE Y2PAST
VSAMEMT|NVSAMEMT
OPTION VSAMEMT|
NVSAMEMT
VSAMIO|NOVSAMIO
OPTION VSAMIO|NOVSAMIO
WRKREL|NOWRKREL
OPTION WRKREL|NOWRKREL
WRKSEC|NOWRKSEC
OPTION WRKSEC|NOWRKSEC
Y2PAST
OPTION Y2PAST
SORT|MERGE Y2PAST
OPTION ZDPRINT|NZDPRINT
NO
NO
NO
ZDPRINT|NZDPRINT
OPTION ZDPRINT|NZDPRINT
NO
OPTION VLSHRT|NOVLSHRT
VLSHRT|NOVLSHRT
OPTION VLSHRT|NOVLSHRT
NO
NO
NO
NO
NO
OPTION VLSCMP|NOVLSCMP
VLSCMP|NOVLSCMP
OPTION VLSCMP|NOVLSCMP
ZDPRINT
Y2PAST
WRKSEC
WRKREL
VSAMIO
VSAMEMT
VSAMBSP
VLSHRT
VLSCMP
ZD SUM results
SORTWK secondary
allocation
Release SORTWK
space
S,M
S,M,C
S,M,C
S,M,C
S,M,C
Function
Table 98. 24-Bit List DFSORT Option Specification/Override (continued). Options are arranged alphabetically on the Installation column. If NO is specified in the
Installation column, move to the next column to the left and so on.
Specification/Override Of Options
889
Specification/Override Of Options
890
DFSORT terminates if the exit is specified via the parameter list entry and
the user exit is specified in a MODS statement.
All functions do not apply to all user exits. See Table 62 on page 491 and
Table 63 on page 491 for applicable user exits.
10
(character EBCDIC, unsigned). Each character is represented by its 8-bit EBCDIC code.
Example: AB7 becomes
C1
C2
F7
11000001 11000010 11110111
Note:
Hexadecimal
Binary
1. If CHALT is in effect, a format CH field collates according to the ALTSEQ (alternate collating sequence)
table in effect. AQ format can be used for the same purpose.
2. If locale processing is in effect, a format CH field collates according to the collating rules of the active
locale.
ZD
(zoned decimal, signed). Each digit of the decimal number is converted into its 8-bit EBCDIC representation.
The sign indicator replaces the first four bits of the low order byte of the number.
Example: -247 becomes
2
4
- 7
Decimal
F2
F4
D7
Hexadecimal
11110010 11110100 11010111 Binary
The number +247 becomes
F2
F4
C7
11110010 11110100 11000111
Note:
1. The following are treated as positive sign indicators: F, E, C, A, 8, 6, 4, 2, 0.
2. The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1.
3. For SUM processing, 0 through 9 for the sign or A through F for a digit results in a data exception (0C7
ABEND). For example, a ZD value such as 3.5 (X'F34BF5') results in an 0C7 because B is treated as an
invalid digit. ICETOOL's DISPLAY or VERIFY operator can be used to identify ZD values with invalid
digits. ICETOOL's VERIFY operator can be used to identify ZD values with invalid signs.
4. The first four bits of the last digit is the sign indicator. The first four bits of each other digit is ignored.
Thus the EBCDIC strings '0025' and ' 25' are both treated as 25 because a leading blank (X'40') is
equivalent to a 0 digit (X'F0').
PD
(packed decimal, signed). Each digit of the decimal number is converted into its 4-bit binary equivalent. The
sign indicator is put into the rightmost four bits of the number.
Example: -247 becomes
2
4
7Decimal
2
4
7D
Hexadecimal
00100100 01111101
Binary
The number +247 becomes 247C in hexadecimal.
Note:
1. The following are treated as positive sign indicators: F, E, C, A, 8, 6, 4, 2, 0.
2. The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1.
3. For SUM processing, 0 through 9 for the sign or A through F for a digit results in a data exception (0C7
ABEND). For example, a PD value such as X' 0123BF' results in an 0C7 because B is treated as an invalid
digit. ICETOOL's DISPLAY or VERIFY operator can be used to identify PD values with invalid digits.
ICETOOL's VERIFY operator can be used to identify PD values with invalid signs.
891
(packed decimal, with sign and first digit ignored) The PD0 format can be represented as follows:
xddd...ds
x is hexadecimal 0-F and is ignored.
d is hexadecimal 0-9 and represents a decimal digit.
s is hexadecimal 0-F and is ignored.
PD0 can be used for parts of PD fields. For example, in the PD field P'mmddyy' (hexadecimal 0mmddyyC),
PD0 can be used separately for 0mmd (mm), mddy (dd) and dyyC (yy).
FI
(fixed-point, signed). The complete number is represented by its binary equivalent with the sign indicator
placed in the most significant bit position. 0 for + or 1 for -. Negative numbers are in 2's complement form.
Example: +247 becomes in halfword form
00F7
Hexadecimal
0000000011110111 Binary
-247 becomes in halfword form
FF09
Hexadecimal
1111111100001001 Binary
BI
FL
( hexadecimal floating-point, signed). The specified number is in the two-part format of characteristic and
fraction with the sign indicator in bit position 0.
Example: +247 becomes
42F70000...
Hexadecimal
0 1000010 111101110000000....... Binary
+ chara. Fraction
-247 is identical, except that the sign bit is changed to 1.
C2F70000...
Hexadecimal
1 1000010 111101110000000....... Binary
- chara. Fraction
AQ
(character EBCDIC, with alternate collating sequence, unsigned). This is similar to format CH, but the
characters collate according to the ALTSEQ (alternate collating sequence) table in effect.
AC
(character EBCDIC, with ASCII collating sequence, unsigned). This is similar to format CH, but the
characters collate according to the ASCII collating sequence.
D1
(EFS type).
User-defined data type (requires an EFS program)
D2
(EFS type).
User-defined data type (requires an EFS program)
892
Treated as:
+34
+34
+34
-3
-1234
+1234
+1234
+0
The types of data handled by the CSF or FS format encompass those produced by several different
FORTRAN, PL/I and COBOL formats, such as those shown below (using a width of 4 for purposes of
illustration):
* FORTRAN: I4 ; G4.0 ; SP,I4 ; SP,I4.3 ; S,I4.3
* PL/I: F(4) ; P'S999' ; P'SSS9' ; P'---9'
* COBOL: PIC ++9 ; PIC +999 ; PIC ++++ ; PIC ---9 ; PIC ---- ; PIC ZZZZ
UFF
SFF
Treated as:
+5827230010
+582723001
+58272300
+12312004
+4021253721
+15221
+128637240
+40052
+4001
+17382190723
+0
Treated as:
+35827230010
+3582723001
-358272300
-8231690
-12312004
+15221
-15221
+128637240
-40052
-4005
+17382190723
+0
893
(signed number, leading separate sign). This format refers to decimal data as punched into cards, and then
assembled into EBCDIC code.
Example: +247 punched in a card becomes
+
2
4
7
Punched numeric data
4E
F2
F4
F7
Hexadecimal
01001110 11110010 11110100 11110111 Binary EBCDIC code
-247 becomes
2
4
7
Punched numeric data
60
F2
F4
F7
Hexadecimal
01100000 11110010 11110100 11110111 Binary EBCDIC code
Note: A value with '-' as the leading sign character is treated as a negative value. A value with any leading
sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
CST or TS
(signed numeric, trailing separate sign). This has the same representation as the CSL format, except that the
sign indicator is punched after the number.
Example: 247+ punched on the card becomes
F2 F4 F7 4E Hexadecimal
Note: A value with '-' as the trailing sign character is treated as a negative value. A value with any trailing
sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
CLO1 or OL1
(signed numeric, leading overpunch sign). This format again refers to decimal data punched into cards and
then assembled into EBCDIC code. The sign indicator is, however, overpunched with the first decimal digit
of the number.
Example:
+2
C2
11000010
Similarly
D2
CTO or OT
(signed numeric, trailing overpunch sign). This format has the same representation as for the CLO format,
except that the sign indicator is overpunched on the last decimal digit of the number.
Example: +247 with + overpunched on 7 becomes
F2 F4 C7 hexadecimal
ASL
(signed numeric, ASCII, leading separate sign). Similar to the CSL format but with decimal data assembled
into ASCII code.
Example: +247 punched into card becomes
+
2
4
7
Punched numeric data
2B
32
34
37
Hexadecimal
0101011 00110010 00110100 00110111 Binary ASCII code
Similarly -247 becomes
2D 32 34 37 hexadecimal
Note: A value with '-' as the leading sign character is treated as a negative value. A value with any leading
sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
AST
(signed numeric, ASCII, trailing separate sign). This gives the same bit representation as the ASL format,
except that the sign is punched after the number.
Example: 247+ becomes
32 34 37 2B hexadecimal
Note: A value with '-' as the trailing sign character is treated as a negative value. A value with any trailing
sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
In the date formats below, unless specified otherwise, yy represents the two-digit
year (00-99), ddd represents the day of the year (001-366), ccyy represents the
four-digit year, mm represents the month (01-12), dd represents the day (01-31), x
represents a decimal digit (0-9), s is hexadecimal 0-F and is ignored, and c
represents the century indicator (c=0 is transformed to 19, c=1 is transformed to 20
and c>1 is transformed to 21).
894
C'yyx' or Z'yyx'
C'yyxx' or Z'yyxx'
C'yyddd' or Z'yyddd'
C'yymmdd' or Z'yymmdd'
C'ccyyddd' or Z'ccyyddd'
C'ccyymmdd' or Z'ccyymmdd'
C'xyy' or Z'xyy'
C'xxyy' or Z'xxyy'
C'dddyy' or Z'dddyy'
C'mmddyy' or Z'mmddyy'
C'dddccyy' or Z'dddccyy'
C'mmddccyy' or Z'mmddccyy'
The special indicators are X'00...00' (BI zeros), X'40...40' (blanks), C'0...0' (CH zeros), Z'0...0' (ZD zeros), C'9...9'
(CH nines), Z'9...9' (ZD nines) and X'FF...FF' (BI ones).
Y2U, Y2V, Y2X, Y2Y,
Y4U, Y4V, Y4X, Y4Y
P'yyx' (X'yyxs')
P'yyxx' (X'0yyxxs')
P'yyddd' (X'yyddds')
P'yymmdd' (X'0yymmdds')
P'ccyyddd' (X'ccyyddds')
P'ccyymmdd' (X'0ccyymmdds')
2,Y2X:
3,Y2Y:
3,Y2X:
4,Y2Y:
4,Y4X:
5,Y4Y:
P'xyy' (X'xyys')
P'xxyy' (X'0xxyys')
P'dddyy' (X'dddyys')
P'mmddyy' (X'0mmddyys')
P'dddccyy' (X'dddccyys')
P'mmddccyy' (X'0mmddccyys')
The special indicators are P'0...0' (PD zeros) and P'9...9' (PD nines).
Y2C or Y2Z
(two-digit, two-byte character or zoned-decimal year data). The two-digit year data can be represented as
follows:
xyxy
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.
Thus, 96 might be represented as hexadecimal F9F6 (character 96) or as hexadecimal F9C6 or 0906 (zoned
decimal 96).
Y2P
(two-digit, two-byte packed-decimal year data). The two-digit year data can be represented as follows:
xyyx
y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.
Thus, 96 might be represented as hexadecimal 096F or 896C (packed decimal 96).
Y2D
(two-digit, one-byte decimal year data). The two-digit year data can represented as follows:
yy
y is hexadecimal 0-9 and represents a year digit.
Thus, 96 would be represented as hexadecimal 96 (decimal 96).
895
Y2B
(two-digit, one-byte binary year data). The binary year data can be represented as follows:
hh
hh is the hexadecimal equivalent of a decimal yy value as follows:
Binary Values
X00-X63
X64-XC7
XC8-XFF
Decimal Values
00-99
100-199
200-255
yy
00-99
00-99
00-55
(SMF date interpreted as Z'yyyymmdd'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is
converted to a Z'yyyymmdd' value.
DT2
(SMF date interpreted as Z'yyyymm'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is
converted to a Z'yyyymm' value.
DT3
(SMF date interpreted as Z'yyyyddd'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is
converted to a Z'yyyyddd' value.
DC1
(TOD date interpreted as Z'yyyymmdd'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'yyyymmdd' value. The STCKCONV macro is used to do the conversion.
DC2
(TOD date interpreted as Z'yyyymm'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'yyyymm' value. The STCKCONV macro is used to do the conversion.
DC3
(TOD date interpreted as Z'yyyyddd'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'yyyyddd' value. The STCKCONV macro is used to do the conversion.
DE1
(ETOD date interpreted as Z'yyyymmdd'). The first 8 bytes of an input clock value, in the extended
time-of-day (ETOD) format, is converted to a Z'yyyymmdd' value. The STCKCONV macro is used to do the
conversion.
DE2
(ETOD date interpreted as Z'yyyymm'). The first 8 bytes of an input clock value, in the extended time-of-day
(ETOD) format is converted to a Z'yyyymm' value. The STCKCONV macro is used to do the conversion.
DE3
(ETOD date interpreted as Z'yyyyddd'). The first 8 bytes of an input clock value, in the extended
time-of-day (ETOD) format is converted to a Z'yyyyddd' value. The STCKCONV macro is used to do the
conversion.
In the time formats below, unless specified otherwise, hh represents the hour
(00-23), mm represents the minutes (00-59), ss represents the seconds (00-59), and
xx represents hundredths of a second (00-99).
Description
TM1
(SMF time interpreted as Z'hhmmss'). A 4-byte binary SMF time value in hundredths of a second is
converted to a Z'hhmmss' value.
TM2
(SMF time interpreted as Z'hhmm'). A 4-byte binary SMF time value in hundredths of a second is converted
to a Z'hhmm' value.
896
(SMF time interpreted as Z'hh'). A 4-byte binary SMF time value in hundredths of a second is converted to a
Z'hh' value.
TM4
(SMF time interpreted as Z'hhmmssxx'). A 4-byte binary SMF time value in hundredths of a second is
converted to a Z'hhmmssxx' value.
TC1
(TOD time interpreted as Z'hhmmss'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'hhmmss' value. The STCKCONV macro is used to do the conversion.
TC2
(TOD time interpreted as Z'hhmm'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'hhmm' value. The STCKCONV macro is used to do the conversion.
TC3
(TOD time interpreted as Z'hh'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format,
is converted to a Z'hh' value. The STCKCONV macro is used to do the conversion.
TC4
(TOD time interpreted as Z'hhmmssxx'). The 8 bytes of an input clock value, in the basic time-of-day (TOD)
format, is converted to a Z'hhmmssxx' value. The STCKCONV macro is used to do the conversion.
TE1
(ETOD time interpreted as Z'hhmmss'). The first 8 bytes of an input clock value, in the extended time-of-day
(ETOD) format, is converted to a Z'hhmmss' value. The STCKCONV macro is used to do the conversion.
TE2
(ETOD time interpreted as Z'hhmm'). The first 8 bytes of an input clock value, in the extended time-of-day
(ETOD) format, is converted to a Z'hhmm' value. The STCKCONV macro is used to do the conversion.
TE3
(ETOD time interpreted as Z'hh'). The first 8 bytes of an input clock value, in the extended time-of-day
(ETOD) format, is converted to a Z'hh' value. The STCKCONV macro is used to do the conversion.
TE4
(ETOD time interpreted as Z'hhmmssxx'). The first 8 bytes of an input clock value, in the extended
time-of-day (ETOD) format, is converted to a Z'hhmmssxx' value. The STCKCONV macro is used to do the
conversion.
1
The overpunch sign bit is always 'C' for positive and 'D' for negative.
CH
BI or FI
PD or
ZD
INCLUDE
MERGE
OMIT
SORT
FS or
CSF
UFF or
SFF
DTn, DCn,
DEn, TMn,
TCn, or TEn
DFSORT statements
SUM
INREC statement operands
IFTHEN WHEN=(logexp)
IFTHEN BEGIN=(logexp)
IFTHEN END=(logexp)
FIELDS
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
897
CH
BI or FI
IFTHEN WHEN=(logexp)
IFTHEN BEGIN=(logexp)
IFTHEN END=(logexp)
FIELDS
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
FS or
CSF
UFF or
SFF
DTn, DCn,
DEn, TMn,
TCn, or TEn
PD or
ZD
OMIT
IFTHEN WHEN=(logexp)
IFTHEN BEGIN=(logexp)
IFTHEN END=(logexp)
OUTREC
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
TRAILERx
IFTRAIL TRLID=(logexp)
IFTRAIL TRLUPD
ICETOOL operators
DISPLAY (ON, BREAK)
OCCUR (ON)
RANGE (ON)
SELECT (ON)
SPLICE (ON)
STATS (ON)
UNIQUE (ON)
VERIFY (ON)
DFSORT statements
INCLUDE
MERGE
898
AQ
AC
FL
X
X
X
X
LS
TS
OL
OT
or
or
or
or
CSL CST CLO CTO ASL AST
X
X
X
X
X
X
X
X
X
X
X
X
D1
D2
PD0
Y2x
X
X
X
X
Y4x
OMIT
SORT
SUM
INREC statement
operands
IFTHEN
WHEN=(exp)
IFTHEN
BEGIN=(exp)
IFTHEN END=(exp)
FIELDS
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
OUTREC statement
operands
IFTHEN
WHEN=(exp)
IFTHEN
BEGIN=(exp)
IFTHEN END=(exp)
FIELDS
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
OUTFIL statement
operands
INCLUDE
OMIT
IFTHEN
WHEN=(exp)
IFTHEN
BEGIN=(exp)
IFTHEN END=(exp)
IFTRAIL
TRLID=(exp)
OUTREC
BUILD
OVERLAY
IFTHEN BUILD
IFTHEN OVERLAY
ICETOOL operators
DISPLAY (ON)
AQ
AC
X
X
X
X
FL
LS
TS
OL
OT
or
or
or
or
CSL CST CLO CTO ASL AST
D1
D2
PD0
Y2x
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Y4x
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
899
DFSORT Format
CH
CH
ZD
ZD
CLO
n+1
CST
n+1
CSL or FS
n = 1 to 4
BI
n = 5 to 9
BI
n >= 10
BI
FI
FI
n >= 10
FI
(n/2)+1
PD
(n/2)+1
PD
COMP-1
FL
COMP-2
FL
Note:
1. PIC 9(x)V9(y) can be treated like PIC 9(n) where n=x+y. (COBOL does NOT
store the decimal point internally.)
2. PIC S9(x)V9(y) can be treated like PIC S9(n) where n=x+y. (COBOL does NOT
store the decimal point internally.)
900
Symbol
Meaning
01000000
SP
Space
01001010
01001011
01001100
01001101
01001110
01001111
01010000
.
<
(
+
I
&
Cent sign
Period, decimal point
Less than sign
Left parenthesis
Plus sign
Vertical bar, Logical OR
Ampersand
01011010
01011011
01011100
01011101
01011110
01011111
01100000
01100001
01101011
01101100
01101101
01101110
01101111
!
$
*
)
;
/
,
%
_
>
?
Exclamation point
Dollar sign
Asterisk
Right parenthesis
Semicolon
Logical not
Minus, hyphen
Slash
Comma
Percent sign
Underscore
Greater than sign
Question mark
01111010
01111011
01111100
01111101
:
#
@
'
Colon
Number sign
Commercial At
Apostrophe, prime
00000000
901
126
127
.
.
129
130
131
132
133
134
135
136
137
.
.
145
146
147
148
149
150
151
152
153
.
.
162
163
164
165
166
167
168
169
193
194
195
196
197
198
199
200
201
.
.
209
210
211
212
213
214
215
216
902
Bit Configuration
Symbol
Meaning
01111110
01111111
=
"
Equal sign
Quotation marks
10000001
10000010
10000011
10000100
10000101
10000110
10000111
10001000
10001001
a
b
c
d
e
f
g
h
i
10010001
10010010
10010011
10010100
10010101
10010110
10010111
10011000
10011001
j
k
l
m
n
0
p
q
r
10100010
10100011
10100100
10100101
10100110
10100111
10101000
10101001
11000001
11000010
11000011
11000100
11000101
11000110
11000111
11001000
11001001
s
t
u
v
w
x
y
z
A
B
C
D
E
F
G
H
I
11010001
11010010
11010011
11010100
11010101
11010110
11010111
11011000
J
K
L
M
N
O
P
Q
217
.
.
226
227
228
229
230
231
232
233
.
.
240
241
242
243
244
245
246
247
248
249
.
.
255
Bit Configuration
Symbol
11011001
11100010
11100011
11100100
11100101
11100010
11100111
11101000
11101001
S
T
U
V
W
X
Y
Z
11110000
11110001
11110010
11110011
11110100
11110101
11110110
11110111
11111000
11111001
0
1
2
3
4
5
6
7
8
9
Meaning
11111111
ASCII
Table 103 shows the collating sequence for ASCII, character, and unsigned decimal
data. The collating sequence ranges from low (00000000) to high (01111111). Bit
configurations that do not correspond to symbols are not shown.
Packed decimal, zoned decimal, fixed-point normalized floating-point data, and the
signed numeric data formats are collated algebraically; that is, each quantity is
interpreted as having a sign.
Table 103. ASCII Collating Sequence
0
.
.
32
33
34
35
36
37
38
39
.
.
Bit Configuration
Symbol
00000000
Null
00100000
00100001
00100010
00100011
00100100
00100101
00100110
00100111
SP
!
"
#
$
%
&
'
Meaning
Space
Exclamation point
Quotation mark
Number sign
Dollar sign
Percent
Ampersand
Apostrophe, prime
903
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
904
Bit Configuration
Symbol
Meaning
00101000
00101001
00101010
00101011
00101100
00101101
00101110
00101111
00110000
00110001
00110010
00110011
00110100
00110101
001101100
00110111
00111000
00111001
00111010
00111011
00111100
00111101
00111110
00111111
01000000
01000001
01000010
01000011
01000100
01000101
01000110
01000111
01001000
01001001
01001010
01001011
01001100
01001101
01001110
01001111
01010000
01010001
01010010
01010011
01010100
01010101
01010110
01010111
01011000
01011001
01011010
01011011
01011100
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
Opening parenthesis
Closing parenthesis
Asterisk
Plus
Comma
Hyphen, minus
Period, decimal point
Slash
Colon
Semicolon
Less than
Equals
Greater than
Question mark
Commercial At
Opening bracket
Reverse slash
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Bit Configuration
Symbol
Meaning
01011101
01011110
01011111
01100000
01100001
01100010
01100011
01100100
01100101
01100110
01100111
01101000
01101001
01101010
01101011
01101100
01101101
01101110
01101111
01110000
01110001
01110010
01110011
01110100
01110101
01110110
01110111
01111000
01111001
01111010
01111011
01111100
01111101
01111110
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
I
}
~
Closing bracket
Circumflex, Logical NOT
Underscore
Grave Accent
Opening Brace
Vertical Line
Closing Brace
Tilde
905
906
Checkpoint/restart
Checkpoint/Restart is a facility of the operating system that allows information
about an application to be recorded so that same application can be restarted after
abnormal termination or after some portion of the application has been completed.
Restart can take place immediately or be deferred until the application is
resubmitted.
DFSORT takes checkpoints when requested during a sort that uses the Peerage or
Vale techniques.
To have DFSORT record checkpoints you must code a SORTCKPT DD statement
and ensure the Peerage or Vale technique is selected. See SORTCKPT DD
statement on page 75 and OPTION control statement on page 173 for more
information on the SORTCKPT and CKPT options, respectively.
In general, no checkpoints are taken if the following conditions exist:
v No work data set is specified.
v The application is a copy or merge.
v Blockset is selected.
Copyright IBM Corp. 1973, 2015
907
Abend Processing
Note:
1.
2. No ANSI Standard Label tape files can be open during Checkpoint/Restart
processing.
3. Do not specify CHKPT=EOV on any DFSORT DD statement.
For more information on the Checkpoint/Restart facility, see z/OS DFSMSdfp
Checkpoint/Restart.
908
Abend Processing
The DFSORT recovery routine provides a snap dump of the system diagnostic
work area (SDWA). The snap dumps are written to a dynamically allocated data
set whether or not a SYSUDUMP (or SYSABEND or SYSMDUMP) DD statement
is included in the application.
v Copy system diagnostic work area
If an invoking program passes the address of an SDWA area in the 24-bit or
extended parameter list, DFSORT will copy the first 104 or 112 bytes of the
system diagnostic work area into the user SDWA area. See Chapter 6, Invoking
DFSORT from a program, on page 541 for more information.
v Continuation of an application after successful SORTOUT output
If an unexpected abend occurs after the sort, merge, or copy application writes
the SORTOUT data set successfully, DFSORT issues message ICE186A and
completes its normal cleanup and termination functions. The SORTOUT data set
written by DFSORT is closed. The run is successful except for the function
causing the abend. Message ICE186A says that the SORTOUT data set is usable
even though the run has abended. You can then decide to use the SORTOUT
data set or rerun the application.
v DFSORT returns control to the system at the end of its abend recovery
processing so that recovery routines can be invoked.
The DFSORT abend recovery routine functions described previously may not be
performed after an abend if NOESTAE is in effect. The DFSORT ESTAE recovery
routine is always established at the beginning of a run. It is deleted early in
DFSORT processing if NOESTAE is in effect.
909
Abend Processing
The DFSORT ESTAE recovery routine will return control to the system, which will
pass control to any ESTAE recovery routines established by invoking programs.
As described earlier, the DFSORT ESTAE recovery routine will save the first 104 or
112 bytes of the system diagnostic work area in the invoking program's SDWA area
if the address of the area is passed to DFSORT.
Since PL/I normally has an ESPIE in effect to intercept program checks (0Cx abend
codes), the DFSORT ESTAE recovery routine is not entered after these errors unless
you have specified NOSPIE. DFSORT abend recovery processing will occur for all
other types of abends.
Invocations from COBOL programs or use of COBOL exits can result in more than
one abend dump.
910
Appendix F. Accessibility
Accessible publications for this product are offered through IBM Knowledge
Center (http://www.ibm.com/support/knowledgecenter/SSLTBW/welcome).
If you experience difficulty with the accessibility of any z/OS information, send a
detailed message to the "Contact us" web page for z/OS (http://www.ibm.com/
systems/z/os/zos/webqs.html) or use the following mailing address.
IBM Corporation
Attention: MHVRCFS Reader Comments
Department H6MA, Building 707
2455 South Road
Poughkeepsie, NY 12601-5400
United States
Accessibility features
Accessibility features help users who have physical disabilities such as restricted
mobility or limited vision use software products successfully. The accessibility
features in z/OS can help users do the following tasks:
v Run assistive technology such as screen readers and screen magnifier software.
v Operate specific or equivalent features by using the keyboard.
v Customize display attributes such as color, contrast, and font size.
911
punctuation. All the syntax elements that have the same dotted decimal number
(for example, all the syntax elements that have the number 3.1) are mutually
exclusive alternatives. If you hear the lines 3.1 USERID and 3.1 SYSTEMID, your
syntax can include either USERID or SYSTEMID, but not both.
The dotted decimal numbering level denotes the level of nesting. For example, if a
syntax element with dotted decimal number 3 is followed by a series of syntax
elements with dotted decimal number 3.1, all the syntax elements numbered 3.1
are subordinate to the syntax element numbered 3.
Certain words and symbols are used next to the dotted decimal numbers to add
information about the syntax elements. Occasionally, these words and symbols
might occur at the beginning of the element itself. For ease of identification, if the
word or symbol is a part of the syntax element, it is preceded by the backslash (\)
character. The * symbol is placed next to a dotted decimal number to indicate that
the syntax element repeats. For example, syntax element *FILE with dotted decimal
number 3 is given the format 3 \* FILE. Format 3* FILE indicates that syntax
element FILE repeats. Format 3* \* FILE indicates that syntax element * FILE
repeats.
Characters such as commas, which are used to separate a string of syntax
elements, are shown in the syntax just before the items they separate. These
characters can appear on the same line as each item, or on a separate line with the
same dotted decimal number as the relevant items. The line can also show another
symbol to provide information about the syntax elements. For example, the lines
5.1*, 5.1 LASTRUN, and 5.1 DELETE mean that if you use more than one of the
LASTRUN and DELETE syntax elements, the elements must be separated by a comma.
If no separator is given, assume that you use a blank to separate each syntax
element.
If a syntax element is preceded by the % symbol, it indicates a reference that is
defined elsewhere. The string that follows the % symbol is the name of a syntax
fragment rather than a literal. For example, the line 2.1 %OP1 means that you must
refer to separate syntax fragment OP1.
The following symbols are used next to the dotted decimal numbers.
? indicates an optional syntax element
The question mark (?) symbol indicates an optional syntax element. A dotted
decimal number followed by the question mark symbol (?) indicates that all
the syntax elements with a corresponding dotted decimal number, and any
subordinate syntax elements, are optional. If there is only one syntax element
with a dotted decimal number, the ? symbol is displayed on the same line as
the syntax element, (for example 5? NOTIFY). If there is more than one syntax
element with a dotted decimal number, the ? symbol is displayed on a line by
itself, followed by the syntax elements that are optional. For example, if you
hear the lines 5 ?, 5 NOTIFY, and 5 UPDATE, you know that the syntax elements
NOTIFY and UPDATE are optional. That is, you can choose one or none of them.
The ? symbol is equivalent to a bypass line in a railroad diagram.
! indicates a default syntax element
The exclamation mark (!) symbol indicates a default syntax element. A dotted
decimal number followed by the ! symbol and a syntax element indicate that
the syntax element is the default option for all syntax elements that share the
same dotted decimal number. Only one of the syntax elements that share the
dotted decimal number can specify the ! symbol. For example, if you hear the
lines 2? FILE, 2.1! (KEEP), and 2.1 (DELETE), you know that (KEEP) is the
912
default option for the FILE keyword. In the example, if you include the FILE
keyword, but do not specify an option, the default option KEEP is applied. A
default option also applies to the next higher dotted decimal number. In this
example, if the FILE keyword is omitted, the default FILE(KEEP) is used.
However, if you hear the lines 2? FILE, 2.1, 2.1.1! (KEEP), and 2.1.1
(DELETE), the default option KEEP applies only to the next higher dotted
decimal number, 2.1 (which does not have an associated keyword), and does
not apply to 2? FILE. Nothing is used if the keyword FILE is omitted.
* indicates an optional syntax element that is repeatable
The asterisk or glyph (*) symbol indicates a syntax element that can be
repeated zero or more times. A dotted decimal number followed by the *
symbol indicates that this syntax element can be used zero or more times; that
is, it is optional and can be repeated. For example, if you hear the line 5.1*
data area, you know that you can include one data area, more than one data
area, or no data area. If you hear the lines 3* , 3 HOST, 3 STATE, you know
that you can include HOST, STATE, both together, or nothing.
Notes:
1. If a dotted decimal number has an asterisk (*) next to it and there is only
one item with that dotted decimal number, you can repeat that same item
more than once.
2. If a dotted decimal number has an asterisk next to it and several items
have that dotted decimal number, you can use more than one item from the
list, but you cannot use the items more than once each. In the previous
example, you can write HOST STATE, but you cannot write HOST HOST.
3. The * symbol is equivalent to a loopback line in a railroad syntax diagram.
+ indicates a syntax element that must be included
The plus (+) symbol indicates a syntax element that must be included at least
once. A dotted decimal number followed by the + symbol indicates that the
syntax element must be included one or more times. That is, it must be
included at least once and can be repeated. For example, if you hear the line
6.1+ data area, you must include at least one data area. If you hear the lines
2+, 2 HOST, and 2 STATE, you know that you must include HOST, STATE, or
both. Similar to the * symbol, the + symbol can repeat a particular item if it is
the only item with that dotted decimal number. The + symbol, like the *
symbol, is equivalent to a loopback line in a railroad syntax diagram.
Appendix F. Accessibility
913
z/OS information
z/OS information is accessible using screen readers with the Library Server
versions of z/OS books in the Internet library at:
http://www.ibm.com/systems/z/os/zos/bkserv/
914
Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may
be used instead. However, it is the user's responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATIONAS IS WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply
to you.
This information could include technical inaccuracies or typographical errors.
Changes are periodically made to the information herein; these changes will be
incorporated in new editions of the publication. IBM may make improvements
and/or changes in the product(s) and/or the program(s) described in this
publication at any time without notice.
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
915
IBM Corporation
Mail Station P300
2455 South Road
Poughkeepsie, NY 12601-5400
USA
Such information may be available, subject to appropriate terms and conditions,
including in some cases, payment of a fee.
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other countries,
or both. If these and other IBM trademarked terms are marked on their first
occurrence in this information with a trademark symbol ( or ), these symbols
indicate U.S. registered or common law trademarks owned by IBM at the time this
information was published. Such trademarks may also be registered or common
law trademarks in other countries. A current list of IBM trademarks is available on
the Web at http://www.ibm.com/legal/copytrade.shtml.
Linux is a trademark of Linus Torvalds in the United States, other countries, or
both.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States, other countries, or both.
Other company, product, and service names may be trademarks or service marks
of others.
916
Index
Special characters
/OT (trailing overpunch sign) format
description 894
% parameter
of PARSE operand
on OUTFIL statement 241
%nn parameter
of PARSE operand
on OUTFIL statement 240
Numerics
24-bit parameter list
examples 560
format 544
64-bit parameter list
format 554
A
ABCODE
ABEND Code 35
installation option 18
abend
categories 908
checkpoint/restart 907
critical 909
CTRx processing 909
processing 907, 910
processing for unexpected
abends 908, 909
recovery 908, 909
ESTAE 907
ABEND
DEBUG control statement option
EXEC PARM option 35
ABSPOS=p parameter
of PARSE operand
on OUTFIL statement 242
ABSTP
DEBUG control statement option
processing 908
AC (ASCII character) format
description 892
where allowed 897
ACCEPT parameter
OUTFIL control statements
option 227, 235
accessibility 911
contact IBM 911
features 911
screen readers 915
action codes 779
adding fields and constants
INREC 136
OUTFIL 282
OUTREC 412
adding records 492
E15 user exit 499, 523
E35 user exit 529
Copyright IBM Corp. 1973, 2015
91
92
ADDPOS=x parameter
of PARSE operand
on OUTFIL statement 243
addressing
EFS program 768
EFS program user exit routine 792
user exits 494
ALIAS statement 496
aliases
DFSORT 29
OPTION statement options 219
PARM options 60
alignment field 130, 407
allocating storage
intermediate storage 810
main storage 807
temporary work space 810
allocating temporary work space
efficiently 810, 811
altering records 492
See also reformatting records 125
ALTSEQ
installation option 18
ALTSEQ control statement 90
examples 89
function 83
TABLE Option 88
using 88, 90
ALTSEQ Statement Examples 89, 90
AMODE 494, 498
AQ (character EBCDIC, with alternate
collating sequence, unsigned) format
description 892
where allowed 897
ARESALL
EXEC PARM option 35
installation option 18
OPTION control statement
option 176
releasing main storage 809
using RESERVEX instead of
ARESALL 35
ARESINV
installation option 18
OPTION control statement
option 176
releasing main storage 809
arithmetic
INREC 136
OUTFIL 282
OUTREC 412
ASL (ASCII leading sign) format
description 894
where allowed 897
Assembler user exit routines
input phase user exits 498, 509
output phase user exits 510, 517
assistive technologies 911, 913
AST (ASCII trailing sign) format
description 894
where allowed 897
ATTACH
description 541
writing macro instructions 559
Attention
"do not return" return code 495
Explanation field length 551
invalid syntax for incorrectly placed
blanks 87
performance degradation 36
RDW 264, 411
reformatted input record 135
unpredictable results with order of
data sets when using BSAM
processing with concatenated
SORTIN input 92
using the SIZE or FILSZ
parameter 190
when USING(xxxx) is not
specified 718
where USING(xxxx) is not
specified 646
AVGRLEN
EXEC PARM option 35
OPTION control statement
option 176
B
BI (binary) format
description 892
where allowed 897
binding
performance 806
bit comparison tests 112
bit operators 112
BLDINDEX 817
BLKCCH1 parameter
OUTFIL control statements
option 369
BLKCCH2 parameter
OUTFIL control statements
option 370
BLKCCT1 parameter
OUTFIL control statements
option 370
block
minimum length 14
blocking records 800
Blockset
DFSORT 26
BSAM
DEBUG control statement option
E18 user exit 504
E19 user exit 507
EXEC PARM option 36
BUILD parameter
INREC statement 129
OUTFIL statement 228, 252
OUTREC statement 406
92
917
C
cache fast write
specifying use of with OPTION
control statement 92
using to improve performance 803
cataloged procedures
SORT 30
SORT cataloged procedure 30
SORTD 31
SORTD cataloged procedure 31
cataloged procedures procedures,
catalogued
defined 30
specifying 30
century window 218, 385, 446, 873
CFW
installation option 18
using on OPTION control
statement 92
using to improve performance 803
CH (character) format
description 891
where allowed 897
CHALT
installation option 19
OPTION control statement
option 177
changing records 492
E15 user exit 499, 523
E35 512
E35 user exit 529
See also reformatting records 125
character constants 104, 131, 258, 340,
346, 408
character strings
for current date 105
for future date 106
for past date 106
CHECK
installation option 19
OPTION control statement
option 177
checkpoint/restart (CHKPT)
restrictions 908
using 907
CINV
EXEC PARM option 36
installation option 19
OPTION control statement
option 178
CKPT
efficiency 806
OPTION control statement
option 178
SORT control statement option 448
CLIST examples 821
CLO (leading overpunch sign) format
description 894
where allowed 897
closing data sets
E17 user exit 503
E37 user exit 517
housekeeping 776
with an EFS program 772, 776
with user exits 493
COBEXIT
EXEC PARM option 36
918
COBEXIT (continued)
installation option 19
OPTION control statement
option 179
COBOL
input phase user exits 523
output phase user exit 529
overview 521
requirements for copy processing 522
storage requirements 522
user exit routine requirements 521
user exit routines 521, 523, 529
COBOL E15 user exit
altering records 535
changing records for Sort 523
passing records for Sort 523
COBOL E35 user exit
changing records 529
inserting records 536
CODE
ALTSEQ control statement option 88
coding control statements 83
coding restrictions 88
collating sequence 88
altering with user exit 492
alternate 6
ASCII 6
defined 6
EBCDIC 6
modifying 6
combining data sets
See merging records 162
comment statement 87
comparison operator 99, 118
comparisons
OMIT control statement 170
COND
INCLUDE control statement
option 98
OMIT control statement option 171
considerations
data set 12
key-sequenced data set (KSDS) 16
QSAM data set 15
record descriptor word (RDW) 16
VSAM data set 16
constants
bit string 116, 125
character string 104, 131, 258, 340,
346, 408
for current date 105
for future date 106
for past date 106
date string 118
decimal number 102
for current date 103
for future date 103
for past date 104
for current date 258
for future date 259
for past date 260
hexadecimal string 107, 131, 258, 340,
346, 408
contact
z/OS 911
continuation column 85
continuation lines 85
copying (continued)
defined 1
overview 12
copying records
SORT control statement option 448
with MERGE control statement 163
COUNT operator (ICETOOL) 579
critical errors 909
CSF (floating sign) format
description 893
where allowed 897
CSL (leading sign) format
description 894
where allowed 897
CST (trailing sign) format
description 894
where allowed 897
CTO (trailing overpunch sign) format
description 894
where allowed 897
CTRx
abend processing 909
DEBUG control statement option 92
cultural environment
See LOCALE 7
current date
character string for 105
decimal number constant for 103
cylinders 801, 859
D
D1 (EFS type) format
description 892
where allowed 897
D2 (EFS type) format
description 892
where allowed 897
data formats
descriptions 891
where allowed 897
data set 12
closing 493
closing with user exit routines 503,
517
defining 12
handling input with user exit
routines 517
handling output with user exit
routines 517
input 11
shared tape unit 63
key-sequenced, considerations 16
message data set 25
notes and limitations 13, 15
opening with user exit routines 492,
499, 510
output 12
shared tape unit 63
page=end.considerations 15
QSAM considerations 15
requirements 12
valid types 12
VSAM considerations 16
919
E
E11 user exit
initializing routines
920
499
EFS Program
example 798
EFS01
function description 789
parameter list 790
user exit routine 789
EFS02
address=0 798
function description 789
parameter list 792
user exit routine 790
EFSDPAFT 795
DEBUG control statement option 93
EFSDPBFR 795
DEBUG control statement option 93
elapsed time
improving with devices 802
END control statement
examples 95
function 83
using 95, 96
ENDAT=an parameter
of PARSE operand
on OUTFIL statement 249
ENDAT=BLANKS parameter
of PARSE operand
on OUTFIL statement 249
ENDAT=string parameter
of PARSE operand
on OUTFIL statement 248
ENDBEFR=an parameter
of PARSE operand
on OUTFIL statement 247
ENDBEFR=BLANKS parameter
of PARSE operand
on OUTFIL statement 248
ENDBEFR=string parameter
of PARSE operand
on OUTFIL statement 247
ENDREC parameter
OUTFIL control statements
option 227, 232
enhancing performance with installation
options 802
EODAD 505
EQUALS 6
efficiency 806
EXEC PARM option 40
installation option 19
MERGE control statement option 164
OPTION control statement
option 185
SORT control statement option 448
EQUCOUNT
DEBUG control statement option 93
efficiency 806
ERET
installation option 19
EROPT 505
error messages 25
error recovery routine
user exit 492
errors
critical 909
debugging jobs 91
diagnosing EFS 795
error recovery routines 492
ESTAE
DEBUG control statement option 94
installation option 20
recovery routine 907
ETOD date (DEn) and time (TEn) formats
descriptions 896, 897
where allowed 897
exceeding tape work space capacity 861,
862
EXEC statement
cataloged procedure
SORT 30, 65
SORTD 31, 63
cataloged procedures 30
defined 29
operands 32, 59
PARM options 32, 865
alias PARM options 60
syntax 32
using 29, 60
using with control statements 32
execution phase run-time phase 768
exit
MODS control statement option 166
See also user exit 487
exit routine
EFS 788
EXITCK
ICEMAC installation option 499, 537
installation option 20
OPTION control statement
option 186
user exit return codes 537
EXLST 505, 508
EXPMAX installation option 20, 804, 853
EXPOLD installation option 20, 804, 853
EXPRES installation option 20, 804, 853
Extended Function Support
See EFS 767
extended parameter list
example 560
format 551, 553
extract buffer offsets list 785
F
FASTSRT
efficiency 803
FI (fixed-point) format
description 892
where allowed 897
Field and Constant Symbols
overview 731
field formats
control 445
ICETOOL operators
DISPLAY 599
RANGE 650, 662
SELECT 671
summary 452
fields
fixed position/length 1
variable position/length 1
FIELDS parameter
INREC statement 129
MERGE statement 163
OUTREC statement 406
921
G
GENER installation option 20
general coding rules 83, 88
general considerations 13, 14
GNPAD installation option 20, 816
GNTRUNC installation option 20, 816
group processing 322
INREC statement 147
OUTFIL statement 322
OUTREC statement 423
H
handling input data sets
E18 user exit 504
E38 user exit 517
handling input to a merge
E32 user exit 510
handling intermediate storage
miscalculation
E16 user exit 503
handling output data sets
E39 user exit 517
handling output to work data sets
E19 user exit 507
handling special I/O 492
HEADER parameter
DISPLAY operator 613
OCCUR operator 657
HEADER1 parameter
OUTFIL control statements
option 228, 338, 343
HEADER2 parameter
OUTFIL control statements
option 228, 351
922
HEADER3 parameter
OUTFIL control statements
option 361
hexadecimal constants 107, 131, 258,
340, 346, 408
hexadecimal display
DISPLAY operator 606
OCCUR operator 653
HILEVEL=YES
MODS control statement option 167
Hipersorting
advantages to using 811
defined 811
Hiperspace
defined 811
limiting factors 190
HIPRMAX
efficiency 811
EXEC PARM option 43
installation option 20
OPTION control statement
option 190
home page (web) 4
how EFS works 768, 773
how user exit routines affect DFSORT
performance 495
I
I/O errors 492
ICEGENER
efficiency 813
example 849, 850
return codes 816
ICEGENER facility 813, 817
ICEMAC installation options 18, 24
ICETOOL 563
calling from a program 722
coding rules 574
complete sample job 850
COPY 565, 570, 575
COUNT 565, 579
DATASORT 585
DEFAULTS 590
description 563
DFSMSG DD statement 564
DISPLAY 565, 569, 594
example of simple job 566
examples 568, 569, 585, 588, 626, 645,
659, 664, 666, 673, 691, 710, 716, 719,
721
ICETOOL/DFSORT relationship 563
invoking 567
JCL 564, 571, 572, 573
JOBLIB DD statement 564
MERGE 642
MODE 565, 568, 570
OCCUR 565, 569, 646
operators 565, 566, 568, 569, 570, 575,
579, 585, 590, 594, 642, 646, 662, 664,
668, 677, 681, 708, 710, 718, 720
Parameter List Interface 567, 572, 722
RANGE 566, 569, 662
RESIZE 664
restrictions 573, 727
return codes 728
SELECT 566, 570, 668
ICETOOL (continued)
SORT 566, 570, 677
SPLICE 566, 681
statements 571, 574
STATS 566, 569, 708
STEPLIB DD statement 564
SUBSET 710
summary 564, 565
SYMNAMES DD statemen 564
SYMNOUT DD statemen 564
TOOLIN DD statement 564, 572
TOOLIN Interface 567, 572, 722
TOOLMSG DD statement 564, 571
UNIQUE 566, 570, 718
using SET and PROC symbols 567
using symbols 567
VERIFY 566, 568, 720
IDRCPCT installation option 20
IEBGENER 813
IEFUSI 809
IEXIT installation option 20
IFTHEN parameter
INREC statement 144
OUTFIL statement 228, 252
OUTREC statement 420
IFTRAIL parameter
OUTFIL control statements
option 370
IGNCKPT installation option 20
improving efficiency 799
INCLUDE control statement
efficiency 805
examples 108, 117
function 82
logical operator 124
relational condition 99
comparison operator 99, 118
substring comparison operator 111
INCLUDE parameter
OUTFIL control statements
option 227, 233
INCLUDE/OMIT statement notes 124
INCLUDE/OMIT Statement Notes 124
including records 96, 169
user-defined data types 767
including records keeping records 1
information DFSORT passes to your
routine
E15 user exit 500
E32 user exit 510
E35 user exit 513
E61 user exit 509
information flags 786
Initialization Phase 770
initializing data sets 492, 770
initializing routines
E11 user exit 499
E31 user exit 510
initiating DFSORT
See invoking DFSORT 541
INPFIL control statement 88
input data set
requirements 12
valid types 12
input data sets
missing attributes of
set by DFSORT 68
J
Japanese characters 13, 767
JCL 27
cataloged procedure 63, 65
cataloged procedures, specifying 30
DD statement summary 27
EFS coding rules 779
EXEC statement 29
improving DFSORT efficiency 799
JOB statement 29
overview 27
procedures, cataloged 30
required 27
JCL DD statements 542
JCL DD Statements 552
JCL-invoked DFSORT 866, 874
job control language
see also JCL 27
JOB statement
defined 29
using 29
JOBLIB DD statement
defined 27
using 64
Join
SPLICE operator
JOINKEYS
overview 457
681
K
key-sequenced data set (KSDS)
key, defined 5
keyboard
navigation 911, 913
PF keys 911, 913
shortcut keys 911, 913
16
L
label field 84
length
altered control statement 785
LRECL for variable-length record 16
maximum record 14
original control statement 785
record descriptor word (RDW) 16
record lengths list 786
limitations
data set 13
length
maximum record 14
minimum block 14
minimum record 14
record
maximum length 14
storage constraints 14
LINES parameter
OUTFIL control statements
option 228
LINK 541
writing macro instructions 559
link-editing
performance 806
user exit routines 498
linkage conventions 496
linkage editor 65
linkage examples 497
LIST
EXEC PARM option 44
installation option 21
OPTION control statement
option 192
with an EFS program 776
LISTX
EXEC PARM option 44
installation option 21
OPTION control statement
option 192
with an EFS program 776
loading user exit routines 496
locale
affecting INCLUDE and OMIT
processing 108
affecting MERGE processing 163
defined 7
restrictions
CHALT 177
EFS 40, 185
LOCALE
efficiency 805, 806
EXEC PARM option 45
installation option 21
OPTION control statement
option 193
using 7
logical operator 124
LookAt message retrieval tool xvi
lookup and change 228, 296, 383
LS (leading sign) format
description 894
where allowed 897
M
macro instructions
See system macro instructions 541
main features of sources of DFSORT
options 864, 865
main storage
allocating
consequences of increasing 808
allocating efficiently 807
minimum 807
releasing 809
tuning 807
using efficiently 807, 810
MAINSIZE 52
allocating storage 807
OPTION control statement
option 194
releasing main storage 809
Major Call 1 796
Major Call 2 796
Major Call 3 797
Major Call 4 798
Major Call 5 798
major control field 6
master console messages 25
Match
SPLICE operator 681
MAX
EXEC PARM option 52
maximizing performance 799
maximum of fields and constants
INREC 136
OUTFIL 282
OUTREC 412
MAXLIM
allocating storage 807
installation option 21
releasing main storage 809
memory object
definition 195, 197
specifying with EXEC PARM 45, 46
specifying with OPTION control
statement 195, 197
memory object sorting
advantages 813
considerations 813
definition 813
MERGE control statement
examples 165
function 81
using 162, 165
merge examples 845
Index
923
924
MSGDDN (continued)
OPTION control statement
option 197
MSGPRT
alternate forms 47
EXEC PARM option 47
installation option 21
OPTION control statement
option 198
multiple output data sets
creating with OUTFIL 3, 225, 377
multiplying fields and constants
INREC 136
OUTFIL 282
OUTREC 412
N
navigation
keyboard 911, 913
NOABEND
DEBUG control statement option 91
EXEC PARM option 35
NOASSIST
DEBUG control statement option 95
NOBLKSET
efficiency 806
OPTION control statement
option 198
NOCFW
using on OPTION control
statement 92
NOCHALT
OPTION control statement
option 177
NOCHECK
OPTION control statement
option 177
NOCINV
efficiency 806
EXEC PARM option 36
OPTION control statement
option 178
NODETAIL parameter
OUTFIL control statements
option 228, 369
NOEQUALS
EXEC PARM option 40
MERGE control statement option 164
OPTION control statement
option 185
NOESTAE
DEBUG control statement option 94
NOHEADER parameter
DISPLAY operator 615
OCCUR operator 657
NOLIST
EXEC PARM option 44
OPTION control statement
option 192
with an EFS program 776
NOLISTX
EXEC PARM option 44
OPTION control statement
option 192
with an EFS program 776
NOMOWORK
EXEC PARM option 46
NOMOWRK
OPTION control statement
option 197
NOMSGDD installation option 21
NOOUTREL
EXEC PARM option 49
OPTION control statement
option 199
NOOUTSEC
OPTION control statement
option 199
NORESET
EXEC PARM option 50
NOSOLRF
EXEC PARM option 53
OPTION control statement
option 207
NOSZERO
EXEC PARM option 54
OPTION control statement
option 210
NOVERIFY
EXEC PARM option 55
OPTION control statement
option 212
NOVLLONG
EXEC PARM option 56
OPTION control statement
option 213
NOVLSCMP
EXEC PARM option 56
OPTION control statement
option 213
NOVLSHRT
EXEC PARM option 56
OPTION control statement
option 215
NOVSAMIO
EXEC PARM option 57
NOWRKREL
EXEC PARM option 58
OPTION control statement
option 217
NOWRKSEC
EXEC PARM option 58
OPTION control statement
option 218
NULLOFL installation option 21
NULLOFL parameter
OUTFIL control statements
option 337
NULLOUT
EXEC PARM option 47
OPTION control statement
option 199
NULLOUT installation option 21
numeric tests 120
numerice editing and formatting
DISPLAY operator 601
NVSAMEMT
EXEC PARM option 57
NZDPRINT
EXEC PARM option 59
OPTION control statement
option 219
O
occurrences
OCCUR operator (ICETOOL) 647
SELECT operator (ICETOOL) 668
ODMAXBF
EXEC PARM option 48
installation option 21
OPTION control statement
option 200
OUTFIL control statements
option 374
OL (leading overpunch sign) format
description 894
where allowed 897
OMIT control statement
efficiency 805
example 171, 172
function 82
using 172
OMIT parameter
OUTFIL control statements
option 227, 234
OMIT Statement Example 171, 172
omitting records 1, 169
user-defined data types 767
opening and initializing data sets 492,
774
opening data sets
E11 user exit 499
E31 user exit 510
EFS 770
user exit routines 492
operand field 84
operation field 84
OPTION control statement
examples 220, 223
function 81
special handling 781
using 173, 223
OPTION Statement Examples 220, 223
OT (trailing overpunch sign) format
where allowed 897
OUTFIL
DD statement 73
digits needed for numeric fields 274
edit field formats and lengths 269
edit mask output field lengths 274
edit mask patterns 271
edit mask signs 273
efficiency 805
lookup and change 228, 296, 383
parsed input 296
producing reports 228, 256
storage limits 194, 374, 807
table lookup and change 296, 383
OUTFIL control statement
function 82
OUTFIL control statements
examples 377, 385, 386
function 82
using 223, 385, 386
outfil DD statement
defined 28
function 66
OUTFIL statements examples 377, 385,
386
OUTFIL statements notes 374
P
PAD
EXEC PARM option 49
installation option 22
OPTION control statement
option 201
padding
GNPAD 816
INCLUDE/OMIT 107
records 14, 107
truncating 107
PAGEHEAD parameter
OUTFIL control statements 363
PAIR=APOST parameter
of PARSE operand
on OUTFIL statement 250
PAIR=QUOTE parameter
of PARSE operand
on OUTFIL statement 250
parameter list
control statements 543, 550, 554
description 865
format 544, 551
PARM options
alias PARM options 60
PARMDDN installation option 22
PARSE parameter
INREC statement 127
OUTFIL statement 228, 236
OUTREC statement 404
parsing records 1
passing control to user exits 166
passing records
E15 user exit 499, 523
past date
character string for 106
decimal number constant for 104
PD (packed decimal) format
description 891
where allowed 897
PD0 (part of packed decimal) format
description 892
where allowed 897
performance
application design 800
dataspace sorting 812
efficient blocking 800
Hipersorting 811
HIPRMAX 811
ICEGENER 813
improving elapsed time with
devices 802
JCL 799
main storage 807
maximizing 799
merging techniques 801
ODMAXBF effects 374
options that degrade 806
options that enhance 802
sorting techniques 800
specifying data sets 801
temporary work space 810
using BLDINDEX support 817
using DFSORT's Performance Booster
for The SAS System 817
Pipe
Sort example 835
PROC symbol
using 29
processing and invoking programs 909
processing of error abends with A-type
messages 909
processing order, record 7
processing user-defined data types with
EFS program user exit routines 776
program control statements
64-bit parameter list 554
extended parameter list 550, 553
program DD statements 65
Program DD statements 78
program invocation, defined 5
program phase
defined 488
Index
925
Q
QSAM
data set 12
data set considerations
E18 user exit 504
E19 user exit 507
15
R
RANGE operator (ICETOOL) 662
rearranging records
See sorting records 442
Recommendation
comparing padded bytes to excess
bytes in the binary field 116
record
blocking 800
changing with user exit routines 512
copying 163
data types 13
deleting 96, 169
with OMIT control statement 169
descriptor word (RDW) 16
EFS constraints 14
estimated number to be sorted 42
exact number to be sorted 41
formatting 125
inserting, deleting, and altering 492
maximum length 14
merging 162
minimum length 14
modifying with user exit 492
number to be sorted 42
padding 107, 816
passing with user exit routines 499
processing for OUTFIL 227
processing order 7, 124, 148, 149, 424
EFS 793
reformatting 402
sorting 442
storage constraints 14
summing 2, 451
E35 user exit 516
with user exits 492
truncating 107, 816
user-defined data types 767
variable-length
efficiency 801
RECORD control statement
coding notes 441
examples 441
function 83
using 438
record processing order 793
record type
specifying 438
records
duplicate 451, 647, 668
unique
OCCUR operator (ICETOOL) 647
926
records (continued)
unique (continued)
SELECT operator (ICETOOL) 668
UNIQUE operator
(ICETOOL) 718
recovering from unexpected abends
unexpected abends 908
REFORMAT control statement
using 442
reformatting records
after processing
examples 426
before processing
examples 150
with INREC statement
BUILD 125
FIELDS 125
IFTHEN 125
OVERLAY 125
with OUTFIL statement
BUILD 252
IFTHEN 252
OUTREC 252
OVERLAY 252
with OUTREC statement
BUILD 402
FIELDS 402
IFTHEN 402
OVERLAY 402
REGION
allocating storage 807
determining storage 807
releasing main storage 809
size 807
Related reading
additional functions with ICETOOL
SELECT not available with
XSUM 454
relational condition
comparison operator 99, 118
constants
character string format 104
date string format 118
decimal number format 102
hexadecimal string format 107
defined 99
description 99
format 99, 107, 117
relational condition format 121
releasing main storage 809
remark field 85
REMOVECC parameter
OUTFIL control statements
option 370
RENT 496
reordering control fields
See reformatting records 125, 402
REPEAT parameter
OUTFIL control statements
option 334
REPEAT=v parameter
of PARSE operand
on OUTFIL statement 251
report
ANSI carriage control character 229,
256, 331, 345, 351, 354, 359, 361, 365,
370, 375
report (continued)
header, OUTFIL 339
ICETOOL DISPLAY 595, 636
ICETOOL OCCUR 647, 661
OUTFIL elements 3, 226
producing for OUTFIL 228, 256
trailer, OUTFIL 345
requesting a SNAP dump 795
requirements
input data set 12
JCL 27
output data set 12
RESALL
EXEC PARM option 50
installation option 22
OPTION control statement
option 202
RESERVEX 35
RESET
installation option 22
OPTION control statement
option 202
residence mode
EFS program 768
EFS program user exit routine 792
user exits 494
RESINV 809
installation option 22
OPTION control statement
option 203
RESIZE operator (ICETOOL) 664
restarting after an abend 907
Restriction
invoking DFSORT using ICEMAN 4
using OUTREC instead of INREC
could cause overflow 151
Restrictions
ICETOOL limitations 563
restrictions for dynamic invocation 561,
562
Return Code
DFSORT 25
return codes
EFS 793
Return Codes
ICEGENER 816
ICETOOL 728
REXX examples 820
RMODE 498
rules for parsing 781
running DFSORT with JCL 61, 78
S
sample job streams 819
sample jobs listing installation
defaults 17
SAMPLE parameter
OUTFIL control statements
option 232
sample routines written in
Assembler 518, 520
sample routines written in COBOL 535,
536
SAS
DFSORT's Performance Booster for
The SAS System 817
SAVE parameter
OUTFIL control statements
option 227, 234
screen readers
accessibility 915
SDB
EXEC PARM option 51
installation option 22
OPTION control statement
option 204
SDB (system-determined block size)
installation option 74
SDBMSG installation option 22
SECTIONS parameter
OUTFIL control statements
option 228, 359
SELECT operator (ICETOOL) 668
sending comments to IBM xix
separation field 130, 407
sequence numbers
INREC 140
OUTFIL OUTREC 308
OUTREC 416
SET symbol
using 29
SFF (signed free form) format
description 893
where allowed 897
shared tape units 63
shortcut keys 911, 913
SIZE
allocating storage 807
EXEC PARM option 52
installation option 22
MERGE control statement option 164
OPTION control statement
option 186, 206
releasing main storage 809
SORT control statement option 448
SKIP parameter
OUTFIL control statements 360
SKIPREC
efficiency 805
EXEC PARM option 53
MERGE control statement option 164
OPTION control statement
option 206
SORT control statement option 449
sliding century window 218
SmartBatch pipe
and ICETOOL 727
SmartBatch pipes
OUTFIL example 384
SMF
installation option 22
OPTION control statement
option 206
SMF date (DTn) and time (TMn) formats
descriptions 600, 621, 651, 896
where allowed 897
SNAP dump 795
SOLRF
EXEC PARM option 53
installation option 22
OPTION control statement
option 207
SORT cataloged procedure 30, 31, 65
SORTOUT
OPTION control statement
option 209
OUTFIL ddname 226
SORTOUT DD statement
defined 28
function 66
using 73, 75
SORTSNAP DD statement
defined 28
function 66
using 78
SORTWKdd DD statement
defined 28
duplicate 63
function 66
using 71
SORTWKdd DD Statement
dataspace sorting 71
SPANINC
EXEC PARM option 53
installation option 23
option control statement 209
special handling of OPTION and DEBUG
control statements 781
specification/override of DFSORT
options 863, 890
specifying efficient sort/merge
techniques 800
specifying input/output data set
characteristics accurately 801
SPLICE operator (ICETOOL) 681
SPLIT parameter
OUTFIL control statements
option 335
SPLIT1R parameter
OUTFIL control statements
option 337
SPLITBY parameter
OUTFIL control statements
option 336, 338
SS 111
STARTAFT=an parameter
of PARSE operand
on OUTFIL statement 244
STARTAFT=BLANKS parameter
of PARSE operand
on OUTFIL statement 244
STARTAFT=string parameter
of PARSE operand
on OUTFIL statement 243
STARTAT=an parameter
of PARSE operand
on OUTFIL statement 245
STARTAT=BLANKS parameter
of PARSE operand
on OUTFIL statement 246
STARTAT=NONBLANK parameter
of PARSE operand
on OUTFIL statement 246
STARTAT=string parameter
of PARSE operand
on OUTFIL statement 245
STARTREC parameter
OUTFIL control statements
option 227, 232
STATS operator (ICETOOL) 708
Index
927
STEPLIB DD statement
defined 27
using 64
STOPAFT
efficiency 805
EXEC PARM option 54
MERGE control statement option 164
OPTION control statement
option 210
SORT control statement option 449
storage
efficient 801, 860
exceeding capacity 860, 861
intermediate 810
limits, OUTFIL 374
main
releasing 809
tuning 807
specifying for user exit routine 166
temporary 810
tracks versus cylinders 801, 859
user exit routine 493, 522
storage administrator examples 819
storage usage
records at E35 user exit 516
SUBPOS=y parameter
of PARSE operand
on OUTFIL statement 243
SUBSET operator (ICETOOL) 710
substring comparison operator 111
substring comparison tests 112
relational condition format 111
subtracting fields and constants
INREC 136
OUTFIL 282
OUTREC 412
SUM control statement 455
description 451
efficiency 805
examples 454, 455
function 83
summary field 451
using 455
SUM statement examples 454, 455
SUM statement notes 453
summarizing records 451
summary field
formats 451
table of formats and lengths 452
Summary Field Formats and Lengths
Table 452
summing
records 451, 492
records at E35 user exit 516
summing records adding record
values 2
supplying messages for printing to the
message data set 776
SVC installation option 23
symbols
using 4
Symbols
Comment and Blank Statement 734
example 732
for fields and constants 731
in DFSORT Statements 747
928
Symbols (continued)
in ICETOOL Operators
DISPLAY 757
ICETOOL Example 758
OCCUR 758
RANGE 757, 758
SELECT 758
SPLICE 758
STATS, UNIQUE and
VERIFY 758
in ICETOOL statements 757
INCLUDE and OMIT 749
INREC and OUTREC 750
Keyword Statements 744
Notes 765
OUTFIL 752
overview 731
SORT and MERGE 748
SUM 749
Symbol Statements 734
SYMNAMES DD Statement 733
SYMNAMES Statements 734
SYMNOUT DD Statement 734
using SET and PROC 760
SYMNAMES DD statement
defined 27
function 66
SYMNOUT DD statement
defined 28
function 66
SYNAD 504, 508
syntax diagrams
option control statement 173
SYSABEND DD statement
defined 28
using 65
SYSIN data set 865
SYSIN DD statement
defined 28
using 64
SYSLIN DD statement
defined 29
using 65
SYSLMOD DD statement
defined 29
using 65
SYSMDUMP DD statement
defined 28
using 65
SYSOUT DD statement
defined 27
using 64
SYSPRINT DD statement
defined 28
using 65
system DD statements 63, 65
system macro instructions
defined 541
using 541, 553
writing 559, 560
system-determined block size (SDB) 74
SYSUDUMP DD statement
defined 28
using 65
SYSUT1 DD statement
defined 28
using 65
SZERO
EXEC PARM option 54
installation option 23
OPTION control statement
option 210
T
tape
capacity considerations 860, 862
efficiency 806, 811, 860
insufficient intermediate storage 861
work space capacity 861
work storage devices 811
TCn (TOD time) format
description 897
where allowed 897
TEn (ETOD time) format
description 897
where allowed 897
terminating DFSORT
E35 user exit 529
with an EFS program 776
with user exits 493
TEXIT installation option 23
time constant 133, 260, 409
time formats
descriptions 896, 897
where allowed 897
TMAXLIM
allocating storage 807
installation option 23
releasing main storage 809
TMn (SMF time) format
description 896
where allowed 897
TOD date (DCn) and time (TCn) formats
descriptions 896, 897
where allowed 897
tracks 801, 859
TRAILER1 parameter
OUTFIL control statements
option 228, 343, 351
TRAILER2 parameter
OUTFIL control statements
option 228, 359
TRAILER3 parameter
OUTFIL control statements
option 363
Translate characters
ALTSEQ 88, 135
lowercase to uppercase 125, 265
uppercase to lowercase 125
TRUNC
EXEC PARM option 55
installation option 23
OPTION control statement
option 211
truncating
GNTRUNC 816
INCLUDE/OMIT 107
records 14
truncating records 107
TS (trailing sign) format
description 894
where allowed 897
TUNE
installation option 23
tuning main storage 807
two-digit year
conversion 218, 385
sorting 451
transforming dates 3, 226
TYPE
RECORD control statement
option 438
U
UFF (unsigned free form) format
description 893
where allowed 897
UNIQUE operator (ICETOOL) 718
unique records
OCCUR operator (ICETOOL) 647
SELECT operator (ICETOOL) 668
UNIQUE operator (ICETOOL) 718
user exit
activating 487
addressing and residence mode 494
assembler routines
input phase 498
output phase 510
COBOL routines
input phase 523
output phase 529
overview 521
conventions for routines 495
DFSORT performance 495
E11 499
E15 499, 523
E16 503
E17 503
E18 504
E19 507
E31 510
E32 510
E35 512, 529
E37 517
E38 517
E39 517
E61 508
efficiency 806
functions 490
language requirements 487
link-editing 498
linkage conventions 496
loading routines 496
overview 487
passing control with MODS control
statement 166
summary of rules 495, 498
using RECORD control
statement 438
using routines 487, 517
using your own routines 518, 537
user exit linkage conventions 496
user interface
ISPF 911, 913
TSO/E 911, 913
USEWKDD
OPTION control statement
option 212
V
variable position/length fields 1
extracting into parsed fields
INREC control statement 128
OUTFIL control statement 236
OUTREC control statement 405
variable-length record
longest record length 16
record descriptor word 16
VERIFY
efficiency 806
EXEC PARM option 55
installation option 23
OPTION control statement
option 212
VERIFY operator (ICETOOL) 720
VIO
ICEMAC installation option 78
installation option 23
VLFILL parameter
OUTFIL control statements
option 330
VLLONG
EXEC PARM option 56
installation option 23
OPTION control statement
option 213
VLSCMP
EXEC PARM option 56
installation option 23
OPTION control statement
option 213
VLSHRT
EXEC PARM option 56
installation option 23
OPTION control statement
option 215
VLTRAIL parameter
OUTFIL control statements
option 332
VLTRIM parameter
OUTFIL control statements
option 331
VSAM
data set 12
data set considerations 16
E18 user exit 505
E38 user exit 517
E39 user exit 517
key-sequenced data set (KSDS) 16
maximum record size
with INREC control
statement 149, 424
user exit functions 493
using RECORD control
statement 438
VSAMBSP installation option 23
VSAMEMT
EXEC PARM option 57
installation option 23
OPTION control statement
option 216
VSAMIO
EXEC PARM option 57
installation option 23
OPTION control statement
option 217
VTOF parameter
OUTFIL control statements
option 309
W
Web 4
web site 4
work space
requirements for DFSORT 853
using 853, 862
WRKREL
EXEC PARM option 58
installation option 23
OPTION control statement
option 217
WRKSEC
EXEC PARM option 58
installation option 24
OPTION control statement
option 218
X
XCTL
using 541
writing macro instructions
559
Y
Y2 formats
description 895
where allowed 897
Y2PAST
EXEC PARM option 59
installation option 24
MERGE control statement option 165
OPTION control statement
option 218
SORT control statement option 449
Year 2000
century window 218
comparing dates 119
ordering dates 446
Z
z/OS file systems 16
ZD (zoned decimal) format
description 891
where allowed 897
ZDPRINT
EXEC PARM option 59
installation option 24
Index
929
ZDPRINT (continued)
OPTION control statement
option 219
930
Printed in USA
SC23-6878-01