Академический Документы
Профессиональный Документы
Культура Документы
Reformatting Features
of its item one by one. y We can delete, rearrange and insert fields and constants. y An example of reformatting with OUTFIL and BUILD: OUTFIL FNAMES=OUT1,
BUILD=(21,20,5,3,PD,ADD,+20,TO=PD,LENGTH=3, 6C*',40:X)
COND .
y Using OVERLAY, we can reformat each record by
specifying just the items that overlay specific columns. y With this we can change specific existing columns without affecting the entire record. y An example of reformatting with OUTREC and OVERLAY: OUTREC OVERLAY=(45:45,8,TRAN=LTOU)
COND
y Using IFTHEN clauses, we can reformat different records in different ways by specifying how BUILD or OVERLAY items are applied to records that meet given criteria. y In IFTHEN clauses we can use conditional logic to choose different record types.
y INREC IFTHEN=(WHEN=INIT,OVERLAY=(73:SEQNUM,8,ZD)),
In output positions 1-2, the characters from input positions 5-6. In output positions 3-7, five asterisks. In output positions 8-13, the characters from input positions 18-23. In output positions 14-16, the characters ABC. In output positions 17-20, the decimal number +30 converted to a 4-byte binary value (X'0000001E'). In output position 21, the hexadecimal value 01. Blanks in output positions 22-80.
Timestamps
y An example of timestamps: y INREC IFTHEN=(WHEN=(5,1,CH,EQ,C'A'),
'03/28/2005') if position 5 has 'A', or in the form 'dd-mm-yyyy' (e.g. '28-032005') if position 5 has 'B'. A blank in position 13. In output positions 14-21, the current time in the form 'hh:mm:ss' (e.g. '11:05:31') if position 5 has 'A', or in the form 'hh.mm.ss' (e.g. '11.05.31') if position 5 has 'B'. A blank in position 22. In output positions 23-42, the characters from input positions 1-20.
Hexadecimal Display
y An example of Hexadecimal display:
OUTFIL BUILD=(1,16,HEX,C**',17,16,HEX)
y The output records for the SORTOUT data set will contain the following: In output positions 1-16, the hexadecimal representation of input positions 1-16. Two asterisks in output positions 17-18. In output positions 19-34, the hexadecimal representation of input positions 17-32.
input position 5.
Translation
y Lowercase to uppercase translation:
INREC OVERLAY=(21:21,11,TRAN=LTOU,48:48,8, TRAN=LTOU)
Writing Constants
y Character Strings The format for writing a character string is: C x...x where x is an EBCDIC character. For example, C'FERN'. y Hexadecimal Strings The format for writing a hexadecimal string is: X'yy...yy' where yy is a pair of hexadecimal digits. For ex: X'7FB0'. y Decimal Numbers The format for writing a decimal number is: n...n or n...n where n is a decimal digit. Examples are 24, +24, and -24.
Substring Search
y Substring Search for INCLUDE and OMIT:
write the character constant so it includes all of the strings you want to search for. If the value in the field matches any of the strings (for example, BUSIN ), the record is included. If the value in the field does not match any of the strings, the record is omitted.
bytes with binary zeros, thus allowing the short fields to be validly compared (the zeros are not kept for the output records). In the example above, records less than 28 bytes are not included because the binary zeros added for the missing bytes in the field prevent it from being equal to 'Type 200'. y Another way you can prevent DFSORT from terminating for VB records with short compare fields, if appropriate, is by specifying the VLSHRT option. For example: OPTION COPY,VLSHRT INCLUDE COND=(21,8,CH,EQ,C Type 200 ) VLSHRT tells DFSORT to leave records with short summary fields unsummed. That is, when one of the two records involved in a summary operation has a short summary field, the records are kept unchanged; neither record is deleted. In the example above, any records less than 28 bytes are not included.
Numeric Editing
y You can use the following OUTREC statement to make
the PD values meaningful: y OUTREC FIELDS=(1,8, 5X, 11,6,PD,M4, 5X, 31,7,PD,EDIT=(SI,III,III,IIT.TTT),SIGNS=(,-), 5X, 41,5,PD,EDIT=(TT-TT-TTTT))
COND
y M4 is one of DFSORT s 27 pre-defined edit masks. It
edits a numeric field according to the pattern SI,III,III,III,IIT.TT. EDIT=(SI,III,III,IIT.TTT) is a userdefined edit mask. It edits a numeric field according to the pattern SI,III,III,IIT.TTT. EDIT=(TT-TT-TTTT) is another user-defined edit mask. It edits a numeric field according to the pattern TT-TT-TTTT.
COND
y In the patterns: y I indicates a leading insignificant digit to be displayed as 1-9, or as blank for a leading 0. y T indicates a significant digit to be displayed as 0-9. y S before the digits indicates a leading sign. S after the digits indicates a trailing sign. For M4, the leading sign is to be displayed as + for a positive value or as for a negative value. For EDIT=(SI,III,III,IIT.TTT),SIGNS=(, ), the leading sign is to be displayed as blank for a positive value or as for a negative value. y Any other character (for example, comma, decimal point or hyphen) is just displayed as appropriate. The results produced for the OUTREC statement are:
Numeric Conversion
y An example of numeric conversion:
OUTREC BUILD=(21,5,ZD,TO=PDF,8,4,ZD,TO=FI,LENGTH=2)
input record is converted to a packed decimal value in positions 1-3 of the output record (with an F for a positive sign or a D for a negative sign). The zoned decimal value in positions 8-11 of the input record is converted to a fixed-point value in positions 4-5 of the output record. .
Sequence Numbers
y INREC, OUTREC and OUTFIL let us generate BI, PD, ZD or FS
sequence numbers in the output records. y Starting values and increment values can be specified or defaulted.
An example of sequence numbers assigned before sorting with INREC: INREC OVERLAY=(73:SEQNUM,8,ZD,START=1000,INCR=1000) SORT FIELDS=(25,5,CH,A) An example of sequence numbers assigned after sorting with OUTREC: SORT FIELDS=(25,5,CH,A) OUTREC OVERLAY=(73:SEQNUM,8,ZD,START=1000,INCR=100)
y We can also restart the sequence numbers at the START value each
time the value in a specified field changes. An example with OUTFIL: OUTFIL OVERLAY=(81:SEQNUM,5,ZD,RESTART=(5,3))
Justifying(JFY)
y Left-Justify:
OPTION COPY OUTREC FIELDS=(1,30,JFY=(SHIFT=LEFT))
y Right-Justify:
OPTION COPY OUTREC FIELDS=(1,30,JFY=(SHIFT=RIGHT))
Squeezing(SQZ)
y Left Squeeze: y 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. OPTION COPY
OUTREC FIELDS=(1,40,SQZ=(SHIFT=LEFT))
OPTION COPY
Squeezing(SQZ)
y Right Squeeze: y 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. OPTION COPY
OUTREC FIELDS=(1,40,SQZ=(SHIFT=RIGHT))
OPTION COPY
non-numerics (field,NE,NUM) in character (FS), zoned decimal (ZD) or packed decimal (PD) format. y Examples:
INCLUDE COND=(18,4,FS,NE,NUM) INCLUDE COND=(22,6,PD,EQ,NUM, AND,28,6,PD,EQ,NUM)
output data sets, SPLIT1R=n only rotates once among the output data sets, resulting in contiguous records in each output data set. y Examples: OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLIT OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=5 OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLIT1R=5
Col2,25 Col3,45 End_rec,80 First,28,10 Last,7,15 Amount,45,4,FS y /* y //SYSIN DD OPTION COPY OUTFIL REMOVECC, HEADER2=(Col1:'First',Col2:'Last',Col3:'Amount',/, Col1:10'-',Col2:15'-',Col3:6'-'), BUILD=(Col1:First,Col2:Last, Col3:Amount,EDIT=(IIT.TT),End_rec:X), TRAILER2=(Col1:5'=',Col3:6'=',/, Col1:'Total',Col3:TOT=(Amount,EDIT=(IIT.TT)))
y /*
IEBGENER. y ICEGENER as a direct replacement for IEBGENER, so ICEGENER is then called automatically whenever IEBGENER is requested either directly or from a program. y ICEGENER uses DFSORT to process IEBGENER jobs when possible and transfers control to IEBGENER when DFSORT can't be used. y DFSORT will issue information such as the number of records copied and the RECFM, LRECL, and BLKSIZE.
Multiple Output (OUTFIL): Slash Elapsed Time, EXCPs and CPU Time
y With OUTFIL, sort, merge and copy applications can
create multiple output data sets containing unedited or edited records, different ranges, subsets or samples of records, reports, and so on, from a single pass over one or more input data sets. y We can see range of Performance improvements with DFSORT using a single sort step with OUTFIL vs DFSORT using a sort step followed by multiple copy steps
ICETOOL
INTRODUCTION
y ICETOOL, a versatile data set processing and reporting utility, provides an easy-to-use batch front-end for DFSORT. ICETOOL combines new features with previously available DFSORT features to perform complex sorting, copying, reporting and analytical tasks using multiple data sets in a single job step. y The thirteen ICETOOL operators are: COPY, COUNT, DEFAULTS, DISPLAY, MODE, OCCUR, RANGE, SELECT, SORT, SPLICE, STATS, UNIQUE, and VERIFY. By using combinations of these thirteen operators, we can easily create applications that perform many complex tasks. By supplying these operators in a parameter list, we can use the information returned by ICETOOL in your program.
conditions.
errors. Can also be set if the record count meets a specified criteria (for example, a data set is empty, or a data set contains more
errors. 20 - Message data set error. The TOOLMSG DD statement was not present or the TOOLMSG data set was not opened. 24 - Unsupported operating system. The operating system was not z/OS or OS/390.