Home
Sort User`s Guide and Reference
Contents
1. i a2 Page Program 1 of Statement R s A RJO ted Output Type e Maximum e 1 eju of T s Control q tC sit Le sf y SORTR e Field u o elp 3 Number p SORTRS r Length e Reserved sl rju Reserved Comments oo e SORTA v n e vit hk e 1 256 c q e of d e d TS sf H A Lid D F X E 3 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 1 of H S O R T R 2 1 A S O R T I N P U T L 4 AE i F I E L D s ME fof Ls of Statement F D Field Location Forced Overflow 7 i fa Charac Field 7 T Je t T ters Length fof yfl fay od p d p R s c AE e e e u jo 7 Number Start End c b n JA Reserved Comments of C K ols t jl bot ZL rt Ji ts te oh D E d i n e ae D P I t ju q L 4 N V J u fa 1 0 U R tit te of F IMS e i ANE F S H T o of x B n JA 7 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 72 7 F N C 2 0 2 0 S I N G L E C H A R PII E L D s SO i a I t 7 LO of
2. Chapter 2 Sorting Records from a Single File 33 Because of the sequence number the control field specification ITEM field follows this data field specification As a result the control field is positioned in columns 2 through 7 after the one character data field in the output record You then process the source file by using the FMTDTA command as in Example 3 Reformatting Records 1 on page 30 34 Sort User s Guide and Reference Chapter 3 Sorting Records from Several Files The Sort utility can sort records selected from multiple physical logical or device files and produce a copy of the records that reflects the new order See Figure 9 It can also rearrange the fields within each record Sort utility specifications from source file Input records from up to eight files The FMTDTA _ Database files or Device Command logical or physical files Output records sorted and possibly reformatted into a physical file Figure 9 Sorting and Reformatting Several Files into One Up to eight input files can be specified The utility processes the files in the order in which they are entered in the FMTDTA command The output is a physical file in the database meaning that it contains a sorted and reformatted copy of the actual input records Wh
3. From To Explanation 1 10 Traditional Chinese field with SO and SI person s name 11 30 Traditional Chinese field with SO and SI department name 31 64 Other information HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification Statement R s A RO aa Output Type e Maximum e 1 eju L1 T s Control q tC s t L1 y SORTR e Field u o elp Ed Number p SORTRS r Length e Reserved S1 rju Reserved Comments Hea e SORTA v n e vit Ai e 1 256 c qle 1 d e d Pool H A s D F X 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 43 44 45 46 47 48 49 50 51 SESS B35 fla 0 O 1 H S OJ R T R 8 X N 0 C O N T R Of L PREE ER e Columns Entry Explanation 6 H Identifies that this is a header specification 7 12 SORTR This is a regular sort the output is a physical file 17 8 The maximum control field length is 8 characters 28 X The control field does not appear in the output record 40 72 Comments Identifies that the control field is dropped 140 Sort User s Guide and Reference RECORD SPECIFICATIONS Statement C D Factor 1 Com F _ _ Factor 2 C
4. These two specifications establish the two elements of the control field The con tents of the first specification are Columns Entry Explanation 7 N This element is to be treated as normal This means that the unchanged data from the input record is to be used and that the sort sequence for this element or part of the control field is that specified in the header specification ascending 8 C The system looks at the data in this field as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit 9 12 1 This element of the control field is to begin in column 1 of the input record 13 16 2 The element is to end in column 2 of the input record This selects the data from the TYPENO field corresponding to the original data definition for the input records 40 72 Comments Identifies the name of the field selected The second field specification defines the second element of the control field called ITEMNO in the input record Sort regards both elements as a single string of control characters and begins the sort with the character farthest to the left 20 Sort User s Guide and Reference FIELD SPECIFICATIONS
5. 1 f R s RIO f Output Type e e elu Piet T s Control q tC sit ET y SORTR e Field u o elp L 4 Number p SORTRS r Length e Reserved Sl rju Reserved Comments 7 e SORTA v n e vit of e 1 256 c qle f d e d l H A s i D F X 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 43 44 45 46 47 48 49 50 51 52 53 54 fel 172 H S O R T R 0 0 8 A oi J of Columns Eniry Explanation 7 12 SORTR This is a regular sort the output is to be a physical file 15 17 8 The maximum control field length is 8 characters 18 A The output records are to be sorted in ascending order A before B 1 before 2 and so on For the ordering of numbers relative to upper and lowercase charac ters and special characters refer to the collating sequences in Appendix C Standard and Alternative Collating Sequences 26 No entry The Sort utility defaults to the standard collating sequence 28 No entry The default is to include the control field in the output record 18 Sort User s Guide and Reference RECORD SPECIFICATIONS 1 i Statement C D Factor 1 Com F Factor 2 Constant 7 o ja pari la 12 ds T In t son c
6. SN SN NNN aG m G wa NN NNN NNN Header Specifications The following coding considerations must be noted to successfully run your program For further details regarding coding your header specifications see Chapter 8 The Header Specification e Columns 15 through 17 Maximum Control Field Length Shift in SI and shift out SO control characters are present in all records and do not need to be included as part of a DBCS control field The maximum control field length must not exceed 256 bytes The control field is the number of bytes not the number of characters Note When you convert a one byte EBCDIC Katakana field to the Japanese Sei On Katakana control field you must calculate the value in columns 15 through 17 To do this divide the EBCDIC Katakana field length by 4 and round the quotient if there is one up to the nearest whole number Multiply this value by 2 and add the result to the original Katakana field length The maximum control field length is 256 bytes Column 26 Alternative Collating Sequence An S or F entry in this column can produce undesirable results because the double byte alternative collating sequence is not supported Column 28 Include or Exclude Control Field in Output When DBCS control fields are used they are changed in building the work record therefore
7. hoof ITEM NUMBER ITEM DESCRIPTION ITEM TYPE ITEM CLASS WAREHOUSE STOCK LOCATION ho od 20011230 Dbl pedestal desk lock A 20 Frankfurt 30010010 Table desk no center drawer B 30 Rome J 10012000 Swivel chair with arms C 10 Toronto 70015120 5 drawer file with lock D 70 New York 50011230 Storage cabinet with doors E 50 Stockholm 1 40016210 Substitute drawer F 40 Montreal 60013000 Overhead desk unit 2 shelves G 60 Los Angeles 80012010 Chair armless H 80 Madrid of The records in the input file have the following format of RECORD ITEM ITEM ITEM ITEM WAREHOUSE 1 CODE NUMBER DESCRIPTION TYPE CLASS STOCK LOCATION 1 of 1 2 9 10 39 40 41 42 43 47 48 128 Chapter 4 Sorting Records from a Single File to Produce a Record Address File 43 Entering the Specifications To sort this file enter the following header record and field specifications Only those columns that are important to this example are described HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification EF Statement R s A RO t Output Type e Maximum e 1 eju F T s Control q teisit Lod y SORTR e Field u o elp E t Number
8. Appendix D Sorting Double Byte Character Sets 131 Columns Entry Explanation 6 I Specifies that the records described in this specification are to be included in the sort 8 c Identifies the data for Factor 1 and Factor 2 as character data The system will look at both the zone and the digit portions of each byte when comparing Factor 1 with Factor 2 9 12 12 Factor 1 field begins in column 12 of the input record 13 16 15 Factor 1 field ends in column 15 of the input record 17 18 EQ The data in the Factor 1 field must equal the data in the Factor 2 constant for the input record to be selected for sorting 19 S The data in the Factor 2 field is constant and is shifted one column to the left before comparison 20 0 Represents the shift out character 21 24 KKKK The two byte characters to be compared 25 I Represents the shift in character 40 72 Comments Identifies that two double byte characters are being compared FIELD SPECIFICATIONS Ef Statement F D Field Location Forced Overflow AE i i ja Charac Field T Je t T ters Length f y jl jay d pid p R s jc 4 Number 3 j Start End a b H A Reserved Comments j f C K ols t jl EY i ZL r t fi ts 7 D E d i n e Lod D P I t u q Loot N V ujaj Bod
9. EI I ELLOS MR E E EEE E EE Sel a This field specification states that all the input data fields are to be included in the output records The data is character data Processing the Specifications Below is an example of FMTDTA command that could be used to run this Sort job Specified on FMTDTA Command Explanation FMTDTA INFILE PROD DISKET1 MONDAY Specifies input file in library PROD OUTFILE PROD TRANSM The output file is TRANSM in library PROD Since a member name is not specified the output records are stored in the first member in the file SRCFILE TEST EXAMPLE The reformat specifications are taken from SRCMBR EXAMPLE4 member EXAMPLE4 in data file EXAMPLE which is in library TEST The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMATDTA command is entered from a display station 70 Sort User s Guide and Reference Example 2 Copying Merging Several Files to Produce a Reformatted Output File This example copies the same records from the same files as Example 1 Copying a File with No Reformatting on page 68 The fields in the output record however are to be rearranged Entering the Specifications The header and record specifications are the same as for Example 1 Copying a File with No Reformatting on page 68 The field specifications are as follows only the co
10. Statement F D Field Location Forced Overflow i y ila Charac Field E T Je t T ters Length y fl jay ERS oe S L 4 pjd p R s c 7 e e e ju fo 1 Mae i Number Start End c b n JA Reserved Comments Taes i CK o fs t jl i AR r t i ts best D E d fi n e are D P I t lu q TAR N V J u a 0 U R tjt Lent F M S e i rA i F S H T o 7 3 4 5 re e n 9 10 11 12 13 14 15 16 17 18 19 oe 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 a la Fi DI Cc 3 0 3 4 A c O S T Fy I E L D i f F D C 2 8 2 9 Uf N I T F I Ef L D i f F D C 4 6 5 0 Q T Y F I E L D i f F D C 8 6 9 1 D A T E Fy I ENE D f F D C 9 5 1 0 0 O R D E R N 0 FUEILL D jie S These five specifications define five data fields to be taken from each input record The contents of the first specification are Columns Entry Explanation 7 D The field is to be treated as a data field meaning that the unchanged data from the input record is to be transferred to the output record 8 C The system looks at the data in this field as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit 9 12 30 This data field begins in column 30 of the input record 13 16 34 This control field ends in column 34 of the input record This selects the data from the COST field corresp
11. 2 Interpreting Numeric Data 0 000 000 02 eee Interpreting the Sign ofa Number 000 4 Columns 9 through 12 Factor 1 Start Position Columns 13 through 16 Factor 1 End Position Columns 17 and 18 Comparison Operator Column 19 Type of Data Contained in Factor2 Columns 20 through 23 Factor 2 Start Position Columns 24 through 27 Factor 2 End Position Columns 20 through 39 Factor 2 Is a Constant Alphanumeric Constants Column 8 Entry is C Z or D Numeric Constants Column 8 Entry is P or U Columns 20 through 39 Factor 2 ls a Keyword Columns 40 through 72 Comments 2 00 5 Chapter 10 Field Specifications Order of Fields in the Output Record Order of Field Specifications in the Source File Summary of Column Entries 02002002000 Detailed Description of Each Column Entry Columns 1 and 2 Page and Columns 3 through 5 Statement Number Column 6 Specification Identifier 0 4 Column 7 Field Type 202000000500 Data Field Din Column 7 20 200 2004 Normal and Opposite Control Fields N or O in Column 7 Forced Control Fields F in Column 7
12. 0 000200 eee ee 128 Sorting Considerations for Japanese Double Byte Character Sets 129 Japanese Telephone Book Sorting Example 131 Japanese Word Dictionary Sorting Example 133 Kanji Character Dictionary Type Sorting Example 133 Sort User s Guide and Reference Sorting Considerations for Simplified Chinese Double Byte Character Sets 135 Simplified Chinese Strokes Radical Sorting Example 136 Sorting Considerations for Traditional Chinese Double Byte Character Sets 139 Traditional Chinese Strokes Radical Sorting Example 140 Sorting Considerations for Korean Double Byte Character Sets 142 Korean Pronunciation Sort Example 4 143 Bibliography wcos oop eae eo ee bee EERE ee ee ee hee es 147 Glossary gt g oe fond 2 AME Se ern RE Bo be oe BS end Y 149 HAER ne cs eee Midas a es ae a ad eo Re Bek he 153 Contents Vii viii Sort User s Guide and Reference Notices Any reference to an IBM licensed program or other IBM product in this publication is not intended to state or imply that only IBM s program or other product may be used Any functionally equivalent product program or service that does not infringe on any of IBM s intellectual property rights may be used instead of the IBM product program or service Evaluation and verification of operation in conjunction with other products except those expressly desi
13. 113 System 36 Sort Utility Level Support 113 Running a Sort Job in System 36 Sort Utility 114 Appendix B Information for System 38 Conversion Reformat Utility Users Porting to the AS 400 system 115 Running a System 38 Conversion Reformat Utility Job in the AS 400 System 115 Header Specification 0 0 0000 ee 115 Record and Field Specifications 00 115 Running an AS 400 Sort Job in the System 38 environment or on a System 38 115 Appendix C Standard and Alternative Collating Sequences 117 Standard EBCDIC Collating Sequence 117 Defining an Alternative Collating Sequence 120 Specifying an Alternative Collating Sequence for the Entire Control Field 121 Specifying an Alternative Collating Sequence on Parts of the Control Field 121 How to Code an ALTSEQ Specification 122 EXaMples si Pare Diva aed Niue ee aS tytn eae BA ees 122 Example 1 Inserting a Special Character between Two Alphabetic Gharacters x s cence eA ete e eee ee a ee Ae ee ia 122 Example 2 Making Characters Equal 123 Appendix D Sorting Double Byte Character Sets 125 Coding Considerations for Double Byte Character Sets 125 Header Specifications 2 0 0000 ee 126 Record Specifications 2 0200200 eee 127 Field Specifications
14. RECORD CODE ITEM NUMBER SELLING PRICE R 20011230 85000 R 10012000 6295 R 40016210 542 R 50011230 28325 I R 20011230 49515 RECORD ITEM SELLING CODE NUMBER PRICE 2 3 5 12 13 17 Figure 13 Example of the Two Different Record Types in This Input File Chapter 5 Sorting Records from a File and Producing Totals 55 Entering the Specifications Enter the following sort specifications Only those columns that are important to these examples are described HEADER SPECIFICATIONS Eg 73 74 75 76 77 78 79 80 Page Program Identification AA sh Statement R s A RIO bcd Output Type e Maximum e 1 eju L 4 T s Control q tc s t 7 y SORTR e Field u o elp E Number p SORTRS r Length e Reserved sl rju Reserved Comments 4 e SORTA v n e vit ART e 1 256 c q e ELF d e d of H A of F X yrd 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 1 of H S O R T R S 8 A S U M M A R I Z E A M 0j U N T Z 2 fod of F o R E A c H I T E M EA 1 oF The significant column
15. EC SNR RR RRR RR RRR RRR RRR RE Field Specifications For further details regarding coding your field specifications see Chapter 10 Field Specifications Column 8 Data Type This field describes the structure of the data in the field You can show the data being defined for example one byte alphanumeric Katakana or two byte DBCS A DBCS control field with a C in this column is sorted into IBM code EBCDIC order with a maximum length of 128 two byte characters 256 bytes A DBCS control field with a K or L in this column is sorted into the following sequence blanks special symbols a through z Athrough Z Greek letters Japanese Katakana symbols 0 through 9 Roman numerals DBCS in IBM code sequence If column 8 contains a K each Hanja character will sort to the same position as the primary Hangeul pronunciation of that character If column 8 contains an L Hanja characters that start a DBCS word will sort to the same position as the secondary Hangeul pronunciation of that character All other Hanja characters will sort to the same position as the primary Hangeul pronunciation Columns 9 through 16 Location of Field in the Input Record The length of the control field must be a multiple of two and its length must not exceed 256 bytes Note DBCS
16. Summary Data Field Sin Column 7 Column 8 Data Type 2000000525 2G Contents V vi Columns 7 and 8 Details 2 0 2 107 Columns 9 through 12 Field Location Start Position 107 Columns 13 through 16 Field Location End Position 107 Column 17 Conditionally Forced Character 108 Column 17 Summary Overflow Indicator 108 Column 18 Forced Character 2 2244 108 Column 18 Substitution Character 108 Column 19 Continuation a 108 Columns 20 through 22 Overflow Field Length Summary Sort 109 Column 20 Alternative Collating Sequence by Field 109 Columns 23 through 39 Reserved 109 Columns 40 through 72 Comments 109 Chapter 11 The Comment Specification 111 Summary of Column Entries aaa aaa a 111 Detailed Description of Each Column Entry 111 Column 6 or 7 Specification Identifier 111 Columns 8 through 72 Comments 111 Appendix A Information for System 36 Sort Utility Users Porting to the AS 400 System o 2h e seau ee eR ES eee OR A EO ee 113 Running a System 36 Sort Utility Job on the AS 400 System 113 Header Specification 0 0 0 00000 ee ee 113 Record and Field Specifications
17. 7 Number Start End c b n JA Reserved Comments AE 3 C K o fs t jl o ZL r t i fts FE j D E d fi n e Ld D P I t ju q L 4 N V J ula Pod 0 U R t it Z F M S e i hae F IS H T o 3 4 5 6 7 6 9 10 11 12 13 14 15 16 17 18 19 pea 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 i fi 0 0 3 F N Fj z 9 z S R S E Q U E N C E i f RE Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before it is used to control the sort 8 F The data field contains a DBCS control field using character type strokes radical sequence 9 12 2 The data field begins in column 2 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Identifies the sort as a Strokes Radical sequence 138 Sort User s Guide and Reference Sorting Considerations for Traditional Chinese Double Byte Character Sets Traditional Chinese double byte characters can be sorted into the following three different sequences 1 Character type strokes radical DBCS code sequence 2 Character type radical strokes beyond radical DBCS code sequence 3 Character type sequence Figure 34 Traditional Chinese Character Sequences Character Type Characters can be ordered into one of the following character type sequences
18. Sort records The output records stored in their own separate work area are sorted according to the collating sequence specified and according to the con tents of the control field The control field is used as a key Its size is determined by the entry in columns 15 through 17 of the header specification The data that is placed in this control field during the reformatting process is determined by the control field specifications and can be formatted differently for each record type Store records The result is stored in a physical file If no record or field specifications are entered FMTDTA does no sorting or reformat ting and the process becomes one of copying and merging records from one or more input files into an output file The Sort utility does not require unique control fields If duplicate control field values are found in the input records those records will appear in a group in the output file in the same order that they were found in the input file Related Concepts The following concepts are useful in understanding how the Sort utility works Files and Work Areas Sort can work with files on diskettes disks and databases The following files and work areas are used Up to 8 input files The input files can be any combination of physical logical or diskette unit files One source file This file contains the specification statements Work area A work area is automatically built and deleted by th
19. gt ey cue S m ae gi FIRST SRCFILE pices filename SRCMBR doto file identifier CURLIB embe r name library name gt LIBL Bo E m ae PRTFILE print file name CURLIB library name gt lt NODU CHK PRT _OPTION Loch Lvoprt DUMP Note 1 A maximum of 8 repetitions MP o i L SECLVL CURRENT PGMDATE pg Figure 18 Syntax of the FATDTA Command The FMTDTA Displays Type FMTDTA with no parameters and press F4 to pull up the first FMTDTA prompt display gt Format Data FMTDTA Type choices press Enter Input file Filen suk te SS Saws Sand eens ame Library 23 6 6 ee bes xCURLIB___ Name CURLIB LIBL Member ave csc Seice eeen in A FIRST ame FIRST for more values _ Output file FIGS one ke ae ee ae ame LIDAS vay Ge Se Sco en Ss xCURLIB___ Name CURLIB LIBL Member es Sec ieee seus eee i FIRST ame FIRST SOUE eea ce ug E wetweho R QFMTSRC__ ame LA DVARY 3 eee Soest ses a coy Bs eee os LIBL ame CURLIB LIBL SOURCES Souci i we ee fae ae Be FIRST ame FIRST Bottom F3 Exit F4 Prompt F5 Refresh F10 Additional parameters F12 Cancel F13 How to use this display F24 More Keys Figure 19 The First FMTDTA Screen 74 Sort User s Guide and Reference 2 You must enter at least a value for Input File Name and a value for Outpu
20. i pid p R s c i Number s Start End b f A Reserved Comments j y C K ofs jt ji ai ZL rit fi fts Anes D E d i n e Lod D P I t u q 7 N V J u a 7 0 U R t t Lay F M S e i Look F S H T o L 4 34 5 6 5 ie 9 10 11 12 13 14 15 16 17 18 19 oe 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s 72 F N C 3 1 0 C O N T R Of L F I E L D a F S U 1 2 1 7 D A T A FIH EpL D f y if cif of fh i These are the two field specifications The significant column entries for the control field specification are Columns Entry Explanation 7 N The control field data is to be treated as a normal control field This means that the unchanged data from the input record is to be used and that the sort sequence is to be that specified in the header specification ascending 8 c Specifies that Sort is to interpret the data in the control field as character data where both the zone and digit portions of each byte are compared If for example only the digit portions were compared data would be summed for those records whose control field digit portions matched the control field values would not necessarily have to be unique since the zone portions could differ 9 12 3 Start position of the control field data from the input record 13 16 10 End position of the control field data from the input record The significant column entries for the summary data fi
21. CUO NOD Z2 1 D2 1 99999 1 16 16 lt C UON 256 16 16 lt _cCUVUVIUNOD 1 Cumulative maximum length for key fields 2 For an unconditional force and a force all line column 8 must contain a C Columns 9 through 12 Field Location Start Position These columns identify the starting position of a field If columns 9 through 12 are blank Sort assumes that the field length is equal to the record length To describe fields that are only one character long leave columns 9 through 12 blank and enter the number of the record position that contains the character in columns 13 through 16 Columns 13 through 16 Field Location End Position These columns identify the position in which the field ends If columns 9 through 12 and 13 through 16 are blank Sort assumes that the field length is equal to the record length To describe fields that are only one character long leave columns 9 through 12 blank and enter the number of the record position that contains the character in columns 13 through 16 Chapter 10 Field Specifications 107 Column 17 Conditionally Forced Character This entry tells Sort which character in the control field defined in columns 13 through 16 you want to replace The program checks to see if the control field in the input record contains the character you specified here If it does the character in column 18 replaces the control field character If a control field can contain
22. acters are used in Taiwan Hong Kong and some other parts of the world Traditional Chinese double byte character set An IBM defined double byte character set for Traditional Chinese consisting of the traditional Chinese non Chinese set primary set secondary set and up to 2 632 user definable characters Traditional Chinese non Chinese character set A subset of the Traditional Chinese DBCS consisting of non Chinese characters such as Greek Russian Roman numeric alphanumeric and related symbols Katakana Hiragana special symbols and Chinese pho netic symbols There are 675 characters in this set Traditional Chinese primary character set A subset of the Traditional Chinese DBCS consisting of com monly used Chinese characters There are 5 401 char acters in this set Traditional Chinese secondary character set A subset of the Traditional Chinese DBCS consisting of less commonly used Chinese characters There are 7 652 characters in this set unconditional force A specification that always results in a character being forced into the control field before the records are sorted work area An area in storage reserved for temporary storage of data that is being resequenced work file A file that is used for temporary storage of data being processed work record A record built by the Sort program for later processing zoned decimal format A format for representing numbers in which the digit is contain
23. Factor 2 gt e fed y t Jat Oper t Keyword a Number p i y Start End ator o Comments A e n p Position Position r Factor 2 7 u e 2 Field N gt I Je c L l 0 Z c Location f JA D EQ NE F Eo o P LT GT K Start End Tek 3 4 5 6 4 in 9 10 11 12 13 14 15 16 as 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s5 hz I U 6 9 7 4j L T F 4 0 4 5 f e IA of 1 of Columns Entry Explanation 6 I The input records that meet the conditions specified are to be included in the output 7 No entry The first of the set of record specifications that is to define this type of record 8 U The data in the Factor 1 and Factor 2 fields of each input record is to be inter preted as numeric and in unpacked format This means that each digit will be represented by 8 bits The lower 4 bits digit portion identify the digit while the higher 4 bits zone portion represent the sign plus or minus for the entire number Note that by specifying this type of data you are limiting the length of the Factor 1 and Factor 2 fields to 192 bits I6 digits or less 9 12 69 The Factor 1 field begins in column 69 of the input record 13 16 74 The Factor 1 field ends in column 74 of the input record This selects the data from the INSTOCK field corresponding to the original data definition for the input records 17 18 LT The data in the Factor 1 field must be l
24. O This statement designates a record type that is different from but has the same field statements as the record type described in the previous statement s A This statement continues the same record type as the previous statement or statements This record type can be continued IA or a different record type can be started IO provided all record types have the smae field statements Record types with different field statements would have to be defined in a separate include set Field statement s for record types Include only one record type implied include all O optional F Include all H F or O Header statement No record type statements or omit statements only Field statement s for the implied include all statement Header statement field statement or omit statement This statement tells the sort program to sort all of the records that have not been described by any preceding include and omit statements Records referred to in this manner must have identical field specifications Field statement s 90 Sort User s Guide and Reference Note Every include set must end with field statements An include set can be followed by another include set or an omit set Records not described in include sets will not be sorted Table 4 show the entries for include sets Table 4 Omit Sets Column 6 Column 7 Type of Set Entry Entry Explanation Omit AND state H or F Header statement
25. S Factor 2 is a constant but it is shifted one character to the left before compar ison 20 23 1 9999 The start position of the Factor 2 field This can be left blank if the Factor 2 field is one character long 24 27 1 9999 The end position of the Factor 2 field If columns 20 through 23 are blank this entry defines a Factor 2 field that is one character long in the position specified 20 39 Any entry If columns 20 through 27 are not being used to define the start and end posi tions of the Factor 2 field then columns 20 through 39 can be used to specify a constant or keyword against which Factor 1 is compared 40 72 Any entry Comments 88 Sort User s Guide and Reference Detailed Description of Each Column Entry Columns 1 and 2 Page and Columns 3 through 5 Statement Number Together these columns form a 5 digit sequence number Use the CHK option of the FMTDTA command see Chapter 7 The Format Data FMTDTA Command to check for out of sequence conditions in the Sort specifi cation set Note Alternative collating sequence ALTSEQ statements are not sequence checked but must immediately follow the header statement Column 6 Specification Identifier This column identifies the specification as a record specification and indicates whether the defined record is to be included in or omitted from the sort or if it is to be treated as a comment Possible entries are I The record that is being identified is
26. T A Fl I E L D CO SNR RNR RRR RRR RRR RRR RRR RE The significant column entries are Columns Entry Explanation 7 N Identifies the field as a normal control field The data in the control field is not to be forced altered before being used to control the sort 8 C Specifies that Sort is to interpret the data in the control field as character data where both the zone and digit portions of each byte are compared 9 12 3 The start position of the control field is the same as the end position 13 16 10 The end position of the control field data in the input record The significant column entries for the summary data field specification are Columns Entry Explanation 7 S Identifies the field as a summary data field The data in this field is to be summed 8 U The data in this field is to be interpreted as numeric data in unpacked format each digit is represented by both the zone and digit portions of the byte with the zone portion of the last byte determining the sign positive or negative for the entire number 9 12 39 The start position of the control field is the same as the end position 13 16 43 The end position of the control field data in the input record Summary data fields are defined very much like normal output data fields e Enter
27. Tools licensed program normal control field A control field that is sorted in the sequence specified in the header specification 150 Sort User s Guide and Reference opposite control field A control field that is sorted in the opposite sequence of that specified in the header specification output file A file resulting from the resequencing or copy request overflow indicator A specified character that is to be placed at the end of an output record in the case of an overflow during a summary sort overflow field A field that allows for field expansion overflow indicator field The one character field into which the overflow character is placed packed decimal format A format in which each byte except the rightmost byte within a field represents two numeric digits The rightmost byte contains one digit and the sign For example the decimal value 123 is represented as 0001 0010 0011 1111 Contrast with zoned decimal format record address file A physical file that contains 4 byte binary relative record numbers rather than data set A grouping of one or more record specifications shift in character A control character hex OF that indicates the end of a string of double byte characters Contrast with shift out character shift out character A control character hex OE that indicates the start of a string of double byte characters Contrast with shift in character Simplified Chinese The Chinese charact
28. described in Appendix C Standard and Alternative Col lating Sequences and specified in the header specification determines whether one alphanumeric value is greater than or less than another If an alternative col lating sequence is specified on the entire control field then both Factor 1 and Factor 2 are modified before the two are compared If only the zone portions of characters are to be compared column 8 contains a Z then EQ or NE are the only two entries you can make Column 19 Type of Data Contained in Factor 2 This column identifies whether Factor 2 is data a constant or a keyword The possible entries are F Factor 2 is to contain data from the input record c Factor 2 is a constant as specified in columns 20 through 39 K Factor 2 is the keyword specified in columns 20 through 25 S Factor 2 is a double byte character set DBCS constant requiring a shift one position to the left Columns 20 through 23 Factor 2 Start Position If column 19 contains an F the entry in these columns identifies the starting posi tion of the Factor 2 field in the input record The entry must be right justified Columns 24 through 27 Factor 2 End Position If column 19 contains an F the entry in these columns identifies the end position of the Factor 2 field in the input record The length of Factor 2 the end position minus the start position plus 1 must equal that of Factor 1 To describe fields that are only one c
29. e Special characters e Alphabet e Greek e Katakana e Roman Strokes Characters can be ordered by the number of strokes used to draw the character or by the total number of strokes Radical Characters can be ordered into their respective radicals Within each radical set the characters are ordered by strokes Radical numbers can be user defined For a listing of radical numbers refer to the ADTS 400 Character Gener ator Utility SC09 1769 Strokes beyond radical Characters can be ordered by the number of strokes used to draw the character or by the number of strokes excluding the radical DBCS Code Sequence f all of the sort criteria are the same for any two DBCS characters in sequences 1 and 2 in Figure 34 the characters will be ordered based on their internal hexadecimal representations Appendix D Sorting Double Byte Character Sets 139 Traditional Chinese Strokes Radical Sorting Example The following example illustrates sorting a person s name by Strokes Radical sequence for employees working in the Purchasing Department The DBCS sort program requires one control field to sort into this sequence This example shows the specifications required to generate the control field if the field in the input records contains four DBCS characters The input layout file is as follows
30. if you must keep the original data repeat the information as a data field A blank in column 28 means to keep the control field an X means to drop the control field Column 35 DBCS Sort Option This column is valid only in the System 36 environment and applies only to Japanese DBCS sorts Entries 1 and 2 will only be supported for System 36 compatibility otherwise you must leave this column blank 126 Sort User s Guide and Reference RECORD SPECIFICATIONS Factor 1 on ov vo GUONG 9 10 11 12 Start End Position Position 13 14 15 16 F Factor 2 Constant a c Factor 2 e t Keyword o Comments r Factor 2 e 2 Field Cc Location F K Start End Ss 1 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 WN NS NN NN NN RRR RRR SNR RN aa RRR Record Specifications For further details regarding coding your record specifications see Chapter 9 Record Specifications e Column 8 Data Type For users of double byte characters the only valid entry is C Note Although Z and D are not invalid entries and no error message will be issued if they are coded undesirable results may occur when you sort double byte character sets Colum
31. record specification 96 U UDATE keyword Factor 1 field 95 Factor 2 field 97 UDAY keyword Factor 2 field 97 UMONTH keyword Factor 1 field 95 Factor 2 field 97 unconditional control field 102 unconditional force description 104 unconditional force definition 151 unconditional forced control field 104 unconditionally forced character unique control field value summary sort 48 unpacked format 19 updating automatic 42 useful things to know 10 14 using all input records default 89 UYEAR keyword Factor 1 field 95 Factor 2 field 97 W warning messages 78 work area 9 10 12 151 automatic deletion of 10 copy only requests 10 description 12 number of records 13 work area definition 151 work file definition 151 work library 12 work record length 13 work record definition 151 writing to a file 11 Z zone portion EBCDIC 117 of character byte 91 zoned decimal format definition 151 zoned field definition 151 zoned format numeric fields 91 Index 165 Program Number 5763 SS1 Printed in the United States of America on recycled paper containing 10 recovered post consumer fiber
32. s t y SORTR e Field u o elp LS 7 Number p SORTRS r Length e Reserved SI rju Reserved Comments be e SORTA v n e vit e 1 256 c qje fd d e d iene H A y i D F X 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 43 44 45 46 47 48 49 50 51 52 53 54 5 i H s o R T R FA X 7 AE i Columns Entry Explanation 7 12 SORTR This is a regular sort the output is to be a physical file 18 A The output records are to be sorted in ascending order 28 X The control field is not to be included in the output record No record specifications are entered Thus there are no conditions imposed on the selection of input records This means that all input records are to be processed Chapter 3 Sorting Records from Several Files 37 FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow f i i ja Charac Field 7 Tle tT ters Length 7 y fl jay re ee 7 pid p R s c AE e e e u jo Ls oh Number Start End c b n JA Reserved Comments CK o fs t 1 FAS i Z L ETET IES he ke D E d i n e rS D P I t ju q N V J u ja 4 0 U R tt lt F M S efi Le xy F YS H T o 7 34 5 6 5 pa 9 10 11 12 13 14 15 16 17 18 19 en 2
33. ty E D E d ji n e 7 D P I t ju q Loo N V d u fa a 7 0 U R tit E i F M S efi MER i FS H T o 7 34 5 6 5 ie 9 10 11 12 13 14 15 16 17 18 19 oe 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 y hao F N C 4 1 4 2 i I T E M C L A S S SFN E FFEIND f A N Y T H I N G Ey L S E f i 1 This specification establishes the ITEMCLASS field as the control field The contents of the specification are Columns Entry Explanation 7 N The control field is to be treated as a normal control field This means that the unchanged data from the input record is to be used and that the sort sequence is specified in the header specification ascending 8 c The system looks at the data in this control field as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit 9 12 41 This control field is to begin in column 41 of the input record 13 16 42 This control field is to end in column 42 of the input record This selects the data from the TYPENO field corresponding to the original data definition for the input records 40 72 Comments Identifies the name of the field selected as control field from the input record Chapter 4 Sorting Records from a Single File to Produce a Record Address File 45 Processing These Specifications Once the specifications for the RA sort job are stored
34. unlike the AS 400 system does not convert invalid digits to zeros or invalid signs to positives X F Therefore if you specify Factor 1 as con taining invalid packed numeric data System 36 interprets the value differently from the AS 400 system Your sort results will be different 114 Sort User s Guide and Reference Appendix B Information for System 38 Conversion Reformat Utility Users Porting to the AS 400 system This appendix describes those differences between the AS 400 system and the System 38 Conversion Reformat Utility that affect the way that you enter Sort spec ifications Running a System 38 Conversion Reformat Utility Job in the AS 400 System Your System 38 Conversion Reformat Utility specifications will continue to work on the AS 400 system You should however be aware of the following Header Specification Collating Sequence Column 26 The Sort utility has the additional feature of being able to use an alternative collating sequence for specified parts of the control field Enter F You must enter an A into column 20 of any field specification that defines a portion of the control field that is to be sorted with respect to the alternative collating sequence If you specify an alternative collating sequence for any input field in this way this sequence will apply to any other record types that also specify this input field as part of the control field Note This enhancement cannot be used with
35. 1 Factor 2 System 36 Sort Utility 114 input record 11 length continued input records 8 of control field 83 of Factor 1 field 95 of work records 13 overflow field field specification 109 print file output record 12 libraries 4 library current 75 76 library with sort message files 15 temporary work 12 limitations copy only requests 13 length of forced control field 102 sort requests 13 line command 9 linking field specifications 38 location of field in input record field specification 107 locked keyboard 16 logical file multiple input 35 single input 17 67 making characters equal in sort sequence 123 master sort table 125 master sort table definition 150 maximum control field length header specification 83 summary sort 48 maximum length for output record exceeding 109 maximum length of Factor 1 Factor 2 System 36 Sort Utility 114 member 4 merging records 10 merging copying to produce a reformatted output file 71 messages 14 78 error 15 first level text 15 informational 15 second level text 16 System 36 Sort Utility 113 modifying records RA files 42 Index 159 N name file 85 names of output file and member 12 naming conventions 73 file 73 negative constants coding of 97 nonkeyed logical file 11 normal control field 102 field specification 101 102 normal control field definition 150 number 91 interpreting the sign of 94 sequence field specification 101 signed 94 number of records in wor
36. 13 storing specifications 5 strings of bytes 8 strokes beyond radical Simplified Chinese 135 strokes beyond radical Traditional Chinese 139 strokes sequence Japanese 129 strokes Simplified Chinese 135 strokes Traditional Chinese 139 STRSEU CL commands 4 substitution character field specification 108 substitution of characters in output record 36 substitution of characters forced definition 149 summary data field 48 102 104 description 47 increasing size of 48 overflow 48 summary data field definition 151 summary overflow indicator field specification 108 summary sort 47 48 83 summing 47 summing and sorting detecting overflow 64 two input record types 54 using an overflow field 63 syntax checking System 36 Sort Utility 113 syntax of FMTDTA command 74 system data description 11 system printer 12 77 system security 11 T table active sort definition 149 tables generation of 13 internal 78 temporary work library 12 testing for overflow indicator 64 tie breaker Japanese 130 tie breaker Simplified Chinese 136 total overflow 108 164 Sort User s Guide and Reference totals 104 tracking problems 14 Traditional Chinese double byte character sets character type 139 DBCS code sequence 139 radical 139 strokes 139 strokes beyond radical 139 Traditional Chinese definition 151 truncation of output record 11 type data field specification 104 field field specification 101 record 87 type of Factor 2 data
37. 51 52 53 54 55 EE AEC SRN RRR RR RNR RRR RNR RR Figure 26 Form for Entering Field Specifications Copyright IBM Corp 1994 99 Summary of Column Entries Table 8 summarizes the column entries for field statements Table 8 Page 1 of 2 Summary of Column Entries for the Field Specifications Columns Entry Explanation 1 2 00 99 Page number no entry required 3 5 000 999 Statement number no entry required 6 F Identifies this specification as a field specification 7 D The field is a data field N The field is a normal control field 0 The field is an opposite control field F The field is a forced control field S The field is a summary data field Identifies this specification as a comment specification 8 P The field contains signed decimal data in packed format U The field contains signed decimal data in zoned format C The field contains character data Z Only the zone portion is used for sorting D Only the digit portion of each character is used for sorting V Force a single data character into the data field F Simplified Chinese DBCS control field using character type total strokes radical sequence G Simplified Chinese DBCS control field using character type radical strokes beyond radical sequence N Simplified Chinese DBCS control fiel
38. 53 54 55 72 e LS F N C 1 6 1 T E m Nf 0 Hs T H E ENE i A i c of N T R of L F I Ef L D Lod Le cf 1 LS i This specification establishes a control field for this record type Columns Entry Explanation 7 N The control field is to be treated as a normal control field This means that the unchanged data from the input record is to be used and that the sort sequence is to be that specified in the header specification ascending 8 c The system looks at the data in this control field as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit 9 12 1 This control field begins in column 1 of the input record 13 16 6 This control field ends in column 6 of the input record This selects the data from the ITEMNO field corresponding to the original data definition for the input records 40 72 Comments Identifies the name of the field selected as control field from the input record Chapter 2 Sorting Records from a Single Fie 25 FIELD SPECIFICATIONS Statement Field Location Forced Overflow F 1 T je 1 d vox Number 7 anozo Start End 9 10 11 12 13 14 1 Charac Field ters Length S A Reserved Comments asoa pacano E H30 ewmeS3 Aoo 2 A 5 16 17 18 19 2
39. 6 I Specifies that the records described in this specification should be included in the summary sort as opposed to being omitted from it 8 c Identifies the data for Factor 1 and 2 as character data The system will look at both the zone and digit portions of each byte when comparing Factor 1 with Factor 2 13 16 2 Start and end position of the Factor 1 field 17 18 EQ Specifies that the data in Factor 1 of each record must equal Factor 2 19 c Specifies that the data in the Factor 2 field is to be equal to the constant value entered into columns 20 through 39 of this record specification 20 39 I The constant value for Factor 2 Because the input file has two different record types and you intend to work with both you must specify them as two separate sets of specifications In the field specifications for the first set a summary data field is defined after the control field Chapter 5 Sorting Records from a File and Producing Totals 57 FIELD SPECIFICATIONS Field Location Forced Overflow Charac Field ters Length R S Statement aston aera T y p e Number Start End A Reserved Comments Br ZCHVOND Husem ra ovk asonm macan SHOE anozo e30 evceS3 A0 2 A 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 43 44 45 46 47 48 49 50 51 52 53 54 55 X N F N 3 1 0 c Of N T R Of L Fl I E L D F S U 3 9 4 3 D A
40. 80 Page Program Identification 1 of Statement R s A RJO l 4 Output Type e Maximum e 1 eju T s Control q tC s t E y SORTR e Field u o elp L 4 Number p SORTRS r Length e Reserved sl rju Reserved Comments 7 e SORTA v n e vit AE e 1 256 c q e 4 d e d Pe oh H A dod D F X Loch 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 43 44 45 46 47 48 49 50 51 52 53 5455 72 1 of H S O R T R 2 O A S O R T I N P U T L 4 1 t FI I L D s fod 1 of This is a standard header specification for a Sort job similar to that entered for the previous examples The significant column entry here is Columns Entry Explanation 28 No entry The control field will be included in the output record This means that the unchanged data from the input record is to be used and that the sort sequence is specified in the header specification ascending A blank in column 28 will include the control field in the output record RECORD SPECIFICATIONS 1 of Statement C D Factor 1 Com F Facto
41. A conditional force changes a character found in a control field element the length of the control field element must be 1 to another character Put the character you want to replace into column 17 and the character you want it replaced by into column 18 For example if you want to replace all occurrences of Z in the first byte of the input record by a plus sign complete the field specification as for a regular control field and put a 1 in column 16 a Z in column 17 and a plus sign in column 18 FIELD SPECIFICATIONS Statement Field Location Forced Overflow T y Number 34 5 anozo E DIZES UVOND Huse mr a VKH Start 9 10 11 12 End 13 14 15 Charac Field ters Length A Reserved Comments R c o ee r t d q EEEE msOse a esses 16 17 18 Re N AY 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 o CE AEC BNR RRR RNR RRR RRR RR Sort does this replacement before using the control field to process the input record Conditional Force All Fields Force all is a special type of conditional force The force all specification applies the change as specified in column 18 to all those input records that have not previously had a conditio
42. Ae Reserved Comments l Le aes ts f of e 7 q A Lent Loot 7 fo A l 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 72 7 s o R T uj s I N G DOS ELF C O N V Ef R S I Of N T A B L E 72 7 i Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before it is used to control the sort 8 L The Hanja characters that start the DBCS word will sort to the same position as the secondary Hangeul pronunciation of the characters 9 12 2 The data field begins in column 2 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Sort using conversion tables Appendix D Sorting Double Byte Character Sets 145 146 Sort User s Guide and Reference Bibliography The manuals below are listed with their full title and base order number and with the shortened version of the title When these manuals are referred to in the text the shortened version of the title is used e ADTS 400 Character Generator Utility SCO09 1769 Short title ADTS 400 Character Generator Utility e ADTS 400 Programming Development Manager SC09 1771 Short title ADTS 400 Programming Development Manager e ADTS 400 Screen Design Aid SCO9 1768 Short title ADTS 400 Screen Desig
43. Command 9 Related Concepts 2 10 Files and Work Areas 2 2 2222020 2022 a 10 MEURISSE sexs thas Bae Sneek eee eed okt wenn eh eee Sats AY 10 OQUIPULIFIIGS vo c ale A ee hc ak Sn ee i Pe eee deg a 11 Work Area s a LOS te tee ee POE A n A E e wad eee Pas 12 Source FIG sen oa bk n AS oe edn og bee eRe od oe A 12 PrintiRile e ssnst ga Ghee why Bid Pabati ge Ete ee eee ge Be ee 12 Input and Output Record Format a 12 Limitations on the Number of Records for Copy Only Requests 13 Limitations on the Number of Records for Sort Requests 13 Tracking Any Problems 0 0 00 ce 14 Message and Help Information 2 000002 eee 14 Displaying and Printing Messages 200000 15 Correcting the Error 2 2 a 16 Control Language Command Help 2 00004 16 Chapter 2 Sorting Records froma Single File 17 Pampos o lt 4 cana a a a hae Oe ea E BR ieee Dhani amp A 17 Example 1 Sorting a File with a Single Input Record Type 17 Entering the Specifications 0 0 00 00002 ee 18 Processing These Specifications 0004 22 Example 2 Sorting Two Types of Records from the Input File 22 Entering the Specifications 0 0 0 0 002 eee 23 Processing These Specifications 00004 30 Example 3 Reformatting Records 1 00 30 Entering the
44. Detailed Description of Each Column Entry Columns 1 and 2 Page 0 0200000508 Columns 3 through 5 Statement Number Column 6 Specification Identifier 0 4 Columns 7 through 12 Output File Type Columns 13 and 14 Reserved 00004 Columns 15 through 17 Maximum Control Field Length Copy Only Request 0 0 0000 ee Column 18 Sort Sequence 2 000002 eee Columns 19 through 25 Reserved 0 4 Column 26 Alternative Collating Sequence Column 27 Reserved 0 000022 Column 28 Include Exclude Control Field in Output Columns 29 through 39 Reserved 0 Columns 40 through 72 Comments 0 Columns 73 through 80 Program Identification Chapter 9 Record Specifications Set of Record Specifications 0 0 02 0000 Record TYDE ace ee a ee a ee ee ed I ae a Summary of Column Entries 0220220020005 Detailed Description of Each Column Entry Columns 1 and 2 Page and Columns 3 through 5 Statement Number Column 6 Specification Identifier 2 00004 Column 7 Begin Continue Record Definition Column 8 Data Type 2 200200 2p eee ee Interpreting Alphanumeric Data
45. F into column 6 to indicate a field selection specification e Enter S into column 7 to indicate a summary data field e Enter the data type of the field to be added into column 8 The same data types that are used for normal data fields are also used for summary data fields This data type entry is important because the method of adding and the interpretation of the result vary depending on the data type selected In the following list the word number refers to the entire sequence of digits the number 4 526 is composed of the digits 4 5 2 and 6 P Packed data type System considers each sequence of four bits as one digit starting with the second sequence from the right The four bits far thest to the right determine the sign of the number 58 Sort User s Guide and Reference U Unpacked data type System considers each sequence of eight bits each byte as one digit The digit portions determine the digit and are added together The zone portion of the last byte determines the sign of the number The zone portions of the other bytes remain as X F to indicate to the system that these bytes are digits as opposed to other characters D Digit data type System considers each byte as one digit as for unpacked data except that the zone portion of the last byte is not used to contain the sign of the number The number has no sign it is assumed to be positive C Character data type System considers each byte as one character Z Z
46. Field u o elp 1 Number p SORTRS r Length e Reserved Sl rju Reserved Comments Ea e SORTA v n e vit A 6 e 1 256 c q e AE i d e d H A Ss i i D F X 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 43 44 45 46 47 48 49 50 51 FSS IN fhe 0 O 1 H S Of R T R 8 X N 0 C Of N T R Of L FL I ELU s Columns Entry Explanation 7 12 SORTR This is a regular sort the output is a physical file 17 8 The maximum control field length is 8 characters 28 X The control field does not appear in the output record 40 72 Comments Identifies that the control field is dropped Appendix D Sorting Double Byte Character Sets 143 RECORD SPECIFICATIONS Statement C D Factor 1 Com F pem Factor 2 Constant m f f o ja pari a 7 T In t son c Factor 2 gt e 7 y t Jat Oper t Keyword bod Number p i y ator o Comments E ejn p r Factor 2 e of u e 2 Field EE I Je c L 4 0 z c Location f 1A D EQ NE F Tok o P LT GT K Start End Ead 3 4 5 6 5 E 9 10 11 12 13 14 15 16 Ta 1 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s5 yp 0 oO 2 I 2 E Q B I C O M P A R E 1 aaa A e e e IA o
47. I c 1 2 2 o el al sl ol k xl xl x x x x kl KI KI kl tl cl ol ml e al ele 9 SRNE a e i 5 1 I of Hoy Columns Entry Explanation 6 I Specifies that the records described in this specification are to be included in the sort 8 c Identifies the data for Factor 1 and Factor 2 as character data The system will look at both the zone and the digit portions of each byte when comparing Factor 1 with Factor 2 9 12 12 Factor 1 field begins in column 12 of the input record 13 16 29 Factor 1 field ends in column 29 of the input record 17 18 EQ The data in the Factor 1 field must equal the data in the Factor 2 con stant for the input record to be selected for sorting 19 S The data in the Factor 2 field is constant and is shifted one column to the left before comparison 20 0 Represents the shift out character 21 38 KKKKKKKKKKKKKKKKKK The 9 two byte characters Purchasing Department to be compared 25 I Represents the shift in character 40 72 Comments Identifies that two Kanji characters are being compared Appendix D Sorting Double Byte Character Sets 137 FIELD SPECIFICATIONS 1 5 Statement F D Field Location Forced Overflow i Ja Charac Field E lt T Je t T ters Length 4 y l jay E pid p R s c T e e e u jo
48. Length Col 8 Character Portion Used Maximum Entry Field Length V Force the replacement of the existing character 1 character with a new character F Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type total strokes radical sequence G Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type radical strokes beyond radical sequence N Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type single pronunciation radical total strokes tie breaker sequence Q Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type single pronunciation total strokes radical tie breaker sequence W Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type single pronunciation tie breaker radical total strokes sequence X Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type total strokes radical single pronunciation tie breaker sequence y Sort the Simplified Chinese DBCS control field 128 2 byte characters 256 bytes into character type sequence M Sort the Traditional Chinese control field into 128 2 byte characters 256 bytes character type sequence H Sort the Traditional Chinese control field into 128 2 byte characters 256 bytes character type
49. N C 1 6 I T E M N oO I s n o R m Af L Le of i TE 1 1 This is the specification that defines the control field as ITEM from the input record The control field is to be included in the output record and because it is the first field specified it will be the first field in the output record and will automatically occupy columns 1 to 6 FIELD SPECIFICATIONS 7 Statement F D Field Location Forced Overflow 7 i fa Charac Field 7 T Je t T ters Length LP ol y l jay p d p R S C Lok e e e u jo kod Number Start End c b jn JA Reserved Comments dow if C K ols t jl s ANE a ZL efe fi ts E D E d i n e E i D P I t ju q 1S ol N V J u fa ee 0 U R t jt ARE i F MS e i ELA F IS H T o x B n JA 4 3 4 5 6 7 8 910 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 72 fe EF FL N 213 2 9 R E Oj R D FIIN Ett D Es b fe F N C 1 5 2 1 B AJ L F I E L D TS i Le ot Lh i fo The control field specification is then followed by two more field spe
50. Processing These Specifications 0 0004 Example 3 Using an Overflow Field for Summary Data Overflow Entering the Specifications 0 00000 ee eee Processing These Specifications 0000 4 Example 4 Using an Overflow Indicator for Summary Data Overflow Entering the Specifications 2 00000000 2G Processing These Specifications 2 0004 Chapter 6 Copying and Merging Records from Several Files into One EXaMples sac ioe Bu hk ae CAKE ee ee eee ae wae SS Example 1 Copying a File with No Reformatting Entering the Specifications 2 00 00 002 ee eee Processing the Specifications 2 0000 0004 Example 2 Copying Merging Several Files to Produce a Reformatted Output File nto ie ae Fes ee eae ae et ed ee we cine ME ee A au N Entering the Specifications 0 0 0 0 0000008 Processing These Specifications 000 Chapter 7 The Format Data FMTDTA Command Accessing and Using the FATDTA Command File Naming Conventions 200 0000200 0 Syntax of the FMTDTA Command 0000200 a ee The FMTDTA Displays 0 tiered ka bka ea e a ai The Parameters of the FMTDTA Command 05 Chapter 8 The Header Specification Summary of Column Entries aaa aaa 0200200000005 iV Sort User s Guide and Reference
51. Specifications 0 0 00 00000 ee 31 Processing These Specifications 2 0004 Example 4 Reformatting Records 2 00 Chapter 3 Sorting Records from Several Files Examples 2020 a ea nde ea tee ee geet aad She ee ae ee es Example 1 Sorting Records from Five Input Files Entering the Specifications 00000002 2 e eee Processing These Specifications 000 Chapter 4 Sorting Records from a Single File to Produce a Record Address File gt Lispa ee hed She eGo ed dol den BaP aw ls Automatic Updating 2 2 2 0 00 2 eo n e e a E EXAMPIOS elspe eaae god dda De atin of gba ha Se eine ee ae Ee Example 1 Sorting an Inventory File by Item Class Entering the Specifications 0 00 0 000 eee Processing These Specifications 0000 4 Chapter 5 Sorting Records from a File and Producing Totals Defining a Summary Set 2 0 020000002000 Handling Overflow 0 000000 ee ee EXaMpleS aaa aon Be We Al Be Aa ee Awe A eR RRA Example 1 Sorting a File and Summing Data in Certain Fields One Record TNO ak a ea A Re ee See ee OO A Entering the Specifications 00 0000 eee Processing These Specifications 000 Example 2 Producing Summary Totals Based on Two Input Record Types Entering the Specifications 0 000000 0000 8G
52. This book tells you how to use the Sort utility to select records from existing files sort and reformat them and then store the result Topics covered also include copying records merging records from several files summing data in the selected records and sorting double byte character set DBCS data You may need to refer to other IBM manuals for more specific information about a particular topic The Publications Ordering SC41 3000 manual provides informa tion on all the manuals in the AS 400 library For a list of related publications see the Bibliography on page 147 Who Should Use This Manual Copyright IBM Corp 1994 This manual the Sort User s Guide and Reference SC09 1826 is written for pro grammers who wish to design and code Sort jobs and for the system operators who may run these jobs Before you use this manual you should be familiar with certain information e You should be familiar with your display station also Known as a work station and its controls Some elements of its display and certain keys on the key board are standard regardless of the software system currently running at the display station or the hardware system the display station is connected to Some of these keys are Cursor movement keys Command keys Field exit keys Insert and delete keys The Error Reset key This information is contained in the System Operation for New Users SC41 3200 e You should know
53. and a blank are exactly the same If you instruct the Sort utility to use only the digit portions of characters by putting a D into column 8 characters with identical digit portions will look alike and compare as equal Likewise if you instruct it to use only the zone position of char acters by putting a Z into column 8 characters with identical zone positions will look alike and compare as equal Thus the column 8 entry is critical to ensuring that the compare operations produce the results you intend For example suppose you want only those records with a 2 in column 15 and a 2 in column 50 If you put a D into column 8 you will get the records you want but you may also get many records you do not want several characters have the same digit position as a 2 To get only the desired records with a 2 in column 15 and a 2 in column 50 you must put a C into column 8 instead The C tells Sort to use both the zone and digit portions of characters in its compare operations and no other character has the same combination of zone and digit portions as the ones you want Interpreting Numeric Data If you specify that the Factor 1 and Factor 2 fields are to contain numeric data in packed format Sort reads each four bits as a separate digit up to the last four bits in the field These last four bits determine whether the number being read is posi tive or negative If you specify that these fields are to contain numeric data in zoned unp
54. character set character type 135 139 character type sequence 130 code sequence Japanese 130 Simplified Chinese 136 Traditional Chinese 139 code definition 149 definition 149 font file definition 149 number definition 149 pronunciation 142 radical 129 135 139 Sei On Katakana sequence 130 single pronunciation 135 single pronunciation sequence 129 sorting 125 strokes 129 135 139 strokes beyond radical 135 139 tie breaker 136 tie breaker sequence 130 DSPMSGD CL command 15 E EBCDIC collating sequence description 117 digit portion comparison 120 156 Sort User s Guide and Reference EBCDIC collating sequence continued standard collating sequence 118 zone portion comparison 119 entering 4 comments 5 specifications 3 error Error Reset key 16 messages 78 missing file 11 exception condition RA files 42 exclude input records 87 F Factor 1 end position record specification 95 field length 92 95 field record specification 87 fields alternative collating sequence 121 length restrictions 95 start position record specification 95 Factor 2 1 character long 96 alphanumeric constants 96 as a keyword record specification 97 comparisons to packed numeric fields 96 comparisons to zoned numeric fields 96 constant 96 end position record specification 96 field length 92 96 field record specification 87 fields alternative collating sequence 121 length considerations 96 length restrictions 96 numeric const
55. entries are Columns Entry Explanation 12 S Specifies the job as a summary sort Data in specified summary data fields will be added together 17 5 Specifies the length of the control field in the output record In this example item number which spans five columns is the control field 18 A Specifies that the output records are to be sorted in ascending order 28 No entry Specifies that the output records are to contain the control field as well as the summary data field 40 72 Comments Comments provide a record of your sort job 56 Sort User s Guide and Reference RECORD SPECIFICATIONS Statement C D Factor 1 Com F Factor 2 Constant o ja pari la E T In t son c Factor 2 gt e if y t Jat Oper t Keyword Kot Number p i y Start End ator o Comments L 4 e n p Position Position r Factor 2 fos u e 2 Field AE I Je c E d 0 Z c Location of JA D EQ NE F of o P LT GT K Start End of 3 4 5 6 r 8 9 10 11 12 13 14 15 16 as 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 j a I c 2 21 E Q Cc I I N C L Uj D E HE t TI Y PLE i j R E C Of R D S f Lt The significant column entries are Columns Entry Explanation
56. equal For example if you are using only the digit portions of characters b k s B K S and 2 position 3 are considered equal This is the number you use in ALTSEQ statements to identify a character that you want to shift to a different order in the sequence Figure 30 Standard EBCDIC Collating Sequence Used When You Compare Only the Digit Portion of Characters Defining an Alternative Collating Sequence When you want the records in your output file to be sorted in an order different from the orders permitted by the standard collating sequences described in the first part of this appendix define an alternative collating sequence To define an alternative collating sequence 1 Header specification Specify one of the following in column 26 the ALTCOLLSEQ column of the header specification e An S to show that the alternative collating sequence applies to the entire control field e An F to show that the alternative collating sequence applies to only parts of the control field 2 Field specifications f only parts of the control field are involved enter an A in column 20 of those field specifications that define the input fields that are to become part of the control field and to which the alternative collating sequence is to apply 120 Sort User s Guide and Reference Specifying an Alternative Collating Sequence for the Entire Control Field To do this 1 Enter S in column 26 of the header specifica
57. field length should also not exceed the lengths specified in Table 10 on page 107 for each data type If the data to be summed is in packed format each digit needs only 4 bits of memory for storage plus another 4 bits to store the sign Be aware that the number in columns 20 through 22 represents units of 8 bit bytes that is each byte represents two numbers in packed format with the last byte representing only one digit and the sign plus or minus for the entire number For example if you specify 3 for the overflow field length you are reserving 24 bits of storage therefore 999 is the maximum number you can store in unpacked format and 99999 is the maximum number you can store in packed format Column 20 Alternative Collating Sequence by Field This column must contain an A for any normal or opposite control field that is to be altered by the alternative collating sequence when column 26 of the header specifi cation contains an F If you specify an alternative collating sequence for a particular field that field will be changed according to the alternative collating sequence specified by ALTSEQ whenever the field is used again as a control field for that record type Columns 23 through 39 Reserved These columns must be left blank Columns 40 through 72 Comments These columns are available for comments Chapter 10 Field Specifications 109 110 Sort User s Guide and Reference Chapter 11 The Comment Specificati
58. following example illustrates the coding required on the field specification to sort into Kanji character dictionary type order The program requires two control fields The example shows the specification entries that generate the control fields when four DBCS characters are contained in the input record Appendix D Sorting Double Byte Character Sets 133 FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow f f i ja Charac Field E lt Tle tT ters Length Lt y l jay E pid p R s jc 1 Number i Start End c b H A Reserved Comments j f C K ols t jl 7 ZL e t Ji ts of D E d i jn e E D P I t ju q 7 N V J u ja 3 Pak 0 U R tijt of F M S e i of F S H T o SEE i 34 5 p ie 9 10 11 12 13 14 15 16 17 18 19 A 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 72 0 0 6 R 2 3 f R S T S E Q U E N C E A 0 0j 7 S 4 9 S R T S E Q U E N C E fet 1 of Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before being used to control the sort 8 R The data field contains a Japanese DBCS control field using radical stroke tie bre
59. how to operate your display station when it is connected to the IBM AS 400 system and running AS 400 software This means knowing about the OS 400 system and the Control Language CL to perform the tasks of Sign on and sign off of the AS 400 system Interact with displays Use Help Enter control commands Call utilities Respond to messages To find out more about control language refer to these IBM AS 400 publications CL Programming SC41 3721 CL Reference SC41 3722 xi If you are new to the AS 400 system and have no knowledge of how it works refer to the System Operation for New Users SC41 3200 Xii Sort User s Guide and Reference Chapter 1 Introduction This chapter contains a general description of the Sort utility and of what you should know when you use it It covers The functions of the Sort utility How to use the Sort utility How to enter the Sort specifications The contents of the source file in which you enter the specifications How to process the specifications Related concepts for using the Sort utility How to know if your sort program runs successfully The Sort utility provides a large range of sorting and reformatting possibilities to copy and merge files or to add information sum data and reference existing records in other files General Description Copyright IBM Corp 1994 Use the Sort utility to sort and reformat records You work with Contr
60. in the input records 13 16 17 End position of the data field in the input records Chapter 5 Sorting Records from a File and Producing Totais 61 Processing These Specifications To process these specifications enter the FMTDTA command with parameters as for any of the examples in the previous chapters For example you could enter Specified on FMTDTA Command Explanation FMTDTA INFILE PROD INVENTRY MONDAY The input records are to be taken from member MONDAY of database file INVENTRY in library PROD OUTFILE PROD NEWORD MONDAY The output records are to be put into member MONDAY of file NEWORD in library PROD SRCFILE TEST EXAMPLE The reformat specifications are taken from SRCMBR EXAMPLE1 member EXAMPLE1 in database file EXAMPLE which is in library TEST The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMTDTA command is entered from a display station The output file looks like the following ITEM NUMBER SELLING PRICE 10012000 6885 20011230 35030 40016210 626 50011230 29300 70015120 424 Overflow occurred Item Selling Number Price _on 62 Sort User s Guide and Reference Example 3 Using an Overflow Field for Summary Data Overflow This situation is the same as in Example 2 Producing Summary Totals Based on Two Input Record Types on page 54 except th
61. input record lengths should be equal If they are different lengths the shorter records may be padded on the right with data from previous longer records e If a device file is specified as the input file the record length defined for the input records should not exceed the physical limitations of the device specified If the record length does exceed the physical limitation of the specified device undesirable results can occur e The record format information given in the specifications is not checked against the system data description associated with each input file except for record length considerations e The Sort utility can process as input files both regular input files and other source files those with the file type SRC Be aware that data management adds 12 bytes of sequence information and data to the front of every record in a source file Thus when using such a file as input the actual data you may want to sort begins at byte 13 Output File The following rules apply to the file containing the output produced by the Sort utility e You must create the output file and member before running the Sort utility The utility checks for the presence of this file and member if neither exists an error message is issued Note The output file in the database can have either a keyed or an arrival sequence access path Depending on the specified application a keyed access path to the output file may be redundant and can cause
62. name parameter 77 specification identifier comment specification 111 field specification 101 header specification 83 record specification 89 specification set name 85 specification sheets definition 151 specifications 5 6 101 comment 111 specifications continued entering no record or field specifications 10 field 5 100 field entered without record specifications 89 force all 103 forms 2 4 forms completing 3 header 5 81 alternative collating sequence 84 column entries 82 comments 85 file name 85 identifier 83 include exclude control field 84 maximum control field length 83 output file type 83 page 83 sort sequence 84 include all 68 omit record 68 optional 6 order 78 processing of 8 record 5 87 AND 89 begin continue record definition 89 blank 89 column entries 87 comments 98 comparison operator 95 constant value for Factor 2 96 data type 91 Factor 1 end position 95 Factor 1 start position 95 Factor 2 end position 96 Factor 2 is a keyword 97 Factor 2 start position 96 OR 90 page 89 101 sequence checking 89 set of 87 specification identifier 89 statement number 89 101 type of Factor 2 data 96 sequence checking 78 sequence number 6 sequencing of 6 storing 5 6 type 83 89 101 111 types of 5 Index 163 speed of processing 11 standard collating sequence 117 start end positions in input records 8 status message System 36 Sort Utility 113 status of job 14 storage auxiliary 13 sort requests
63. number no entry required 3 5 000 999 Statement number no entry required 6 H Identifies this specification as a header specification Identifies this specification as a comment specification 7 12 SORTR Input records are to be sorted in a regular manner SORTRS Input records are to be sorted and summed SORTA Output file is to contain only the relative record numbers of the sorted records record address RA sort 13 14 Blank Reserved 15 17 Blank No control field copy only request 1 256 The maximum control field length 18 Blank Output order is ascending by control field A Output order is ascending by control field D Output order is descending by control field 19 25 Blank Reserved 26 Blank Standard collating sequence is used S An alternative collating sequence is used for the entire control field Use an alternative collating sequence for parts of the specified control field F 27 Blank Reserved 28 Blank The control field is included in the output record X The control field is not included in the output record 29 39 Blank Reserved 40 72 Any entry Comments 73 80 Any entry Program Identification treated as a comment by the system 82 Sort User s Guide and Reference Detailed Description of Each Column Entry Columns 1 and 2 Page You can enter any number from 0 through 99 in columns 1 and 2 for page numbers The pages should be numbered in ascending order Columns 3 through 5 Statement Number These columns
64. of numbers to the base two the binary digits are 0 and 1 2 Involving a choice of two conditions such as on off or yes no Character Generator Utility CGU A function of the Application Programming Tools licensed program that is used to define and maintain user defined double byte characters and related sort information collating sequence The sequence in which charac ters are ordered within the computer for sorting com bining or comparing conditional force The replacement of control field characters before the records are sorted This is done if the control field in the input record contains a partic ular entry control field A field that identifies a record s relation ship to other records such as a part number in an inventory record Control fields determine the order of records in the sorted file DBCS See double byte character set DBCS DBCS code The hexadecimal code 2 bytes in length that identifies a double byte character DBCS font file A system supplied file that holds the 24x24 character images of one of the following groups of commonly used characters 1 Japanese non Kanji and basic Kanji 2 Korean non Hangeul non Hanja Hangeul and a subset of Hanja 3 Traditional Chinese non Chinese and a subset of Traditional primary Chinese characters or 4 all IBM defined Simplified Chinese characters DBCS font table A system supplied table that holds either 24x24 or 32x32 character images of a do
65. of the standard EBCDIC collating sequence and explains how to define an alternative one Standard EBCDIC Collating Sequence This collating sequence is an arrangement of data based on the EBCDIC character set There are variations in the standard collating sequences depending whether you are comparing e Both the zone and digit portions of characters e Only the zone portions of characters e Only the digit portions of characters Figure 28 on page 118 shows the standard collating sequence Figure 29 on page 119 shows the collating sequence when you compare only the zone portion and Figure 30 on page 120 shows the collating sequence when you compare only the digit portion Copyright IBM Corp 1994 117 Figure 28 Standard Collating Sequence 118 Sort User s Guide and Reference Collating Hexadecimal Collating Hexadecimal Sequence Character Value Sequence Character Value 1 blank 40 49 S A2 2 4A 50 t A3 3 4B 51 u A4 4 lt AC 52 v A5 5 4D 53 w A6 6 4E 54 x A7 7 4F 55 y A8 8 amp 50 56 z A9 9 5A 57 co 10 5B 58 A Cl 11 5C 59 B C2 12 5D 60 c C3 13 5E 61 D c4 14 5F 62 E c5 15 minus 60 63 F C6 16 61 64 G C7 17 split bar 6A 65 H c8 18 6B 66 I c9 19 6C 67 DO 20 _ underscore 6D 68 J D1 21 gt 6E 69 K D2 22 6F 70 L D3 23 grave 79 71 M D4 24 7A 72 N D5 25 7B 73 0 D6 26 7C 74 P D7 27 i 7D 75 Q D8 28 7E 76 R D9 29 7F 77 EO 30 a 81 78
66. or field statement last statement of ments one include set record type O b New record type indicated by a blank in column 7 O A Statements that describe the same record type as the previous statement have an A in column 7 Omit OR state H or F Header statement or field statement last statement of ments different include set record types O b New record type indicated by a blank in column 7 O O Statements that describe a different record type than the previous statement have a O in column 7 Omit AND and HorF Header statement or field statement last statement of OR statement include set different record types O b New record type indicated by a blank in column 7 O A Statements that describe the same record type as the previous statement have an A in column 7 O O Statements that describe a different record type than the previous statement have an O in column 7 Note There are no field statements in omit sets Each omit set must be followed by an include or an include all set Column 8 Data Type This column entry tells the Sort utility how to interpret data in the Factor 1 and Factor 2 fields The fields are defined as either alphanumeric or numeric e Alphanumeric fields are composed of characters and in EBCDIC each char acter byte is assumed to be composed of eight bits The first four bits form the zone portion the last four bits form the digit portion e Numeric fields are composed only
67. p SORTRS r Length e Reserved SI rju Reserved Comments t e SORTA v n e vit fed e 1 256 c qle L1 d e d Ee H A i D F X 3 4 5 6 7 8 91011 ia 28 28 12 20 ia ba 24 28282 28 BS 27 a 28 N E S EA A ie H S of R T A 2 A X ferl E Columns Entry Explanation 7 12 SORTA This is a Record Address RA sort the output is to contain only record addresses 15 17 2 The maximum control field length is 2 characters The system will look at the entire control field and sort on the first two columns of that field only 18 A The output records are to be sorted in ascending order A before B 1 before 2 and so on For the ordering of numbers relative to upper and lowercase charac ters and special characters refer to the collating sequences in Appendix C Standard and Alternative Collating Sequences 26 No entry The Sort utility defaults to the standard collating sequence 28 X The output record is not to contain the control field data 44 Sort User s Guide and Reference FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow f i ja Charac Field 7 T le t ters Length be cob y l fa t 7 p ld R s c aaa A e e ju jo t Number Start End c b jn JA Reserved Comments 3 CK o fs t 1 Ly ck Zu r t fi Its
68. record number that the utility sup plies for each work record For sort requests that produce record address RA files as output only the last two items in this list are included in the record that is transferred to the work area 2 Determine the number of records in the work area The number of records in the work area is equal to the number of output records in the output file Both are determined by the number of records selected using either select or omit record specifications from the input file If no select or omit specifications exist all the input records are present in the work area and in the output file For RA output the actual data is not present instead there is a record address entry for each input record 3 Multiply the work record length by the number of work records in the work area to determine how much work area storage is needed for the work records Chapter 1 Introduction 13 4 To this add two million bytes to determine the total work area space needed by the Sort utility For example if you have determined that there are 5 000 work records that are each 150 bytes long the total storage required for the work records is 750 000 bytes The work area would then require 2 750 000 bytes of storage 750 000 plus 2 million If you determine that there are 30 000 work records that are each 500 bytes long the storage required for the work records is 15 million bytes The utility would then require 17 milli
69. required parameter library_name Enter any of the following values or accept the default CURLIB The current library If you have not specified a current library QGPL is used Chapter 7 The Format Data FMTDTA Command 75 LIBL The current library list The system searches this list for the input file The first file it finds with the specified file name is the one it searches for the input records library_name The name of the particular library where the input file and member are to be found member_name Enter any of the following values FIRST The first member of the input file data_file_identifier For diskette files enter one data file identifier per diskette unit file name specified If more than one diskette data file is being specified as the input file the data file identifier must be entered for each member_name For database files enter the name of the member in which the input records are to be found OUTFILE Output file Specifies the library file and member where the output sorted and refor matted records are stored file_name Enter the name of the file You must enter an option for this field library_name Enter any of the following values or accept the default CURLIB The current library If you have not specified a current library QGPL is used LIBL The current library list The system will search this list for the output file The first file it finds with the specified file n
70. table DBCS active sort table The DBCS active sort table for each language contains the active collating sequence of the DBCS characters in that language Every time you update the DBCS master sort table you should update this table as well Note For Korean DBCS characters there is a DBCS active sort table but no DBCS master sort table The active sort table is used to convert Hanja characters to their equivalent Hangeul characters The Data Management SC41 3710 contains more information Coding Considerations for Double Byte Character Sets Although all the columns on the header record and field specifications are avail able for sorting double byte character sets certain combinations may not be valid or may not produce the desired results This section provides you with necessary details unique to coding your specifications to avoid run time errors Copyright IBM Corp 1994 125 HEADER SPECIFICATIONS Page 73 74 75 76 77 78 79 80 Identification Statement T y Number p e H Output Type SORTR SORTRS SORTA 7 8 91011 12 R e s e r v e d 13 14 Maximum Control Field Length 1 256 15 16 17 PAsM520N oF 18 Reserved s1 Reserved Comments ecotec ae lt s0u0n X 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 a N
71. than sorted or reformatted records See Chapter 5 Sorting Records from a File and Producing Totals for exam ples e Copy and merge records from several files into one file See Chapter 6 Copying and Merging Records from Several Files into One for examples How to Use Sort Perform the following steps 1 Fill in the appropriate Sort specifications manually on preprinted forms This step is optional You can begin directly with step 2 2 Use the Source Entry Utility SEU to enter the specifications into a source file 3 Use the Format Data FMTDTA command to process the specifications You do this by entering the CL command FMTDTA followed by the appropriate options Figure 1 shows these steps and also gives the order of the specifications in the source file Figure 2 on page 3 shows what happens when you use the FMTDTA command to process a source file 1 Optional Enter Sort specifications onto preprinted forms 2 Use SEU to enter specifi cations into a source file header specification ALTSEQ specifications record specifications field specifications comment specifications 3 Use FMTDTA to process the source file Figure 1 Steps in Using Sort 2 Sort User s Guide and Reference Input file contains records to be sorted and reformatted CL command FMTDTA plus parameters Source file controls the sorting and contain
72. the Sort utility to run more slowly e The sum of the field lengths specified for each record in the output file should be consistent with the record length of the output file If the reformatted record length is less than the output file record length the file will contain left justified data and will be padded on the right with blanks If the reformatted record length is greater than the output file record length the output record will be truncated on the right to the file record length e The data description of the output file though not used by the Sort utility becomes the data management view of the output data The string of data constructed by the utility should correspond to this associated data description e Normal AS 400 security is enforced for the output file You must have the proper authority to clear and write into the file and member Chapter 1 Introduction 11 e The Sort utility defaults to a shared update lock on the output file If you want to restrict other users access to the output file while the utility is running you must override the locked state with the ALCOBJ command This command must be issued before the FMTDTA The DLCOBJ command can be used to return the output file to its prior locked state e The names of the output file and member are specified by FMTDTA The utility opens this file name and member although you can use an override command to redirect the output to a different file Note The s
73. the System 38 Conversion Reformat Utility Record and Field Specifications The AS 400 will not accept a minus sign in the last position of a numeric constant denoting a negative value ending with zero It should be replaced by the symbol or zero followed by a minus sign Running an AS 400 Sort Job in the System 38 environment or on a System 38 Copyright IBM Corp 1994 You can run a Sort job in the System 38 environment of the AS 400 system or on a System 38 If you do the latter however you should be aware of the following e The maximum control field length in the AS 400 system is 256 bytes in System 38 it is 248 e Although you can still use the terms RAF and FILE AS 400 Sort uses SORTA in place of RAF and SORTR in place of FILE e f you enter the coding specifications in the AS 400 system but run them in System 38 environment make sure your coding specifications conform to those for System 38 In particular the following AS 400 Sort features are not sup ported in System 38 Summary Sort DBCS Sorting Selected Alternative Collating Sequences 115 116 Sort User s Guide and Reference Appendix C Standard and Alternative Collating Sequences By default the sorted output records are ordered according to the standard EBCDIC collating sequence However you can change this sequence for all or some characters by specifying an alternative collating sequence This appendix provides examples
74. unique control field value Summary Data Field Enter one or more field specifications to define the data items that are to be summed Column 7 must contain S The corre sponding summary data fields from all input records will be added together and the total placed in the summary output record Copyright IBM Corp 1994 47 A summary output record may contain data fields that are not summary fields These fields are defined using a field specification with D in column 7 The fields will contain data copied from the first input record processed for each unique control field value If two or more input record types are specified for a summary sort each record type must have at least one summary data field defined When specifying a summary sort with multiple record types you should consider whether the control fields specified will allow records of different types to share an identical control field value and if so whether it is appropriate to add together the corresponding summary of data fields from the different record types Handling Overflow If the totals are larger than the size allowed by the original summary data fields the system puts only the lower order digits into the summary field The higher order digits are lost and the system gives no indication that this has happened For example if the total is 1 324 567 and the summary data field is only four charac ters long the output record will contain only the last four
75. 0 U R t t F M S e i E F S H T o Lb 34 5 6 5 f 9 10 11 12 13 14 15 16 17 18 1 a 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s 72 0 0 3 F N J 2 9 S R T S E Q U E N C E feo 1 of f 1 of Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before it is used to control the sort 8 J The data field contains a Japanese DBCS control field using single pronunciation stroke radical tie breaker sequence 9 12 2 The data field begins in column 2 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Identifies the sort as a telephone book type 132 Sort User s Guide and Reference Japanese Word Dictionary Sorting Example The following example illustrates the coding required on the field specification to sort in Japanese word dictionary type order The program requires two control fields The example shows the specification entries that generate the control fields when four DBCS characters are contained in the input record FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow y i ja Charac Fi
76. 0 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 X N 1 6 M N 0 F I E L D L ani a a nlo ololol o 0 5 0 6 0 41 I T D E s U s U vilrl ul m Nn 9 Cc F E D 5 5 PI EY Fl Ij ELD 8 p D R F EC SRN RN RR RR RRR RRR RR BR S S RRS These four specifications define four data fields to be taken from each input record of this type The contents of the first specification are Columns Entry Explanation 7 9 12 13 16 40 72 The field is to be treated as a data field meaning that the unchanged data from the input record is to be transferred to the output record The system looks at the data in this field as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit This data field begins in column 1 of the input record This control field ends in column 6 of the input record This selects the data from the ITEMNO field corresponding to the original data definition for the input records This is also the same as the control field used for sorting The data is used sepa rately to control the sort and then respecified as data This allows more flexibility Control data can be altered before
77. 0011230 29300 70015120 424 Item Selling Ov Number Price fl 1 89 13 14 Figure 16 The Output Showing the Overflow Character Notice that the system has expanded the output record by one column and placed an asterisk into this column to indicate that the record with item number 20011230 has a summary data field with an overflow value 66 Sort User s Guide and Reference Chapter 6 Copying and Merging Records from Several Files into One If you do not specify any sorting of records the Sort utility can be used to simply copy the data from one or more input files into a single physical file in the data base The data is placed in the output file in the same sequence as it is found in the input file no reordering is done See Figure 17 If the output file already contains records they are not cleared before the input records are copied The input records are added to the end of the file Sort utility specifications from source file Input records from up to eight files The FMTDTA __ _ Database files or Device Command logical or physical files Output records copied or merged possibly reformatted but not sorted into one physical file Figure 17 Copying or Merging One or More Files into One Physical File The output is a physical file in the database meaning that the output file contains a sorted and reformatted copy of the act
78. 12 P packed control field 106 numeric fields 91 zoned numbers sign placement 94 packed decimal format definition 150 padding output records with blanks 102 padding with zeros 4 with blanks 7 parameters FMTDTA command 8 75 physical file as output 17 35 67 multiple input 35 physical file continued single input 17 with physical output file 17 35 67 with record address file output 41 positioning record specifications 89 101 positioning specifications in source file 83 print file 12 description 12 name parameter FMTDTA command 77 number of 10 specifying on FMTDTA command 12 print option System 36 Sort Utility 113 printer 10 device file 77 file QSYSPRT 77 files 10 system 12 printing error warning messages 78 printing messages 15 problems 14 processing 10 a Sort job 3 speed 11 time saving 102 producing totals 47 program date parameter 78 program date record specifications 98 program status message System 36 Sort Utility 113 pronunciation Korean 142 Q QFMTMSG file 15 QFMTSRC file 9 77 QFMTTXT file 15 QSYSPRT file 12 77 R RA file 1 adding records 42 automatic updating 42 changes to input file 1 changing records 42 deleting records 42 including data fields 42 omission of control field 83 record length 13 sorting 41 radical sequence Japanese 129 radical Simplified Chinese 135 radical Traditional Chinese 139 RAF 115 read in arrival sequence 11 reading sequentially 41 Record Addr
79. 2 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 Sa ie F N C 1 6 A C C N 0 Ij S CHE F I Ef L D f F FIC 7 7 M 1 I F M O N D A Y u S E 1 f y Fy FIC 7 7 T 2 X I F T U E S D Al Y Uj S E 2 f i F FIC 7 7 W 3 X EnF W E D N E S D A Y Uj S E 3 f i Fy FIC 7 7 R 4 X I F T H U R S D A Y U S E 4 f F F C 7 7 F 5 X I F F R I D A Y WSIE 5 y Fi FIC 6 X uj S E 6 F 0 R y A N Y T H I N G E L S E f 1 4 7 fs of These field statements define the source fields that are used to make up the control field The first specification defines the input field that is to become the first part of the control field and the next six all pertain to what is to form the last part of the control field The significant column entries are Columns Explanation 7 The first field specification is for a normal control field The remaining six specifications contain an F and describe a forced control field 9 12 The start position of the field in the input record from which the data for the control field is taken Data from columns 1 through 6 of the input record forms the first part of the control field data from column 7 forms the last part 13 16 The end position of the field in the input record from which the data for the control field is taken 17 The value in this column identifies the character which if found in the input rec
80. 2 43 44 45 46 47 48 49 50 51 52 53 54 55 1 72 H S O R T R S 8 A S O R T I N T R A N S 1 4 S U M M A R I Z E Alt a T Y PLE I T E M S y 1 The significant column entries are Columns Entry Explanation 12 S Specifies the job as a summary sort Data in specified summary data fields will be added together 17 8 Specifies the length of the control field in the output record In this example item number which spans eight columns is the control field 18 A Specifies that the output records will be sorted in ascending order 28 No Entry Default Specifies that the output records are to contain the control field 48 72 Comments Comments provide a record of your sort job Chapter 5 Sorting Records from a File and Producing Totals 51 RECORD SPECIFICATIONS Statement C D Factor 1 Com F Factor 2 Constant f i o ja pari a U of T In t son c Factor 2 gt e 4 y t aT Oper t Keyword r S i Number p i y Start End ator o Comments E e n p Position Position r Factor 2 gt e is ff uje 2 Field Pod I Je jc ln i 0 Z c Location A D EQ NE F Ld o jP LT GT K Start End L 4 3 4 5 6 5 ng 9 10 11 12 13 14 15 16 Ti 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
81. 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 X N o 5 1 2 c Of N T R OF L FI I ETE D 3 1 7 1 0 D A T A FII ELLID AE N A E E E E E T SN RN RN RR RR RR g RRR RRR RRR Figure 14 The Field Specifications for Record Type R from Example 2 The additional column entries for the summary data field specification are Columns 20 22 Entry Explanation Gives the length of the overflow field By entering a value into this field you auto matically increase the size of this summary data field to 10 columns All other entries are the same as for Example 2 Chapter 5 Sorting Records from a File and Producing Totals 63 Processing These Specifications FMTDTA processes the job as in Example 2 Producing Summary Totals Based on Two Input Record Types on page 54 The output file however looks like ITEM NUMBER SELLING PRICE 10012000 6885 20011230 135030 40016210 626 50011230 29300 70015120 424 Item Overflow Selling Number Area Price 1 89 13 14 18 Figure 15 The Output File Produced in Example 3 Note that the larger summary data field can now accommodate the total value for item number 20011230 Example 4 Using an Overflow Indicator for Summary Data Overflow There may be times wh
82. 42 43 44 45 46 47 48 49 50 51 52 53 54 55 0j oj 1 P A C K E D 1 5 8 E Q 2 M U N P A C K m D 2 4 8 P 1 2 E Q U U alele 1 1 1 6 E Q 1j U N P A C K m D 1 6 WN NN NN SN NNN NNN NNN Figure 25 Examples of How to Code Negative Constants into Record Specifications Columns 20 through 39 Factor 2 Is a Keyword A K entered into column 19 identifies Factor 2 as a keyword that represents all or part of the program date The keyword is entered into columns 20 through 39 starting with column 20 Unused columns should be left blank When Factor 2 is a keyword Sort compares all or part of the program date with the Factor 1 field The length of the Factor 1 field must be the same as the Factor 2 field You can use the following keywords Keyword Part of Program Date Factor 1 Field Length Compared UDATE Entire program date 6 characters UMONTH Month portion of program date 2 characters UDAY Day portion of program date 2 characters UYEAR Year portion of program date 2 characters Chapter 9 Record Specifications 97 When Factor 2 is a keyword you must indicate that both the zone and digit portions of characters must be compared to the Factor 1 field by entering a C into column 8 to specify character dat
83. 44 45 46 47 48 49 50 51 52 53 54 55 a I Cc 2 2 E Q C A I N C L U D E Alt oel 7 z R E C Of R D S y 1 The significant column entries are Columns Entry Explanation 6 I Specifies that the records described in this specification statement should be included in the sort as opposed to omitted from the sort 8 c Identifies the data for Factor 1 and 2 as character data The sort program will look at both the zone and digit portions of each byte when comparing Factor 1 with Factor 2 9 12 No entry The start position of the Factor 1 field is the same as the end position 13 16 2 The end position of the Factor 1 field 17 18 EQ Specifies that the data in Factor 1 of each record must equal Factor 2 for the record to be selected for sorting 19 C Specifies that Factor 2 is to be a constant and equal to the value entered into columns 20 through 39 of this record specification 20 39 A This is the constant value for Factor 2 Two field specifications are used The first defines the control field the second defines the data field to be summed the summary data field 52 Sort User s Guide and Reference FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow ila Charac Field E TjejtT ters Length L 4 y jl jay on VEN
84. 60 The number must be equal to or greater than the sum of the longest control field as specified in the field specifications Control fields are composed of one or more fields taken from the input records A different grouping can be specified for each input record type The entry in this field must equal or exceed the length of the largest grouping Copy Only Request If columns 15 through 17 are left blank no sorting or reformatting occurs This is equivalent to specifying that records are to be copied or merged only as described in Chapter 6 Copying and Merging Records from Several Files into One Chapter 8 The Header Specification 83 Column 18 Sort Sequence The entry in this column specifies how the output records are to be sorted Pos sible entries are Blank Ascending order A Ascending order D Descending order Note For copy only requests this column must be left blank The sorting of input records is based on the contents of the control field for the record type Input records are sorted according to this order unless this order is overridden by the field specifications for the particular control field Columns 19 through 25 Reserved These columns must be blank Column 26 Alternative Collating Sequence Column 26 defines whether the standard or alternative collating sequence is used See Appendix C Standard and Alternative Collating Sequences The possible entries are Blank Standard collating
85. 8 33 ADJUSTMENT RECORDS RECORD CODE ITEM NUMBER ADJUSTMENT CODE QUANTITY ORDERED TRANSACTION DATE WAREHOUSE A 10012000 1 1 880816 2 A 20011230 1 6 880812 2 A 20011230 1 5 880816 3 A 40016210 2 4 880816 1 A 30010010 1 2 880816 1 1 of DELETE RECORD ITEM ADJUSTMENT QUANTITY TRANSACTION WAREHOUSE CODE CODE NUMBER CODE ORDERED DATE 1 of 1 2 3 10 11 12 17 18 23 24 25 Figure 12 The Input File Used in Example 1 Contains Three Different Record Types According to the Original Data Description for the File Entering the Specifications To sort this file enter the following header record and field specifications Only those columns that are important to this example are described 50 Sort User s Guide and Reference HEADER SPECIFICATIONS LY 2 73 74 75 76 77 78 79 80 Page Program Identification fy of Statement R s A RO t A A Output Type e Maximum e 1 eju T s Control q tC s t iy y SORTR e Field u o elp Number p SORTRS r Length e Reserved SI rju Reserved Comments ie e SORTA v n e vit L1 e 1 256 c qle 7 d e d H A s f i D F X 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 4
86. A Command There are two ways of accessing and running the FMTDTA command From a CL prompt display or a command menu To access the FMTIDTA prompt displays type FMTDTA on a command line and press F4 Alternatively you can select FMTDTA from a command menu Enter the appropriate param eters and press Enter to process the sort job e Asa line command f you are familiar with both the CL command language and with the FMTDTA command and its parameters you can type the FMUTDTA command with its parameters on a command line and press Enter to process the command File Naming Conventions When identifying files and members in the system you must use the appropriate convention For example LIBRAR1 FILE1 MEM3 identifies member MEM3 of file FILE1 in library LIBRAR1 If you do not specify a member the system defaults to the first member in a file If a file contains no members then the whole file is considered as one member Copyright IBM Corp 1994 73 Syntax of the FMTDTA Com mand The syntax you use when entering the FMTDTA command as a line command is shown below Job B Pgm B REXX B Exec gt gt FMTDTA INFILE L CURLIB a library name xFIRST file name t diskette file identifier L _ gt membe r name gt L1BL _ library name CURLIB gt OUTFILE gt FIRST fi le name ember name
87. A command see Chapter 7 The Format Data FMTDTA Command to check for out of sequence conditions in the Sort specifi cation set Note Alternative collating sequence ALTSEQ statements are not sequence checked but must immediately follow the header statement Column 6 Specification Identifier This column must contain an F to identify this specification as a field specification If it contains an instead the specification will be treated as a comment Column 7 Field Type The entry here specifies the type of field If the field is a forced control field the way in which the control field is changed forced is further defined in columns 9 through 19 The possible entries into column 7 are D N Data field Normal control field Input records of the type described in the corre sponding set of record specifications are sorted so that the data in this field is in the sequence specified in column 18 of the header specifica tion Chapter 10 Field Specifications 101 0 Opposite control field Input records of the type described in the corre sponding set of record specifications are sorted so that the data in this element of the control field is in the sequence opposite to that specified in column 18 of the header specification F Forced control field Before any sorting is to be done the contents of the control field must be altered according to the entries in columns 9 through 16 17 18 and 19 S Data f
88. Characters can be ordered by the number of strokes used to write the character by the total number of strokes or by the number of strokes excluding the radical Single pronunciation Characters can be ordered by the phonetic sound they have when pronounced Pronunciations can be either user defined or defined by IBM and are represented by Katakana Appendix D Sorting Double Byte Character Sets 129 Character type Characters can be ordered into one of the following character type sequences e Special characters e Alphabet e Russian e Greek e Katakana e Hiragana e Arabic e Roman e Kanji Tie breaker The tie breaker is one or more Katakana characters used to repre sent any alternative pronunciation of IBM supplied characters only In DBCS sorting tie breaker is a value based on the sequence position of phonetic charac ters that determines the output order of DBCS characters that otherwise compare equal DBCS Code Sequence lf all the sort criteria are the same for any two DBCS characters in sequences 1 through 4 in Figure 32 on page 129 then the charac ters will be ordered based on their internal hexadecimal representations Sei On Katakana Sequence Characters are a combination of single pronunciation Kanji characters Also the equivalent pronunciations of voiced sound semi voiced sound long sound and Katakana small sound are used The following example shows the pronunciation and sort sequence Mean
89. Code ALTSEQ into columns 1 6 to tell the Sort utility that you want to change the standard collating sequence 2 Leave columns 7 8 blank 3 Enter the hexadecimal equivalent shown as X HX in the figure of the char acter you are taking out of its normal sequence into the next two columns 4 Enter the hexadecimal equivalent shown as X HY in the figure of the value that the character specified is to assume into the next two columns 5 Enter as many pairs of original and new hexadecimal values each occupying four columns as required Leave no spaces between sets of hexadecimal numbers 6 When you reach the end of one specification column 96 you can continue entering more pairs of hexadecimal values in a new ALTSEQ specification Repeat steps 1 to 5 7 Do not code comments on an ALTSEQ line Note When you move a character into the sequence position normally assigned to another character both the new and the original character occupy the same position and are considered equal The system does not know which character should precede the other and therefore does not sort these two characters If you do not want the two characters to be equal you must also move the character that normally occupies that position See the examples later in this appendix Examples The following examples describe two situations that involve using an alternative col lating sequence Example 1 Inserting a Special Character between Tw
90. IBM Application System 400 Sort User s Guide and Reference Version 3 tl SC09 1826 00 Note Before using this information and the product it supports be sure to read the general information under Notices on page ix First Edition September 1994 This edition applies to the IBM AS 400 Operating System 400 licensed program Program 5763 SS1 Version 3 Release 1 and to all subsequent releases and modifications until otherwise indicated in new editions Make sure you are using the proper edition for the level of the product Order publications through your IBM representative or the IBM branch serving your locality Publications are not stocked at the address given below A form for readers comments is provided at the back of this publication If the form has been removed you may address your comments to IBM Canada Ltd Laboratory Information Development 2G 345 1150 TOR 1150 Eglinton Avenue East North York Ontario Canada M3C1H7 You can also send your comments by facsimile attention RCF Coordinator or you can send your comments electronically to IBM See Communicating your Comments to IBM for a description of the methods This page immediately precedes the Readers Comment Form at the back of this publication When you send information to IBM you grant IBM a non exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation t
91. IFICATIONS Statement F D Field Location Forced Overflow f i ja Charac Field et T Je t T ters Length Et y jl jay ft pid p R s c od Number i S Start End b i A Reserved Comments j i C K ols t jl 4 ZL r t Ji ts DE if D E d i jn e fe of D P I t ju q of N V J u ja s of 0 U R tijt dof F M S e i eh F S H T o l 34 5 Re 5 y 9 10 11 12 13 14 15 16 17 18 1 Boek 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 j 72 F N C 1 6 I T E M N 0 Ij s N O R M Af L n F 0j U 215 2 9 A S C E N D I N G a Q T R T O T A L I S delelolsialtle 1 of These two specifications establish the control field for this record type The con tents of the first specification define the first part of the control field and are Columns Eniry Explanation 7 N The control field data is to be treated as a normal control field This means that the unchanged data from the input record is to be used and that the sort sequence is to be that specified in the header specification ascending 8 c The system looks at the data as character data Each group of 8 bits is assumed to represent a character which can be a letter of the alphabet a symbol or a digit 9 12 1 This control field data begins in column 1 of the input record 13 16 6 This control field data ends in column 6 of the input record This selects the data from the ITEMNO field corr
92. Japanese non Kanji set basic Kanji set extended Kanji set and up to 4 370 user definable characters Japanese non Kanji character set A subset of the Japanese DBCS consisting of non Kanji characters like Greek Russian Roman numeric alphanumeric and related symbols Katakana Hiragana and special symbols There are 550 characters in this set Kanji Chinese characters used in Japanese written language Katakana A native Japanese character set that is used to write foreign words phonetically in Japanese Contrast with Hiragana Korean double byte character set An IBM defined double byte character set for Korean consisting of Korean non Hangeul non Hanja set Hangeul set Hanja set and up to 1 880 user definable characters Korean Hangeul character set A subset of the Korean DBCS consisting of 2 369 Hangeul characters and 52 Jamo characters Korean Hanja character set A subset of the Korean DBCS consisting of 4 500 Hanja characters Korean non Hangeul non Hanja character set A subset of the Korean DBCS consisting of non Hangeul non Hanja characters such as Greek Russian Roman numeric alphanumeric and related symbols Katakana Hiragana and special symbols There are 398 characters in this set master sort table A system supplied table that con tains sort information required for sorting double byte characters This table is maintained by the character generator utility function of the Application Development
93. PROD TRANS MONDAY PROD TRANS TUESDAY PROD TRANS WEDNESDAY PROD TRANS THURSDAY PROD TRANS FRIDAY OUTFILE PROD TMERGED MONDAY Explanation Specifies the five input members from file TRANS in library PROD The output records are to be put into member MONDAY of file TMERGED in library PROD The specifications are automatically taken from the first member of file QFMTSRC default source file in the library list The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMTDTA command is entered from a display station Chapter 3 Sorting Records from Several Files 39 40 Sort User s Guide and Reference Chapter 4 Sorting Records from a Single File to Produce a Record Address File The Sort utility can sort but not reformat records selected from a single physical file and produce a Record Address RA file that reflects the new order See Figure 10 specifications from source file Sort utility The Input records from a single FMTDTA physical database file Command Output RA file containing sorted addresses of input Refer addresses records back to input file Figure 10 Sorting a Physical File into an RA File The output is an RA file in the database An RA file is a physical file that contains 4 byte binary relative record numbers rather than data The out
94. R E Q U A L 8 9 1 0 0j 7 of i This set of record specifications defines a new record type The record specifica tions are interspersed with comment specifications to help explain the input record selection criteria The column entries for the first record specification in the set are Columns Entry Explanation 6 I The input records that meet the conditions specified in this set of input record specifications are to be included in the output 7 No entry This specification is the first of the set of record specifications that is to define this type of record 8 C The data in the Factor 1 and Factor 2 fields of each input record is to be inter preted as character data Each group of 8 bits represents a character 9 12 79 The Factor 1 field begins in column 79 of the input record 13 16 80 The Factor 1 field ends in column 80 of the input record 17 18 EQ The data in the Factor 1 field must be equal to the data in the Factor 2 field for the input record to be selected for sorting 19 c The data in the Factor 2 field is to be the constant specified in columns 20 through 39 of this record specification 20 39 1Q The constant value of the Factor 2 field is IQ The IQ in columns 79 through 80 of the input record identifies this record as a QTRSALES record 40 72 Comments Identifies the specified
95. S H T o f x B njA 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 43 44 45 46 47 48 49 50 51 52 53 54 3 172 FINIE 5 1 2 C O N T R Of L FIE EJL D y f F S U Ua 1 7 D A T A Fy I EEND l FISi y PHONT T I N Oj U T P U T l f I F Oj V E R F L Of w y 1 f A new field specification is added to provide the overflow indicator The significant column entries are Columns Entry Explanation 7 S Identifies the field as a summary data field The data in this field is to be summed 8 V Force a data character constant into the data field 9 12 No Entry Leave this part of the field specification blank 13 16 No Entry Leave this part of the field specification blank 17 Provides the overflow indicator Note If overflow occurs in any of the summary data fields the character in column 17 will be written into the overflow indicator field If overflow occurs and no overflow character is identified column 17 is blank the system will set the overflow indicator to an asterisk Chapter 5 Sorting Records from a File and Producing Totals 65 Processing These Specifications This job is processed like Example 2 Producing Summary Totals Based on Two Input Record Types on page 54 The output file contains the following entries ITEM NUMBER SELLING PRICE OVERFLOW 10012000 6885 20011230 35030 40016210 626 5
96. S E2 31 b 82 79 T E3 32 c 83 89 U E4 33 d 84 81 V E5 34 e 85 82 W E6 35 f 86 83 X E7 36 g 87 84 Y E8 37 h 88 85 Z E9 38 i 89 86 0 FO 39 j 91 87 1 F1 40 k 92 88 2 F2 41 il 93 89 3 F3 42 m 94 90 4 F4 43 n 95 91 5 F5 44 o 96 92 6 F6 45 p 97 93 7 F7 46 q 98 94 8 F8 47 r 99 95 9 F9 48 tilde Al Only Zone Portion of Character Used Only Zone Portion of Character Used Only Zone Portion of Character Used Order in Corresponding Order in Corresponding Order in Corresponding the Hexadecimal the Hexadecimal the Hexadecimal Sequencex Character Number Sequencex Character Number Sequence Character Number 1 blank 40 con t f 86 9 DO lowest 4A g 87 J D1 4B h 88 K D2 lt 4c i 89 L D3 4D M D4 4E N D5 4F 6 j 91 0 D6 k 92 P D7 2 amp 50 1 93 Q D8 5A m 94 R D8 5B n 95 D9 5C o 96 5D p 97 5E q 98 5F r 99 10 E0 S E2 3 minus 60 F 4 T E3 61 U E4 split bar 6A 7 tilde Al v E5 5 6B s A2 W E6 6C t A3 X E7 is 6D u A4 Y E8 underscore v A5 Z E9 gt 6E w A6 6F x A7 y A8 11 0 FO 4 grave 79 z AQ highest 1 Fl 7A 2 F2 7B 8 co 3 F3 7C A C1 4 F4 5 7D B c2 5 F5 apostrophe c c3 6 F6 7E D c4 7 F7 7F E c5 8 F8 F C6 9 F9 5 a 81 G C7 b 82 H c8 c 83 I c9 d 84 e 85 Characters sharing the same position in the sequence are considered equal For example if you are using only the digit portions of charact
97. T o of x B n JA i 3 4 5 6 7 8 910 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 s i i F N C 5 1 2 C 0 N T R OF L F I E L D a 7 F S U 1 3 1 7 D A T A FIH EpL D AEE i s Lf 7 LS Sf The significant column entries are Columns Entry Explanation 7 N Identifies the field as a normal control field The control field data is not to be forced altered before being used to control the sort 8 C Specifies that Sort is to interpret the data in the control field as character data where both the zone and digit portions of each byte are compared 9 12 5 Start position of the control field data in the input record 13 16 12 End position of the control field data in the input record The significant column entries for the summary data field specification are Columns Entry Explanation 7 S Identifies the field as a summary data field The data in this field is to be summed 8 U The data in this field is to be interpreted as numeric data in unpacked format each digit is represented by both the zone and digit portions of the byte with the zone portion of the last byte determining the sign positive or negative for the entire number 9 12 13 Start position of the data field
98. X The control fields are not to be included in the output record Chapter 2 Sorting Records from a Single File 23 RECORD SPECIFICATIONS Statement C D Factor 1 Com F Factor 2 Constant f y o ja pari a A T In t son c Factor 2 gt e Le pt y t aT Oper t Keyword Fief Number p i y Start End ator o Comments P AE 4 e n p Position Position r Factor 2 gt e l t u e 2 Field 7 I Je c AE 0 Z p Location Et JA D EQ NE F Pooh o P LT GT K Start End te if 3 4 5 6 5 ng 9 10 11 12 13 14 15 16 Tae i 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 B 72 I Cc 7 9 8 0 E Q C I M i I N C L U D E Valelmcal eleloels E 5 R E C Of R D c 0j L 7 9 I fy A N D c Oj L 8 0j M f f e 1 of 4 fe mls Columns Entry Explanation 6 I The input records that meet the conditions specified in this set of input record specifications are to be included in the output 7 No entry The first of the set of record specifications that is to define this type of record 8 c The data in the Factor 1 and Factor 2 fields of each input record is to be inter preted as character data Each group of 8 bits represents a character 9 12 79 The F
99. a If UDATE is used the program date must be in the same format as the date con tained in the input records If Factor 2 is UDATE then record selection on or before or on or after a certain date determined by the comparison operator entered into columns 17 and 18 works only with the international date format YYMMDD If the program date and the input records date are not in the international date format the keywords UYEAR UMONTH and UDAY should be used to select the records The program date parameter of the FMTDTA command see Chapter 7 The Format Data FMTDTA Command provides the date month day and year that will be used Columns 40 through 72 Comments These columns are available for comments 98 Sort User s Guide and Reference Chapter 10 Field Specifications Field specifications define the fields in the input record These can be control fields data fields and summary data fields Control fields are used to control the way in which the input record is sorted and reformatted as described in Chapter 1 Introduction Data fields identify those fields that contain data to be summed see Chapter 5 Sorting Records from a File and Producing Totals or fields that appear in the output records Summary data fields are fields in the output record that contain the totals that are produced You can enter one or more field specifications for each field A series of field specifications must b
100. a File with a Single Input Record Type This example takes the records from a file INVENTRY and puts the sorted output records into a physical file NEWORD The fields that are identified by the sort spec ifications correspond to those that were originally defined for the records The Sort utility looks for only one type of input record Records are selected by comparing the INSTOCK field columns 69 through 74 with the REORDER field columns 40 through 45 of the input record If the INSTOCK field is less than the REORDER field the record is selected for sorting and included in the output file Copyright IBM Corp 1994 17 The records are sorted in ascending order based on the control field The control field is composed of the input fields TYPENO columns 1 and 2 and ITEMNO columns 3 through 8 The output records are to contain six rearranged data fields one of which is the control field Note that once the control field is used for sorting if it is to be included in the output record it is treated as a data field Entering the Specifications Enter the following header record and field specifications Only those columns that are specific to this example are described below HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification Statement Maximum
101. acked format Sort reads the digit portion of each set of eight bytes up to and including the last byte This determines the number in the field Sort also reads the zone portion of the last byte The value in that portion determines whether the number is to be positive or negative Table 5 shows the binary representation of the ten digits Figure 24 shows some examples of packed and zoned numbers and their signs Chapter 9 Record Specifications 93 2049 2 0 4 9 Positive 111 1 0 0 1 o 1 let 1 0 0 0 o 1 ae OSS h 1 610 o 111 1 1060601 1 i 1 1 Zone Digit Zone Digit Zone Digit Zone Digit Sign Zoned lt Unpacked 2049 2 0 4 9 Negative 1 1 1 1 6 0 1 0 1 11 1 6 oJ1 11 1 60 16 0 1101 1001 g 1 1 i i Zone Digit Zone Digit Zone Digit Zone Digit Sign 2049 2 0 4 9 f l LT l bea i Ly 1 Positive 0 0 0 0 0 0 1 0 0 0 0 0 0O 1 0 0 1 0 0 1 L i l Digit Digit Digit Digit Digit Sign Packed lt 2049 2 4 9 f l 1 f l 1 f l 1 f 1 Negative o o o ojo o 1 ojo o o ojo 1 6 0 1 1 1 1 0 1 g Digit Digit Digit Digit Digit Sign Figure 24 Sign Placement in Packed and Zoned Unpacked Numbers Interpreting the Sign of a Number Numbers can be either positive or negative The sign of a number is indicated by a 4 bit binary code as shown in Ta
102. actor 1 field begins in column 79 of the input record 13 16 80 The Factor 1 field ends in column 80 of the input record This selects the data from the ITEMASTER field corresponding to the original data definition for the input records 17 18 EQ The data in the Factor 1 field must be equal to the data in the Factor 2 field for the input record to be selected for sorting 19 c The data in the Factor 2 field is to be the constant specified in columns 20 through 39 of this record specification 20 39 IM The constant value of the Factor 2 field is IM The IM in columns 79 through 80 of the input record identifies this record as an ITEMASTER record 40 72 Comments Identifies the specified columns The record specification is followed by two comment specifications identified by the asterisk in column 6 24 Sort User s Guide and Reference FIELD SPECIFICATIONS lf Statement F D Field Location Forced Overflow AE i i fa Charac Field Eo T Je t T ters Length oo y ll fay TRES DE Sa L d p d p R S G Lee e e elu jo bof Number Start End c b jn JA Reserved Comments AES C K ofs jt ji ai ZL rit fi fts Anes D E d i n e Lod D P I t u q 7 N V J u a 7 0 U R t t Lay F M S e i Look F S H T o D x B n A gt i 3 4 5 6 7 8 9 10 1112 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 43 44 45 46 47 48 49 50 51 52
103. ains a D and position 55 contains an X or if position 62 contains a G and position 55 contains an X 8 c Character data is used for the comparisons 15 16 62 55 Identify which fields in the input record are to meet certain conditions 17 18 EQ The condition is that the value found in those fields must be equal to the Factor 2 field 19 c The value of the Factor 2 field is to be a constant 20 D X G The constant value is to be a D X or G respectively The last record specification is an include all statement meaning that the only entry on that record specification is the sequence number and the I in column 6 This causes all the records not omitted by the omit specifications to be included in the copy Chapter 6 Copying and Merging Records from Several Files into One 69 FIELD SPECIFICATIONS Statement Field Location Forced Overflow T aston aera vox Number Start Husem ra ovk anozo Br ZCHVOND 3 4 5 6 7 8 9 10 11 12 Charac Field ters Length R S End A Reserved Comments asono macan SHOE o n t i n u j q a t i o n 1 13 14 15 16 17 18 SSNS NNN RS RRR A 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 I N C L U D E A L L I N P Uf T
104. aker sequence 9 12 2 The data field begins in column 2 of the input record 13 16 3 The control field ends in column 3 of the input record 40 72 Comments Identifies the radical stroke tie breaker sequence The following describes the column entries that differ on the second control field Columns Entry Explanation 8 S The data field contains a Japanese DBCS control field using stroke radical tie breaker sequence 9 12 4 The data field begins in column 4 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Identifies the stroke radical tie breaker sequence 134 Sort User s Guide and Reference Sorting Considerations for Simplified Chinese Double Byte Character Sets Simplified Chinese double byte characters can be sorted into the following seven different sequences _ Character type total strokes radical DBCS code sequence Character type radical strokes beyond radical DBCS code sequence 3 Character type single pronunciation radical total strokes tie breaker DBCS code sequence 4 Character type single pronunciation total strokes radical tie breaker DBCS code sequence 5 Character type single pronunciation tie breaker radical total strokes DBCS code sequence 6 Character type total strokes radical single pronunciation tie breaker DBCS code sequence 7 Character type N Figure 33 Simplified Chinese Character Sequences Character Type Different c
105. ame is the one into which it will put the output records library_name The name of the particular library where the output file and member are to be found member_name Enter any of the following values or accept the default FIRST The first member of the output file is to contain the output records member_name Enter the name of the member into which the output records are to be put 76 Sort User s Guide and Reference SRCFILE Source file name Specifies the library and file where the specifications for this sort job are to be found The possible values are QFMTSRC An IBM supplied source file source_file_name Enter the name of a particular source file library_name Enter any of the following values or accept the default LIBL The current library list The system searches this list for the source file The first file it finds with the specified file name is the one that it attempts to process for instructions CURLIB The current library If you have not specified a current library QGPL is used library_name The name of the particular library where the source file and member are to be found SRCMBR Source member name Specifies the name of the member in which the source specifications are to be found Enter any of the following values or accept the default FIRST Sort searches for the sort specifications in the first member of the source file data_file_identifier For diskette files enter the da
106. ame physical database file and member name can be specified for both the output file and one of the input files Here the output data is written over the input data The Sort utility clears the output file member so that it contains no records before output is written to the file except for copy only requests If a major failure occurs between clearing the file member and writing the resequenced data records to the file member your input data and your sorted data will be lost Thus make sure that this file member has adequate backup Work Area Sort internally creates a work area to accommodate the input records and codes generated during the sorting process The work area resides in a temporary work library and is only accessible to the program that is being run The area is auto matically deleted at the end of the job Copying the input records into a work area and then working with only the copied records allows several programs to use the same input files at the same time This is also the reason the input files are not altered by the Sort utility The work area is not created for copy only requests Source File The sort specifications are considered to be source input and must therefore come from a source file either a database or a diskette unit file The name of the source file from which the sort specification set comes is specified as a parameter to the FMTDTA command If the specified name is not a source file an error cond
107. and 9 CURRENT option 79 DATE option 79 DUMP option 78 NOCHK option 78 NODUMP option 78 NOPRT option 78 NOSECLVL option 78 PRT option 78 SECLVL option 78 access and use 73 as a line command 9 command line entering from 9 first display 74 input file name parameter 75 input library name parameter 75 input member name parameter 75 options parameter 78 options CHK 78 output file parameter 76 parameters explained 75 print file name parameter 77 program date parameter 78 prompt displays 74 purpose of 73 running the sort job 75 screen displays 9 second display 75 source file name parameter 77 syntax of 74 force character field specification 108 force all statement 102 force all definition 149 force conditional definition 149 force unconditional definition 151 forced character substitution definition 149 forced character field specification 108 forced control field 149 conditional 103 force all 103 field specifications 102 normal opposite 104 Index 157 forced control field continued unconditional 104 forced field unconditional 104 form field specification sample 99 format date international 98 input and output record 12 unpacked numeric fields 91 Format Data FMTDTA CL command See FMTDTA Format Data CL command format description 12 format of numeric fields packed 91 zoned 91 format unpacked 19 G graphic symbol printable 123 H Hangeul def
108. ants 97 signed constants 97 start position record specification 96 UDATE keyword 97 UDAY keyword 97 UMONTH keyword 97 UYEAR keyword 97 field length Factor 1 restrictions on 95 Factor 1 Factor2 92 restrictions on field statement 107 specifying Factor1 95 Factor2 96 on field statement 107 field location in input record field specification 107 field specifications column 8 entries 101 106 description 5 entering 99 101 field level information 12 manipulations 12 view 13 field control definition 149 fields alphanumeric 91 alternative collating sequence 84 data entry on field specification 101 field specifications 102 Factor 1 and Factor 2 87 Factor 1 length 95 input start end positions 8 numeric description 91 packed format 91 zoned format 91 order in output record 7 order of 99 overflow 48 reformatting 1 right justification 4 selecting and rearranging 1 summary data 47 files SRC filetype 11 database 10 differences from System 38 Conversion Reformat Utility 115 file naming conventions 73 filetype source 11 input same as output 12 keyed logical 11 keyword replaced by SORTR 115 names QFMTMSG 15 QFMTSRC 9 QFMTTXT 15 sort message file 15 nonkeyed logical 11 physical 1 printer 10 program identification in header specification 85 files continued QFMTMSG 15 QFMTSRC 9 QFMTTXT 15 QSYSPRT 12 source 5 source order of field specifications within 99 writing to 11 FMTDTA Format Data CL comm
109. any one of the several characters and you want to specify a replacement for each one you must enter a field specification for each replacement and use an entry in column 19 to relate the field specifications to each other See Column 7 Field Type on page 101 for a general discussion of forced control fields Make an entry in column 17 only when you want to see a conditional force For example use it to put an instead of an A into a position on the output record See the descriptions for columns 7 and 18 in this chapter for more information about conditional force Column 17 Summary Overflow Indicator Enter the character you want Sort to put into the output record if overflow occurs If nothing is specified Sort assumes the asterisk is the overflow indicator This field should only be filled for SORTRS jobs In other words if you specify a summary sort job then in the case of an overflow not enough room in the output record field for the accumulated total the character you enter into column 17 will be the one that will be put into the overflow indicator field a one column field immediately to the right of the rightmost data field in the output record Column 18 Forced Character The character here either replaces the control field character you specified in column 17 or if there is no entry in column 17 is used to force the control field to take a particular value Make an entry in column 18 only when you are us
110. at here you will specify an overflow field to hold totals that may be more than five characters long Entering the Specifications To define the overflow field enter a length for this overflow field into the Overflow Field Length columns columns 20 through 22 of the field specification The length that you specify here must not be greater than the maximum length allowed for the input data type as specified in column 8 of the field specification refer to Table 9 on page 104 Note that because of the addition of the overflow field the output record length will be longer than the input record length Suppose you anticipate an overflow only for record type R of Example 2 Producing Summary Totals Based on Two Input Record Types on page 54 All header record and field specifications would therefore be the same as for that example with the exception of a new field specification added to those for record type R These specifications would then be as follows only those columns that are important to this example are described FIELD SPECIFICATIONS Statement Field Location Forced Overflow Id F 1 T Je 1 d vox Number aonozo E MERES PONN Hus ehnmr ra ovk Start 9 10 11 12 13 14 15 16 17 18 Charac Fie ters Length S R e c A Reserved Comments o r d UETA Cc o n t i n u q a it i o n q A 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
111. ation 84 120 Copyright IBM Corp 1994 alternative collating sequence continued how to specify 120 introduction 117 limitation of System 38 Conversion Reformat Utility 115 specifying on header specification 82 111 ALTSEQ specifications as a type of sort specification 5 for entire control field 121 for part of control field 121 how to code 122 how to define 120 AND specifications continuation of preceding statement 89 field specifications 38 record specification 28 89 arrival sequence 41 ascending key sequence definition 149 attributes of output file 11 authority 11 automatic updating in RA files 42 auxiliary storage output file 13 sort requests 13 B begin continue record definition record specifica tion 89 bibliography 147 binary representation definition 149 of characters 93 of signs 94 blank record specifications 89 blanks padding the output record 7 blinking cursor 16 building the control field 8 building the output record 7 byte strings 8 C CGU Character Generator Utility definition 149 changing contents of control field 102 input records 8 153 changing continued records RA files 42 the collating sequence 117 Character Generator Utility CGU definition 149 character type Japanese 130 Korean 142 Simplified Chinese 135 Traditional Chinese 139 characters binary representation of 93 composition of digit portion 91 zone portion 91 example sorting character data 21 forced 108 ide
112. atting 1 7 related printed information 147 relative record number 41 restricting access 10 restricting file access 12 restrictions on Factor 1 field length 95 restrictions Factor Factor2 field length 92 return code after processing 14 right justification 4 RTVJOBA command 14 running the sort job 75 S saving space in memory 102 screen displays first FMTDTA prompt display 74 messages 14 second FMTDTA prompt display 75 second level messages 78 security 11 Sei On Katakana sequence Japanese 130 select and rearrange fields 1 selection criteria 9 sequence arrival 41 key 41 162 Sort User s Guide and Reference sequence checking 78 101 record specifications 89 sequence number description 101 field specification 101 header specification 83 record specification 89 101 sequence alternative by field 109 sequence collating alternative definition 149 sequence collating definition 149 sequence key ascending definition 149 sequencing specifications 6 sequential processing of input files 11 sequential reading 41 service information set of record specifications 87 set definition 150 SEU 4 shared read lock 10 shared update lock 12 shift in character definition 150 shift out character definition 150 signed constants Factor 2 field 97 signed numeric data 92 signs binary representation of 94 placement in packed and zoned numbers 94 Simplified Chinese double byte character set defi nition 150 Simplified Chinese double
113. being used as a control regular data can be repositioned in the output record Comments Identifies the name of the field selected as a data field from the input record The field specification is followed by three more specifications each defining a new data field DESC SUPPLY and SUPPADR respectively corresponding to the original data description for the input records Notice the order in which these fields are entered into the source file represented by the sequence number in columns 3 through 5 This is the order in which they will be put into the output record 26 Sort User s Guide and Reference RECORD SPECIFICATIONS 1 i Statement C D Factor 1 Com Factor 2 Constant F E i o ja pari Ds olf T In t son lt Factor 2 be ol y t Jat Oper Keyword of Number p i y End ator Comments of e n p Position Position Factor 2 gt 4 uje Field ad I je c of 0 Z Location A JA D EQ NE F d 0 P LT GT Start End 4 u LE GE of 3 94 5 7 9 10 11 12 13 14 15 16 17 18 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 72 e 7A IA 9 8 0 E I N C L U D E Q T R S A L E S of 1 I R E C O R D c 0j L 7 9 I AL EF a a 4 1 9 G 1 0j 0j 7 8 0j Q I N C L U D Ef D of N L YZ 7 tI I F D A T E G R E A T E R l AE I 0
114. ble 6 Table 6 Binary Representation of Signs Sign Binary Code 11111 1010 1100 1110 1101 1011 1 Standard Form The Sort Utility accepts all four forms of the plus sign Before sorting the file however the program converts all forms of the plus sign to the standard form 1111 If you print a dump the plus sign will always be expressed as a hexadecimal F If you specify alphanumeric data digit portion only a D in column 8 then Sort interprets each set of four bits as a digit and automatically assumes that the resulting number is positive 94 Sort User s Guide and Reference Columns 9 through 12 Factor 1 Start Position The entry in columns 9 through 12 identifies where in the input record the Factor 1 field begins This entry must be right justified Note that the difference between this entry and that entered into columns 13 through 16 Factor 1 End Position determines the length of the Factor 1 field This length can be from 1 to 256 characters but is subject to some restrictions as shown in Table 7 Table 7 Restrictions on the Maximum Length of the Factor 1 Field Restriction Maximum Factor 1 Field Length Factor 2 field is a constant 20 characters Factor 2 field is the keyword UDATE 6 characters Factor 2 field is the keyword UMONTH 2 characters UDATE or UYEAR Factor 1 field is alphanumeric but only 1 character the zone portion of each character is to be used column 8 contai
115. byte character sets character type 135 DBCS code sequence 136 radical 135 single pronunciation 135 strokes 135 strokes beyond radical 135 tie breaker 136 Simplified Chinese definition 150 single pronunciation sequence Japanese 129 single pronunciation Simplified Chinese 135 sort order overriding 84 sort process how to use 2 3 maximization 9 sort requests storage 13 sort sequence header specification 84 making characters equal 123 sort table sort table active definition 149 sort master table definition 150 SORTA entry header specification 83 SORTA in place of RAF 115 sorting 8 an RA file 43 five input files 36 in a different order 120 include exclude input records 87 Japanese DBCS 129 Korean DBCS 142 opposite 29 produce an RA file 41 several input files 35 Simplified Chinese DBCS 135 single input file 17 single input record type 17 special characters 6 Traditional Chinese DBCS 139 two record types 22 with reformatting 30 33 with totals 47 83 sorting and summing detecting overflow 64 one record type 49 two input record types 54 using an overflow field 63 SORTR entry header specification 83 SORTR in place of FILE 115 SORTRS entry header specification 83 SORTRS option 48 source file 5 8 data starts in byte 13 11 default 9 description 12 order of field specification within 99 overriding default 12 sort specifications location of 12 specifying on FMTDTA command 12 source file
116. characters Hangeul and Hanja Hangeul characters are sorted according to their DBCS codes For Korean DBCS characters there is a DBCS active sort table but no DBCS master sort table The Data Management contains more information about these tables The Korean DBCS can be sorted according the following sequence e Pronunciation Pronunciation Characters can be ordered by the phonetic sound they have when pronounced Pronunciations can be either user defined or defined by IBM All Hanja characters are equivalent in pronunciation to some Hangeul character however a second pronunciation may be necessary if the character is at the start of a word 142 Sort User s Guide and Reference Korean Pronunciation Sort Example The following example illustrates sorting women s names There are two fields name and sex The input layout file is as follows From To Explanation 1 10 Hangeul Hanja field with shift out and shift in person s name 11 14 Hangeul Hanja field with shift out and shift in sex 17 72 Other information HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification t Statement R gt A R O E i Output Type e Maximum e 1 eju R T s Control q tC sit AE y SORTR e
117. characters for which no entries in the active collating sequence exist will have a DBCS control field entry of X FFFF if ascending sequence is specified on the header specification This will cause records with undefined DBCS characters to be placed behind those with defined DBCS characters 128 Sort User s Guide and Reference e Columns 17 through 19 Forced Character Field or Summary Overflow Indi cator A N and K alphanumeric and Katakana are valid but DBCS characters are not supported Sorting Considerations for Japanese Double Byte Character Sets Japanese double byte characters can be sorted into five different character sequences Also the alphanumeric Katakana fields can be sorted into the Sei On Katakana sequence These five sequences are Radical stroke sequence tie breaker DBCS code sequence Stroke strokes beyond radical radical sequence tie breaker DBCS code sequence 3 Single pronunciation radical sequence stroke sequence tie breaker DBCS code sequence 4 Single pronunication strokes beyond radical radical sequence tie breaker DBCS code sequence 5 Character type sequence N Figure 32 Japanese Character Sequences Radical Characters can be ordered into their respective radicals Within each radical set the characters are ordered by strokes Radical numbers can be user defined The ADTS 400 Character Generator Utility SCO9 1769 contains a listing of radical numbers Strokes
118. cifications one identifying the field REORD and the other identifying the field BAL from the input record 32 Sort User s Guide and Reference Processing These Specifications You can process these specifications by entering the FMTDTA command as described in Example 2 Sorting Two Types of Records from the Input File on page 22 Because the source records are no longer in the default file you must also enter values for the SRCFILE and SRCMBR parameters of the command as shown below Specified on FMTDTA Command Explanation FMTDTA INFILE PROD SALEHIST The input records are to be taken from the first member of file SALEHIST in library PROD OUTFILE PROD ITEMSALE The output records are to be put into the first member of file ITEMSALE in library PROD SRCFILE TEST EXAMPLE The reformat specifications are taken from SRCMBR EXAMPLE3 member EXAMPLE3 in database file EXAMPLE which is in library TEST The OPTION parameters default to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMTDTA command is entered from a display station Example 4 Reformatting Records 2 In this example you want the one character field in position 20 of your input record to be in the first position of the output record To do this add the following field specification to the source file in the previous example HEADER SPECIFICATIONS 73 74 75 76 77 78 79 80
119. columns This is followed by a comment specification and another record specification Chapter 2 Sorting Records from a Single File 27 The second record specification in the set puts an additional condition on each input record before that record is selected for sorting The significant column entries are Columns Entry Explanation 7 A This specification adds another condition to the previous record specification 8 C The data in the Factor 1 and Factor 2 fields of each input record is to be inter preted as character data Each group of 8 bits represents a character 9 12 14 The Factor 1 field begins in column 14 of the input record 13 16 19 The Factor 1 field ends in column 19 of the input record This corresponds to the DATE field of the input record as defined by the existing data description for the record 17 18 GE The data in the Factor 1 field must be greater than or equal to the data in the Factor 2 field for the input record to be selected for sorting 19 c The data in the Factor 2 field is to be the constant specified in columns 20 through 39 of this record specification 20 39 891014 This is the constant value of the Factor 2 field representing October 7 1989 40 72 Comments Identifies the specified columns FIELD SPEC
120. cter will be 6 These modifications to the control field are made before the input records are sorted The original letters represent days of the week One objective of the sort is to rearrange the input records so that Monday s records appear before Tuesday s which appear before Wednesday s and so on If the letters were left in the control field then the records would be sorted F M R T W The change is for the conven ience of this sorting only It is invisible to you since the input records remain unmodified and the control fields are not included as control fields in the output records The output records are arranged in ascending order by ACCNO If two records have the same ACCNO they are arranged in ascending order by the character forced into the last column of the control field All data fields will appear in the output records 36 Sort User s Guide and Reference Entering the Specifications To sort these files enter the following header record and field specifications Only the columns important to this example are described HEADER SPECIFICATIONS i es 73 74 75 76 77 78 79 80 Page Program Identification Le of Statement R s A RIO E a i Output Type e Maximum e 1 eju T s Control q tC
121. d using character type single pronunciation radical total strokes tie breaker sequence Q Simplified Chinese DBCS control field using character type single pronunciation total strokes radical tie breaker sequence W Simplified Chinese DBCS control field using character type single pronunciation tie breaker radical total strokes sequence X Simplified Chinese DBCS control field using character type total strokes radical single pronunciation tie breaker sequence y Simplified Chinese DBCS control field using character type M Traditional Chinese DBCS control field using character type sequence H Traditional Chinese DBCS control field using character type stroke radical sequence B Traditional Chinese DBCS control field using character type radical strokes beyond radical sequence K Korean DBCS control field using primary Hangeul pronunciation of Hanja characters Korean DBCS control field using secondary Hangeul L pronunciation of Hanja characters that start Korean DBCS words and primary Hangeul pronunciation of all other Hanja characters Sei On Katakana control field E Japanese DBCS control field using single pronunciation radical stroke tie breaker I sequence Japanese DBCS control field using single pronunciation stroke radical tie breaker J sequence Japanese DBCS control field using radical stroke tie breaker R sequence Japanese DBCS control field using stroke radical tie breaker S sequence Japanese DBCS cont
122. d value unique for summary sort 48 control language See CL commands conventions file naming 73 copy only request 68 83 copying merging 67 83 overview 67 records 10 with reformatting 67 71 without reformatting 68 correcting errors 16 creation of output record 10 current library 75 current library list 76 cursor blinking 16 D data description field descriptions override 8 output file 11 record format not checked against 11 data field entry on field specification 101 field specifications 102 summary sort 48 summary definition 151 summing 102 data file identifier 77 data management 11 12 13 data management view 11 data type alphanumeric 92 character 92 106 description 104 digit 93 numeric signed 92 record specification 91 signed numeric 92 specifying 104 database file 10 12 76 date format international 98 DBCS See double byte character set decimal format packed definition 150 zoned definition 151 default source file overriding 12 QFMTSRC 9 Index 155 defaults normal control fields 102 using all input records 89 deleting records RA files 42 device file as input file 11 diskette 12 multiple input 41 printer 77 QSYSPRT 77 single input 41 diagnostic message System 36 Sort Utility 113 digit 91 digit portion EBCDIC 117 of character byte 91 diskette files 76 77 diskette unit file 12 diskettes 10 disks 10 display parameters 77 displaying messages 15 documenting the job 111 double byte
123. digits 4567 and you will not be aware that this is not the correct total To avoid this you can do one of two things e You can designate an overflow indicator to appear on the output record in the case of an overflow e You can increase the size of the summary data field To use an overflow indicator you must enter an overflow indicator field specification containing S in column 7 and V in column 8 This will define a single character field in the next position of the output record to hold the overflow indicator You may also enter a character in column 17 of the specification which will be used to denote that overflow has occurred If column 17 is left blank an asterisk will be used instead If a character is entered in column 18 it will be used to denote that overflow has not occurred The overflow indicator is placed in the output record if any of the summary data fields contained in the record have overflowed Only one overflow indicator can be specified If you specify more than one the last indicator specified will be used To increase the size of the summary data field enter the required size of the field in columns 20 through 22 of the field specification for the summary data field The new size must not exceed the maximum size for the data type defined in column 8 The new larger field is referred to as an overflow field and replaces the summary data field in the output record You can specify an overflow field for any su
124. e 1 256 c q e r ae i d e d a H A 1 D F X 1 3 94 5 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 eek E 4 of Pa i Statement C D Factor 1 Com F Factor 2 Constant AE o ja pari a 7 T n t son c Factor 2 e L 4l y t aT Oper t Keyword fy Number p i y Start End ator o Comments hoot e n p Position Position r Factor 2 gt 7 u e 2 Field EK I je c a 0 Zz c Location l JA D EQ NE F l 0 P LT GT K Start End 2 4L JU LE GE S oes 3 94 5 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 e IA LOE e IA x AE e IA x E tf pof Statement F D Field Location Forced Overflow ia i ja Charac Field iL f T Je t T ters Length ae y l fay i ced pja p R s jc fot e e e u o Pot Number Start End c b jn JA Reserved Comments t C K o fs jt ji LP ods ZL rt Ji ts fod DE d i n e Boot D P I t Ju q N V J ujaj l 0 U R t jt are F IMS e i i d F S H T o l x B n JA Ly oh 3 94 5 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 E A E 7 AAE i f t Figure 3 Sort Specification Forms When comple
125. e Sort utility during the processing of sort requests It is not needed or created for copy only requests One output file The output file is an existing physical file One print file This file contains a listing of the source file with any errors and or messages Input Files The input files used by the Sort utility must follow these rules e Normal AS 400 security is in effect for all input files The user using the utility must have use and read authority for the input files e The Sort utility defaults to a shared read lock on the input file If you want to restrict other users access to the input file while the utility is running you must override the locked state with the CL command Allocate Object ALCOBJ You 10 Sort User s Guide and Reference must issue this command before FMTDTA The Deallocate Object DLCOBJ command can be used to return files to their original locked state e You must provide the name of the input file in the FMTDTA command as described in Chapter 7 The Format Data FMTDTA Command The utility can be directed to a different file with a suitable override command e All input files are opened for sequential processing only This means that for database files physical files or nonkeyed logical file records are read in arrival sequence keyed logical file records are read in key sequence e Multiple input files are processed in the order specified in the FMTDTA command e All
126. e different item numbers Because there is only one record type all output records are sorted as one unit Chapter 5 Sorting Records from a File and Producing Totals 49 INVENTORY RECORDS RECORD CODE ITEM NUMBER QUANTITY ORDERED CUSTOMER NUMBER INVOICE NUMBER TRANSACTION DATE SELLING PRICE I 70015120 2 900 0111 880812 212 I 10012000 3 1100 0119 880812 295 I 70015120 4 1100 0113 880812 212 I 50011230 5 400 0662 880812 325 I 50011230 6 400 0221 880812 325 I 20011230 6 700 0568 880812 515 I 40016210 2 1000 2110 880816 42 I 40016210 5 1000 2110 880816 42 I 50011230 2 1100 3110 880816 325 I 10012000 3 400 7117 880816 295 of DELETE RECORD ITEM QUANTITIY CUSTOMER INVOICE TRANSACTION SELLING 1 CODE CODE NUMBER ORDERED NUMBER NUMBER DATE PRICE of 1 2 3 10 11 16 17 24 25 32 33 38 39 43 RECEIPT RECORDS RECORD CODE ITEM CLASS ITEM NUMBER SELLING PRICE PURCHASE ORDER QUANTITY ORDERED TRANSACTION DATE R 20 20011230 85000 0568 10 880812 R 10 10012000 6295 4330 6 880816 R 40 40016210 542 2110 3 880816 R 50 50011230 28325 3110 2 880816 R 20 20011230 49515 0568 5 880816 of DELETE RECORD ITEM ITEM SELLING PURCHASE QUANTITY TRANSACTION 14 CODE CODE CLASS NUMBER PRICE ORDER NUMBER ORDERED DATE fo Sp 1 2 3 45 12 13 17 18 21 22 27 2
127. e entered for each record type Record types are defined by record specifications as described in Chapter 9 Record Specifications Sort allows one series of field specifications to be entered without being preceded by the record specifications that define the record type This can be done only once and must be the last set of field record specifications entered for the job In this case the system assumes that the record type is all meaning that the field specifications pertain to all the remaining input records that have not yet been processed Order of Fields in the Output Record The order of the fields in the output record will be the same as the order in which the fields are defined by the field specifications It can be the same or different for each record type that is specified Order of Field Specifications in the Source File The order of the field specifications relative to each other and to the header record and comment specifications is determined by the specification sequence number entered into columns 1 through 5 FIELD SPECIFICATIONS Statement Field Location Forced Overflow Charac Field Number T y Eaman aonozo E DIZES VOND Husehmr a vx Start 9 10 11 12 End 13 14 15 16 17 18 ters Length R c A Reserved Comments o r d EEEE ee ee 2 X N A 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
128. e name of the file containing the records to be sorted input file and the name of the file to contain the sorted records output file For example FMTDTA INFILE FILE1 OUTFILE FILE2 where FILE1 is the input file and FILE2 is the output file Because no source file is identified here the system assumes the source specifica tions are stored in the first member of the default file QFMTSRC found in the library list Because no libraries or members have been specified for input or output files the system automatically defaults to the current library and the first member of each file If you want to specify another library or member enter the name of each in the following way FMTDTA INFILE LIBRAR1 FILE1 OUTFILE FILE2 MEMB3 SRCFILE LIBRAR2 FILE3 Here the input records are taken from the first member of file FILE1 in library LIBRAR1 and the output records are put into member MEMB3 of file FILE2 in the current library The source specifications are taken from the first member in file FILE3 in library LIBRAR2 To specify a member in the source file add another parameter to the FMTDTA command For example to specify member MEM2 in the source file enter FMTDTA INFILE LIBRAR1 FILE1 OUTFILE FILE2 MEMB3 SRCFILE LIBRAR2 FILE3 SRCMBR MEM2 From Screen Displays To enter FMTDTA and its parameters from a prompt display change the values on the FMTDTA screen that apply to your particular case and press Enter to run the comma
129. ecifications It provides the following information The type of output file a physical file a summary data file or a Record Address RA file The length of the control field The Sort order ascending or descending Whether the standard or an alternative collating sequence is used Whether or not the control field is to be included in the output The name of the file in which this set of Sort specifications is to be stored HEADER SPECIFICATIONS Page L2 73 74 75 76 77 78 79 80 Program Identification Statement Output Type SORTR SORTRS SORTA Number ou lt 4 3 4 5 6 7 8 9 1011 12 amcmo 13 14 Maximum Control Field Length 1 256 15 16 17 moaosocamu oF 18 Reserved s1 ae lt s040n 19 20 21 22 23 24 25 26 27 ecotec X 28 Reserved 29 30 31 32 33 34 35 36 37 38 39 Comments 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 a N AA NNN S A A Anna t NNN NNN Figure 21 The Form for Entering Header Specifications Copyright IBM Corp 1994 81 Summary of Column Entries Table 1 summarizes the column entries for header specifications Table 1 Summary of Column Entries for the Header Specification Columns Entry Explanation 1 2 00 99 Page
130. ecord and field specifications Only those columns that are important to this example are described below HEADER SPECIFICATIONS 1 2 73 74 75 76 77 78 79 80 Page Program Identification Tb Statement R A RO ER i Output Type e Maximum e 1 eju 7 T s Control q tC s t 4 y SORTR e Field u o elp E q Number p SORTRS r Length e Reserved SI rju Reserved Comments fod e SORTA v n e vit Uyak e 1 256 c qle E of d e d gt H A i D F X sa seli ea ari dda la detaloza 23202 as z0 gra aaiae 3e 3130300 Eara AAAA AT acio 50 EEZ 83 94 85 172 H S O R T R 1 1 A X a 1s we Columns Entry Explanation 7 12 SORTR This is a regular sort the output is to be a physical file 15 17 11 The maximum control field length is 11 characters This is the sum of the two input fields ITEMNO and QTRTOTAL that are combined to form the control field 18 A The output records are to be sorted in ascending order A before B 1 before 2 and so on For the ordering of numbers relative to upper and lowercase charac ters and special characters refer to the collating sequences in Appendix C Standard and Alternative Collating Sequences 26 No entry The Sort utility defaults to the standard collating sequence 28
131. ed in bits 4 through 7 and the sign is contained in bits 0 through 3 of the rightmost byte bits 0 through 3 of all other bytes contain 1s hexadecimal F For example in zoned decimal format the decimal value of 123 is repres ented as 1111 0001 1111 0010 1111 0011 Contrast with packed decimal format zoned field A field that contains data in the zoned decimal format Glossary 151 152 Sort User s Guide and Reference Index Special Characters as overflow character 48 CHK option FATDTA command 78 CURLIB 75 CURRENT option 79 DATE option 79 DUMP option 78 FIRST member name 76 LIBL 76 NOCHK option FATDTA command 78 NODUMP option 78 NOPRT option 78 NOSECLVL option 78 PRT option FATDTA command 78 SECLVL 15 option of FMTDTA command 78 SRC filetype 11 A access restrictions 10 12 accumulated totals example of 48 overflow 108 active sort table brief description 125 coding considerations field specifications 128 header specifications 126 record specifications 127 definition 149 adding data field summary sort 102 adding records RA files 42 address file record definition 150 alarm 16 alphanumeric constants Factor 2 field 96 data interpretation of 92 fields 91 ALTCOLLSEQ column header specification 120 alternative collating sequence advantage over System 38 Conversion Reformat Utility 115 by field 109 definition 149 for individual fields 84 header specific
132. eld Fath T Je t T ters Length be of y jl jay 7 pid p R s jc td Number s Start End f b h A Reserved Comments f C K ojsjt j of ZL r t Ji ts 12 5h D E d i jn e of D P I t ju q Po N V J u ja eT 0 U R te fo cif F M S e i of F S H T o ae 34 5 6 5 3 9 10 11 12 13 14 15 16 17 18 19 en 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s 172 0 0 4 F N E 1 1 2 6 S E I O N TETLATDE S 0 0 5 F N S 2 9 S R T S E Q U E N C E Wee Lo of Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before being used to control the sort 8 E The data field contains a Sei On Katakana control field 9 12 11 The data field begins in column 11 of the input record 13 16 26 The control field ends in column 26 of the input record 40 72 Comments Identifies the pronunciation of the word The following describes the column entries that differ on the second control field Columns Entry Explanation 8 S The data field contains a Japanese DBCS control field using stroke radical tie breaker sequence 9 12 2 The data field begins in column 2 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Identifies the stroke radical tie breaker sequence Kanji Character Dictionary Type Sorting Example The
133. eld specification are Columns Entry Explanation 7 S Identifies the field as a summary data field The data in this field is the data to be summed 8 U The data in this field is to be interpreted as numeric data in unpacked format each digit is represented by both the zone and digit portions of the byte with the zone portion of the last byte determining the sign positive or negative for the entire number 9 12 12 Start position of the data field in the input records 13 16 17 End position of the data field in the input records Chapter 5 Sorting Records from a File and Producing Totals 53 Processing These Specifications To process these specifications enter the FMTDTA command with parameters as for any of the examples in the previous chapters For example you could enter Specified on FMTDTA Command Explanation FMTDTA INFILE Z Y X The input records are to be taken from member X of database file Y in library Z OUTFILE SORTED The output records are to be put into the first member of file SORTED in the current library The specifications are automatically taken from the first member of file QFMTSRC default source file in the library list The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMATDTA command is entered from a display station Sort sends the output automatically to the device file QSYSPRT which is the sy
134. elect a summary sort on a file that contains nonnumeric data or if a record without summary fields is defined your results may differ from those on the System 36 Also when your summary sort contains more than one record format and the cor responding summary fields are either different lengths or different data types your results may differ from those on the System 36 Copyright IBM Corp 1994 113 Notes 1 2 The AS 400 Sort warning and error message are different from those on the System 36 The AS 400 will not accept a minus sign in the last position of a numeric constant denoting a negative value ending with zero It should be replaced by the symbol or zero followed by a minus sign Running a Sort Job in System 36 Sort Utility If you enter your coding specifications in AS 400 environment but run them on the System 36 Sort Utility make sure they conform to those for System 36 You should also be aware of the following The maximum length of the Factor 1 and Factor 2 fields in the record specifica tion is 4KB KB equals 1024 bytes Because the System 36 system handles arithmetic statements differently from the AS 400 system different results may occur when using nonnumeric data in summary sorts On the AS 400 system you can sort input files with different record lengths in the same sort job but to run AS 400 sort jobs on the System 36 the input files must have the same record length System 36
135. en sorting multiple input files to produce a physical output file note the following The output type on the header specification must be SORTR The maximum control field length must be greater than zero Field specifications must be entered to define the control field You need not enter a separate field specification for each input field you wish to appear in the output record If there are to be no changes in their order or content you can treat the entire input record as one output field The INFILE parameter of the FMTDTA command has several values one for each input file being specified Examples This section gives one example of how to use the Sort utility to sort records from several input files Copyright IBM Corp 1994 35 Example 1 Sorting Records from Five Input Files This example processes five input transaction files producing a single physical file as output It also uses a forced character substitution to change part of the control field The control field is composed of two fields from the input record The high order part comes from the ACCNO input field columns 1 through 6 and the low order part a new character that is forced into the control field based on the value found in column 7 Letters in column 7 of the input records represent days of the week M T W R and F If column 7 contains an M this character is a 1 if T 2 if W 3 if R 4 and if F 5 If it contains none of these the new chara
136. en you do not want to specify a summary overflow field length or when you do not know how large a summary overflow field will be In these cases you can cause the utility to put a constant the overflow indicator into the output record each time an overflow occurs Subsequent programs that read your sorted output file can then test for the presence of this character constant and act accordingly 64 Sort User s Guide and Reference Entering the Specifications You can specify the overflow indicator on any field specification for the job If you specify different overflow characters on different field specifications Sort uses the last one that was specified for each record type For example if you use the summary data field specification for record type R of the previous example the field specifications would then become as follows only those columns that are important to this example are described FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow i ila Charac Field 7 T Je t T ters Length y fl jay LAY pjd p R s c fof e e e u jo ae Number Start End c b n JA Reserved Comments of C K ols t jl ET ZL r t i ts Eoi D E d fi n e Ef D P I t ju q 7 N V J ula 7 0 U R tjt Leas F M S e i ho Of F I
137. er set that has been simplified by reducing the number of strokes in common characters and deleting complicated vari ants Simplified Chinese characters are used primarily in the People s Republic of China Simplified Chinese double byte character set An IBM defined double byte character set for Simplified Chinese It consists of Simplified Chinese non Chinese set primary set secondary set and up to 1 880 user definable characters Simplified Chinese non Chinese character set A subset of the Simplified Chinese DBCS consisting of non Chinese characters such as Latin alphabet Greek Russian Roman numeric alphanumeric and related symbols Katakana Hiragana Japanese special symbols and Chinese phonetic symbols There are 712 characters in this set Simplified Chinese primary character set A subset of the Simplified Chinese DBCS consisting of com monly used Chinese characters There are 3 755 char acters in this set Simplified Chinese secondary character set A subset of the Simplified Chinese DBCS consisting of less commonly used Chinese characters There are 3 008 characters in this set sort sequence specifications Source statements that specify the sequence of a sort specification sheets Forms on which a program is coded and described summary data field A data field designated for accu mulated totals Traditional Chinese The Chinese character set expressed in traditional form Traditional Chinese char
138. erence RECORD SPECIFICATIONS Statement C D Factor 1 Com F Factor 2 Constant f o ja pari la 12 ds T In t son c Factor 2 gt e fed y t Jat Oper t Keyword i Number p i y Start End ator o Comments A e n p Position Position r Factor 2 i u e 2 Field Lok I Je c L 4 0 Z c Location ELT JA D EQ NE F Peat o P LT GT K Start End Lok 3 4 5 6 4 e 9 10 11 12 13 14 15 16 as 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s5 m 0 c 6 6 2 E Q C D Oj M I T I F c 0 L 6 2 D i 1 0 A Cc 5 5 5 E Q C X A N D c 0j L 5 5 X a 0 0 c 6 6 2 E Q C G 0f R I F c 0j L 6 2 G i a 0 A Cc 5 5 5 E Q C X A N D C EL 5 5 Xx i a I I N C L U D E AJ L L B U T Oj M I T T E D R E C O R D S i OOP These omit record specifications indicate which records are not included in the output file The significant column entries are Columns Entry Explanation 6 0 The records that meet these conditions are omitted from the copy 7 Aoro These records continue to specify the conditions that the record must meet in order to be omitted from the copy An input record is omitted if position 62 con t
139. ers b k s B K S and 2 position 3 are considered equal This is the number you use in ALTSEQ statements to identify a character that you want to shift to a different order in the sequence Figure 29 Standard EBCDIC Collating Sequence Used When You Compare Only the Zone Portion of Characters Appendix C Standard and Alternative Collating Sequences 119 Only Digit Portion of Character Used Only Digit Portion of Character Used Only Digit Portion of Character Used Order in Corresponding Order in Corresponding Order in Corresponding the Hexadecimal the Hexadecimal the Hexadecimal Sequence Character Number Sequencex Character Number Sequence Character Number 1 blank 40 U E4 z A9 lowest amp 50 4 F4 I c9 minus 60 R D9 co 6 e 85 Z E9 DO n 95 9 F9 0 FO v A5 E c5 11 4A 2 61 N D5 5A a 81 v E5 split bar 6A j 91 5 F5 7A tilde Al A C1 f 86 12 a 4B J D1 o 96 5B El w A6 5 6B 1 F1 F C6 7B 7 0 D6 3 b 82 W E6 13 lt 4c k 92 6 F6 5C s A2 6C B c2 8 g 87 7C K D2 p 97 S E2 x A7 14 4D 2 F2 G C7 5D P D7 6D 4 c 83 X E7 underscore 1 93 7 F7 7D t A3 apostrophe c c3 9 h 88 L D3 q 98 15 4E T E3 y A8 7 5E 3 F3 H c8 gt 6E Q D8 7E 5 d 84 Y E8 m 94 8 F8 16 6F u A4 7 5F D c4 10 grave 79 6F M D4 i 89 p 7F r 99 Characters sharing the same position in the sequence are considered
140. ers not condi tionally forced will retain their original value Unconditional Forced Fields An unconditional force places a defined character into a control field To specify an unconditional force of a control field value leave columns 9 through 17 and column 19 blank Enter the required character in column 18 Summary Data Field S in Column 7 A summary data field is one that is designated to hold selected accumulated totals These totals can only be specified in summary sort SORTRS jobs A maximum of 24 summary data fields can be defined for a record type In summary sort jobs the data found in the field are added for all input records which have identical control field values The same field in the output record is normally used to hold the totals except in the case of an overflow In the case of a summary sort only one output record is produced for each sepa rate input record type specified You can in addition to specifying summary sort fields also enter data field specifications If you do so however the output record will contain the data field the contents in that field will correspond to the contents of the data field found in the first input record of that set that was processed Column 8 Data Type The column 8 entry here indicates what portion of the characters in the control field is used in sorting and reformatting the input records Do not confuse it with the column 8 entry on the record specification which
141. es of record specifications signals the start of a new record type Any difference in the way an input record is to be selected or an output record is to be organized is considered a new record type and requires a new set of record specifications There are two main differences e Input record type Differences in the criteria by which input records are to be selected You enter a set of record specifications to identify each set of cri teria e Output record type Differences in the field specifications for an input record type You must precede each set of field specifications by the appropriate record specifications even if those record specifications are the same as the set previously entered Selecting Control and Data Fields Building the Output Record Each set of record specifications is followed by a series of field specifications The field specifications select the fields from the input records and specify if and how they are to be changed These input fields can either be data fields or can become part of the control field One or more field specifications may be needed for each field The order of the field specifications in the source file determines the order of the fields in the output records For example to move a field from the end of the input record to the beginning of the output record place its field specification first in the source file before any other This way you can select any portion of the input record chan
142. escribe your alterna tive collating sequence Appendix C Standard and Alternative Collating Sequences describes the standard EBCDIC collating sequences and how to code ALTSEQ specifications The record specifications identify the input records you want to include or exclude from the sort Chapter 9 Record Specifications describes all the possible entries The field specifications identify the control fields and the data fields on the input record that you want included in the output record Chapter 10 Field Specifications describes all the possible entries The comment specification allows you to place comment entries throughout your sort program to make its purpose and process clearer for yourself and other users There is no special form for a comment specification entering an asterisk into column 6 or 7 of any of the specifications automatically identifies the specification as a comment Chapter 11 The Comment Specification provides details Chapter 1 Introduction 5 The header specification 2 ALTSEQ specifications see Appendix C Comment specifications m Record specifications to identify an input record type 7 Field specifications to identify the control field and data fields Repeated for each input output record type Figure 4 Order in Which You Should Store Sort Specifications in the Source Fi
143. esponding to the original data definition for the input records 40 72 Comments Identifies the name of the field selected as control field from the input record 28 Sort User s Guide and Reference The second field specification defines another field QTRTOTAL from the input record which will become the second part of the control field Sort will regard both control fields as a single string of control characters and will begin the sort with the character farthest to the left The significant column entries are Columns Entry Explanation 7 0 The control field is to be treated as an opposite control field This means that the input records are to be sorted so the data in the QTRTOTAL field ends in a sequence opposite to that specified in the header specification 8 U The data in this control field is to be interpreted as numeric data in unpacked format This means that each digit is to be represented by 8 bits the lower 4 bits identify the digit and the higher four zone portion represent the sign plus or minus of the entire number 9 12 25 This control field data begins in column 25 of the input record 13 16 29 This control field data ends in column 29 of the input record 40 72 Comments Identifies the name of the field selected as control field from the input record FIELD SPECIFICATIONS Statement F D Field Location Forced Overflow f y i ja Charac Field L 4 Tle tT ters Length A Jil y fl
144. ess RA file 41 83 150 as output 41 description 41 record address file definition 150 record format description 12 filed level view 13 input and output 12 record length actual 11 input records 11 output file 11 print file 12 work area 13 record number copy only requests 13 relative 41 record selection alternative collating sequence 121 record specification 5 record specifications 87 AND 28 89 begin continue record definition 89 blank 89 coding of negative constants 97 column entries 87 column summary 87 comments 98 comparing Factor 1 and Factor 2 95 comparison operator 95 constant value for Factor 2 96 data type 91 Factor 1 end position 95 Factor 1 start position 95 Factor 2 end position 96 Factor 2 is a keyword 97 Factor 2 start position 96 OR 90 page 89 101 sequence checking 89 set of 87 specification identifier 89 statement number 89 101 type of Factor 2 data 96 Index 161 record specifications input record type 7 record specifications purpose of 6 record type 6 7 87 beginning anew 7 defining 6 input 7 order of fields within 99 output 7 specifying different 87 records 1 format considerations 12 input include exclude 87 input including 89 input location of input field 107 input omitting 89 limitations on number of copy request 13 sort request 13 number in work area 13 output exceeding maximum length for 109 output padding with blanks 102 Sort treatment of 87 redirecting output 12 reform
145. ess than the data in the Factor 2 field for the input record to be selected for sorting The comparison is to be based on the collating sequence specified in the header specification which here is the standard collating sequence 19 F The data in the Factor 2 field is to be the data taken from the input record field as specified in columns 20 through 27 20 23 40 The Factor 2 field begins in column 40 of the input record 24 27 45 The Factor 2 field ends in column 45 of the input record This selects the data from the REORDER field corresponding to the original data definition for the input records Chapter 2 Sorting Records from a Single File 19 FIELD SPECIFICATIONS 7 Statement F D Field Location Forced Overflow 4 i fa Charac Field hae T Je t T ters Length lt y ll fay EREE a Sa Ed p d p R JS C Bock e e e ju jo 4 Number Start End c b jn JA Reserved Comments 4 C K o fs jt 1 A Zi r t ji ts 1 D E d i n e 1 D P I t ju q 1 N v J u fa Levit 0 U R tjt E F M S e i E i F S H T o 7 x B n JA leet 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 7 F N C 1 2 T Y P Ej N 0 FEUER L D a i ae F N C 3 8 I T E M N 0 F I E L D T AE e i E 7 fe ol
146. evious specification the conditions in both this specification and the previous one in this set must be met for the record to be used or omitted Chapter 9 Record Specifications 89 This specification is part of the definition of a record type It is in an OR relationship with the previous specification the conditions in either this specification or the previous one must be met in order for this type of record to be used or omitted The record specification is treated as a comment The following tables show the combination of entries you can make in columns 6 and 7 for sets of include and omit specifications Table 3 show the entries for include sets Table 3 Include Sets Column 6 Type of Set Entry Column 7 Entry Explanation Include AND H F or O statements Header statement field statement or omit statement b New record type indicated by a blank in column 7 A Statements that describe the same record type as the previous statement have an A in column 7 Field statement s Include OR H F or O statements Include AND H F or O and OR statements Header statement field statement of omit statement o New record type indicated by a blank in column 7 O Statements that describe a different record type than the previous statement have a O in column 7 Field statement s Header statement field statement or omit statement o New record type indicated by a blank in column 7
147. f x JA D EQ NE F i E 0 P LT GT K Start End i ju LE GE S 7 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 e AS i 2 2 E Q Cc R I N C L U D E 1 R Tl EPL E R E C O R D S f LO The significant column entries are Columns Eniry Explanation 6 I Specifies that the records described in this specification are to be included in the sort 8 c Identifies the data for Factors 1 and 2 as character data The system will look at both the zone and digit portions of each byte when comparing Factor 1 with Factor 2 13 16 2 Start and end position of the Factor 1 field 17 18 EQ Specifies that the data in Factor 1 of each record must equal Factor 2 19 C Specifies that the value in Factor 2 is equal to the constant value entered into columns 20 through 39 of this record specification 20 39 R The constant value for Factor 2 60 Sort User s Guide and Reference FIELD SPECIFICATIONS le SE Statement F D Field Location Forced Overflow fol i fa Charac Field 7 T Je t T ters Length oo y ll fay a WEN BA L d p d p R S C Let e e e u jo Lop Number Start End c b jn JA Reserved Comments 7 C K o fs jt j 1 Zol r t ji fts best D E d i n e f of D P I t ju q l N V J u fa fod 0 U R tR Lot F IMS e i Ie ob F IS H
148. f 1 I L 4 hw of Columns Entry Explanation 6 I Specifies that the records described in this specification are to be included in the sort 8 c Identifies the data for Factor 1 and Factor 2 as character data The system will look at both the zone and the digit portions of each byte when comparing Factor 1 with Factor 2 9 12 12 Factor 1 field begins in column 12 of the input record 13 16 13 Factor 1 field ends in column 15 of the input record 17 18 EQ The data in the Factor 1 field must equal the data in the Factor 2 constant for the input record to be selected for sorting 19 S The data in the Factor 2 field is constant and is shifted one column to the left before comparison 20 0 Represents the shift out character 21 23 DB The DBCS character to be compared 25 I Represents the shift in character 40 72 Comments Compare 1 character 144 Sort User s Guide and Reference FIELD SPECIFICATIONS Statement F D Field Location Forced tia Charac TEET ters y i jay p d p R S C E e e ju jo Number Start End c b jn CK o s t Zek r lt fi DE d i n D P I t ju N JV J u ja 0 JU R t jt F IMS eji F IS H T o x B n 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 0 0 3 F N L 2 9 fof Overflow 7 Field l Length 4 7 AE si Pith
149. f the error was in source data the entire input record was skipped If it occurred while the program was running it will lead to an abnormal end of program or function severity code 40 condition The results of the operation are not valid 40 Abnormal end of program or function The running of the program has actually stopped either because it was unable to handle invalid data or because the user has canceled it E The text you see online or on a listing giving a brief generally one sentence description of the problem The text you see online when you press Help from the screen with the message displayed It will be printed on your listing if you specify SECLVL in your run time options The default for this option is NOSECLVL This text contains an expanded description of the message and a section detailing the correct user response Displaying and Printing Messages To display or print a particular message or messages use the DSPMSGD command This command is described in the CL Reference manual The library name for your product is QSYS and the file names are QFMTMSG and QFMTTXT Error messages fall into two basic categories e Error messages to inform you of an error situation as the system was running your command e Informational messages to provide you with information about the processing and or its result When a message is displayed one or more of the following can occur e The message is displayed called f
150. ge it and place its data anywhere in the output record Input Record Field 1 Field 2 F3 Field 4 Field 5 Field 6 Field 7 Field 2 Field 6 F3 Field 1 Padded on the right by blanks Reformatted Output Record Figure 5 An Example of How Sort Builds an Output Record The output record is padded on the right by blanks to make its length equal to the output file Chapter 1 Introduction 7 Building the Control Field The control field is specified like any other field however its contents control the sorting For example to sort a series of input records in ascending order Sort orders them by the contents of their control fields so that records whose control field contents begin with an A would precede those whose control field contents begin with a B Construct one control field for each sort job For different input record types however you can combine different elements from the input record into the one control field The next section Using FMTDTA to Process the Specifications describes how the Sort utility uses the control field to sort input records Input Record Field 1 C1 Field 2 Field 3 F4 Cntl 2 Field 5 Control Field C1 Cntl 2 Reformatted output record Order of sort gt Figure 6 An Example of How Sort Builds a Control Field The control field is then used as a key t
151. gle file to produce an RA output file note the following The output type on the header specification must be SORTA The maximum control field length must be greater than zero Column 28 of the header specification should contain an X This excludes the control field from the output record Field specifications must be entered to define the control field No other field specifications should be entered If you try to include data fields in the output records of an RA file you can get inconsistent results The INFILE parameter of the FMTDTA command has only one value because only one input file can be specified for this type of sort 42 Sort User s Guide and Reference Examples This section gives one example of how to use the Sort utility to sort records and create an RA file Example 1 Sorting an Inventory File by Item Class This example sorts the records taken from a file called ITMMSTR which keeps track of the items and objects in a typical office The items are grouped into classes and each class is given a number The records are to be sorted by item class The file will contain the addresses of the input records only therefore even if the original input file records are altered any sorted output that is displayed or printed will contain the modifications and reflect the most up to date records Item class is a two digit field in columns 41 through 42 of the input records as shown in the following input file
152. gnated by IBM is the user s responsibility IBM may have patents or pending patent applications covering subject matter 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 the IBM Director of Licensing IBM Corporation 208 Harbor Drive Stamford Connecticut USA 06904 2501 Changes or additions to the text are indicated by a vertical line to the left of the addition or change This publication contains examples of data and reports used in daily business oper ations To illustrate them as completely as possible the examples include the names of individuals companies brands and products All of these names are fictitious and any similarity to the names and addresses used by an actual business enterprise is entirely coincidental Trademarks and Service Marks The following terms denoted by an asterisk used in this publication are trade marks of the IBM Corporation in the United States or other countries Application System 400 AS 400 IBM Operating System 400 OS 400 400 Copyright IBM Corp 1994 ix X Sort User s Guide and Reference About This Manual This manual describes the Application System 400 AS 400 Sort utility which is a function of the Operating System 400 OS 400 system It contains a general description of the Sort utility specific descriptions with examples and detailed refer ence information
153. gular data fields that are not summed Sort utility specifications from source file Input records from up to eight files The FMTDTA Database files or Device Command logical or physical files possibly reformatted and created for each unique summed into a physical file control field value Output records sorted One output record is Figure 11 Sorting and Reformatting Records and Producing Totals for Certain Data Fields The output is a physical file in the database meaning that it contains the actual output records Note that the output file will contain only as many records as there are unique control field values it is thus usually much smaller than the input file The Sort utility sorts the output records according to the contents of the control field Defining a Summary Set The following entries are required for a summary sort e The output file type in columns 7 through 12 of the header specification must contain SORTRS e The maximum control field length in columns 15 through 17 of the header spec ification must contain a numeric value greater than zero e At least one of each of the following field types must be defined Control Field Enter one or more field specifications to define how the input records are to be grouped for summarizing Column 7 will contain N O or V A single summary record will be created for each set of input records with a
154. haracter long leave columns 20 through 23 start position blank and enter the number of the position on the input record that contains the character in columns 24 through 27 end position Columns 20 through 39 Factor 2 Is a Constant If column 19 contains a C Factor 2 is a constant Use columns 20 through 39 to enter the constant The constant must be the same length as the Factor 1 field unless packed or zoned numeric data is specified and must be right justified within the constant length For comparisons to packed numeric fields column 8 contains P the number of numeric digits in the Factor 2 constant must be equal to twice the Factor 1 length minus 1 the sign occupies only one position in both the packed field and the zoned constant For comparisons to zoned numeric fields U in column 8 the number of numeric digits in the Factor 2 constant must equal the Factor 1 length Alphanumeric Constants Column 8 Entry is C Z or D Alphanumeric constants can be combinations of letters digits punctuation and special symbols anything that appears in the EBCDIC collating sequence shown in Appendix C Standard and Alternative Collating Sequences The constant must be the same length as the Factor 1 field and must always begin in column 20 96 Sort User s Guide and Reference Numeric Constants Column 8 Entry is P or U Format Numeric constants must be right justified within the field length specified in Factor 1 within tw
155. haracter types can be ordered by the following sequences e User defined special characters e General character Ordinal and Numeric e Latin alphabet e Japanese Kana e Greek alphabet e Russian alphabet e Chinese phonetic symbol e Chinese phonetic annotated letter e Chinese characters Strokes Characters can be ordered by the number of strokes used to draw the character or by the total number of strokes Radical Characters can be ordered into their respective radicals Within each radical set the characters are ordered by strokes Radical numbers can be user defined The ADTS 400 Character Generator Utility SC09 1769 contains a listing of radical numbers Strokes beyond radical Characters can be ordered by the number of strokes used to draw the character or by the number of strokes excluding the radical Single pronunciation Characters can be ordered by the phonetic sound they have when pronounced Pronunciations are represented by tone concatenating Pinyin There are five tones light tone without tone mark high and level tone rising tone falling rising tone and falling tone When you sort a Simplified Chinese character by single pronunciation sequence it is sorted by Pinyin and then by tone sequence Appendix D Sorting Double Byte Character Sets 135 Tie breaker The tie breaker is the tone and Pinyin used to represent any alterna tive pronunciation of IBM supplied characters only In DBCS sorting tie breaker
156. hecked The system verifies if the sequence numbers of the job specifications in the source file match their order in the source file If not a warning message is issued NOCHK The Sort specifications are not sequence checked PRT The Sort specifications for this job as well as any error and warning mes sages issued by the system are printed NOPRT The specifications and messages are not printed NODUMP The internal tables used for this job are not printed DUMP The internal tables used for this job are printed These tables can then help you isolate the cause of any particular problem NOSECLVL Do not list second level messages for this job SECLVL List second level messages for this job PGMDATE Program date Specifies the date that is used with Factor 2 in the record specifications described in Chapter 9 Record Specifications The system can search for par ticular input records that contain the same greater or lesser value than this date Possible values are 78 Sort User s Guide and Reference CURRENT The current date the job is being run DATE Use the date as entered with the CL command QDHTFMT if separators are used use the date as entered with the QDATSEP command Chapter 7 The Format Data FMTDTA Command 79 80 Sort User s Guide and Reference Chapter 8 The Header Specification The header specification must be the first statement excluding comments in any set of Sort sp
157. helps select the input records for the job This entry controls how those selected input records are to be sorted You can also use it to specify the portions of data field characters that are to be trans ferred to the output record When you use this entry to change control field characters the control field remains changed in the output records Usually this changed control field data is used only for the sorting and is otherwise meaningless enter an X into column 28 of the header specification to exclude it from the output record Or use another field specification to respecify the original control field as a data field before entering the field specification that alters the contents of the control field Possible entries are shown in Table 9 Table 9 Page 1 of 3 Possible Column 8 Entries and Restrictions on Field Length Col 8 Character Portion Used Maximum Entry Field Length C Use both zone and digit portions of the charac 999 characters data ters 256 characters control field Z Use only the zone portion of the character 1 character D Use only the digit portion of the characters 16 characters U The characters are interpreted as signed decimal 16 digits numbers in zoned unpacked format x The characters are interpreted as signed decimal numbers in packed format 1 8 bytes or 15 digits and sign 104 Sort User s Guide and Reference Table 9 Page 2 of 3 Possible Column 8 Entries and Restrictions on Field
158. i tion occurs You can use an override command to redirect the utility to another source file Print File If the PRT or DUMP options of FMTDTA are selected a print file can be identified to store information about the sort job All the print data is directed to this file The file that is specified must already exist before running Sort otherwise an error con dition occurs If a print file is not specified print output is sent to QSYSPRT the system print file by default Input and Output Record Format Any file that is used as input or output by the Sort utility can have a detailed record format description associated with it This description specifies detailed field level information which is used by data management in performing field level manipu lations This information is not used by the Sort utility and does not affect the processing of the sort specifications 12 Sort User s Guide and Reference The Sort utility receives a string of bytes as input from data management and sends a string of bytes back to data management for placement in the output file The field level view used for processing by the Sort utility is defined by start and end positions in the specifications This field level view is used only by the Sort utility and does not have to match the one used by data management However inconsistencies can occur if the two views are not compatible for example if only half of a data field is selected by the So
159. ice the field length minus one position to contain the sign if Factor 1 is a packed number For example assume that Factor 1 defines a six position zoned field in the input record and that Factor 2 is the numeric constant 123 To right justify the constant within the six positions specified you must put it in columns 23 24 and 25 Leading zeros are not required and blanks and zeros look the same for numeric constants The constant cannot be completely blank however In the previous example columns 20 through 25 could contain either 000123 or XXX123 with X representing a blank Signed Constants Negative constants can be designated either by setting the zone portion of the character representing the least significant digit to the value of hexadecimal D or by placing a separate minus sign in the following position When the sign is designated by zone the decimal digits 0 to 9 will be replaced by the characters and J to R respectively A constant consisting of decimal digits only is taken as positive Positive values may also be designated using a separate plus sign RECORD SPECIFICATIONS Factor 2 Constant Statement Factor 1 Com Factor 2 e Keyword Number T y Start End ator Comments P e Position Position lt _ Factor E Location On oUK4 Start End i 1 Basro NaoeaaT LE GE 17 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
160. ield to be summed Used for summary sort only The data found in this field in the input records of the type described in the corre sponding set of record specifications is added together and the result placed in this field in the output records The record specification is treated as a comment If you are describing a control field you can use the entry in column 8 to further specify which part of each character in the control is used for sorting or reformat ting Columns 8 through 19 allow you to control the sorting and reformatting more precisely This can be useful for special types of sort or to save space in memory and processing time during very long sorts Data Field D in Column 7 Data fields apply to copy and sort requests that produce physical output files as opposed to RA output files They are fields you want Sort to include in the output records Control fields can also be specified as data fields if you want them to appear in the output records You can either globally request this in the header specification or separately request it on a control field basis by respecifying this control field as a data field for this record type When your file has more than one type of record e The number of data fields does not have to be the same for all record types e The combined lengths of the data fields for each output record do not have to be the same for all record types The Sort utility places blanks to the right of sho
161. in the source file use the FMTDTA command to run the job The INFILE parameter specifies a single database physical file A FMTDTA command that could run this job is Specified on FMTDTA Command Explanation FMTDTA INFILE LIBL1 ITMMSTR The input records are to be taken from the first member of database file ITMMSTR in library LIBL1 OUTFILE LIBL2 RAMSTR The output records are to be put into the first member of file RAMSTR in library LIBL2 The specifications are automatically taken from the first member of file QFMTSRC default source file in the library list The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMATDTA command is entered from a display station Based on the actual input the contents of the output file are RELATIVE RECORD NUMBERS 00003 00001 00002 00006 00005 00007 00004 00008 S 46 Sort User s Guide and Reference Chapter 5 Sorting Records from a File and Producing Totals In addition to sorting records from one or more input files you can specify a summary sort whereby Sort adds together the contents of certain fields in the input records and produces a single output record containing the totals see Figure 11 A maximum of 24 data fields can be summarized for each record type in a single job These data fields are called summary data fields in order to dis tinguish them from re
162. ing forced control fields See Column 7 Field Type on page 101 for a general dis cussion of forced control fields You must use forced control characters only with one character control fields Column 18 Substitution Character When used in a summary sort job the character you enter into this column is the one that is put into the overflow indicator field each time an overflow does not occur You can use any character If you do not enter a character none is put into the output record Column 19 Continuation Any entry put into this column links the field specification to the previously entered field specification This is required when several field specifications are needed to define how a single field is processed such as during a conditional force when the control field character is replaced by another character and several possibilities are to be specified If this column is left blank the system assumes the field specification is for a new field 108 Sort User s Guide and Reference Columns 20 through 22 Overflow Field Length Summary Sort The entry in these columns is a number from 1 to 256 In summary sort jobs the data fields that are summarized are used to contain the totals in the output record It is possible however that these totals can require more space than the summary data field allows The length of this new overflow field should not exceed the maximum length for the output record The overflow
163. ing Combination of Sei on Sort Single pronunciation Pronunciation Sequence and Kanji ascending rule kiyaku kiyaku 2 customer kyaku kiyaku 3 reverse gyaku kiyaku 4 for conscience kiyasume kiyasume 5 sake rejection kyakuka kiyakuka 6 move backward gyakukou kyakukou 7 scream with kyah kiyaa 1 laughter 130 Sort User s Guide and Reference Japanese Telephone Book Sorting Example The following example illustrates sorting a person s name by telephone book type sort while the person s title is manager The DBCS sort program requires one control field to sort into telephone book sequence The example shows the field specification entries that generate the control field when the field in the input records contains four DBCS characters The input layout file is as follows From To Explanation 1 10 Kanji field with So and Si person s name 11 16 Kanji field with So and Si title 17 64 Other information HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification el Statement R s A RIO da th Output Type e Maximum e 1 eju f T s Control q tC s t ET y SORTR e Field u o elp me Number p SORTRS r Length e Reserved Sl rju Reserved Comments fe Sh e SORTA v n e
164. inition 149 150 Hanja definition 149 150 header specification 5 81 alternative collating sequence 84 120 column entries 82 column summary 82 111 comments 85 differences from System 36 Sort Utility 113 file name 85 include exclude control field 84 maximum control field length 83 output file type 83 page 83 sort sequence 84 SORTA entry 83 SORTR entry 83 SORTRS entry 83 specification identifier 83 statement number 83 Help key 16 Hiragama definition 149 identifier comment specification 111 specification field specification 101 158 Sort User s Guide and Reference include record specifications 89 include input records 87 include set definition 150 include all specifications 68 include exclude control field header specification 84 including input records 89 indicator field overflow definition 150 indicator summary overflow field specification 108 input fields start end positions 8 input file name 75 input files 10 device file 11 processing 11 same as output file 12 security 10 sequential processing of 11 single 17 used by several programs simultaneously 12 input library name 75 input member name 75 input record accessibility 9 changing 8 format 12 include exclude 87 including 89 input field location of 107 length 11 omitting 89 type 7 inserting characters into sort sequence 122 interactive entry of specifications 4 internal tables 78 international date format 98 interpreting alphanu
165. inition of a new record type A This specification is in an AND relationship with the previous record specification This specification is in an OR relationship with the previous record specification 0 Identifies this specification as a comment specification 8 C Factor 1 and Factor 2 must contain character data Z Factor 1 and Factor 2 must contain character data and the zone portions of the binary representation of the characters are to be used for the comparison Factor 1 and Factor 2 must contain character data and the digit portions of the D characters are to be used for the comparison Factor 1 must contain signed packed numeric data If Factor 2 is defined it P must also contain signed packed numeric data Factor 1 must contain signed zoned numeric data If Factor 2 is defined it must U also contain signed zoned numeric data 9 12 1 9999 The start position of the Factor 1 field This can be left blank 13 16 1 9999 The end position of the Factor 1 field If columns 9 through 12 are blank this entry defines a Factor 1 field that is one character long in the position specified 17 18 EQ Factor 1 must equal Factor 2 NE Factor 1 must not equal Factor 2 LT Factor 1 must be less than Factor 2 GT Factor 1 must be greater than Factor 2 LE Factor 1 must be less than or equal to Factor 2 GE Factor 1 must be greater than or equal to Factor 2 19 C Factor 2 is a constant F Factor 2 is a field in the input record K Factor 2 is a keyword
166. irst level text Chapter 1 Introduction 15 e A blinking cursor is repositioned at the input field in error e The input field in error is highlighted in reverse image e The keyboard is locked that is pressing any keyboard key has no result e An alarm beep sounds Correcting the Error If you know how to correct the error from the information provided in the error message press the Error Reset key enter the corrected information and continue your work If the error message is not sufficient for you to decide how to handle the error press the Help key This displays additional information about the error and describes how to correct it Note Running a sort job can cause messages that are not part of the Sort utility to be displayed In such cases press Help to obtain further information and then refer to the appropriate user s manual if necessary Control Language Command Help For more information about a command use one of the following procedures e Type the command with or without parameters on any command line and press F4 Prompt The prompt display for that command is displayed From here you can press Help for more information about the command and its parameters e Choose a menu selection that prompts you for parameter values before a command is run and press Help on the prompt display 16 Sort User s Guide and Reference Chapter 2 Sorting Records from a Single File The Sort utility can sort record
167. is a value based on the sequence position of phonetic characters that determines the output order of DBCS characters that otherwise compare equal DBCS Code Sequence lf all the sort criteria are the same for any two DBCS characters in sequences 1 to 6 in Figure 33 on page 135 the characters will be ordered based on their internal hexadecimal representation Simplified Chinese Strokes Radical Sorting Example The following example illustrates sorting a person s name by Strokes Radical sequence for employees working in the Purchasing Department The DBCS sort program requires one control field to sort into this sequence This example shows the specifications required to generate the control field if the field in the input records contains four DBCS characters The input layout file is as follows From To Explanation 1 10 Simplified Chinese field with SO and SI person s name 11 30 Simplified Chinese field with SO and SI department name 31 64 Other information HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Program Identification 1 Statement R s A RO Eg Output Type e Maximum e 1 eju E T s Control q tC s t 1 y SORTR e Field u o elp L1 Number p SORTRS r Length e Reserved Sl rju Reserved C
168. jay pid p R s jc 1 e e e ju fo Number Start End c b jn JA Reserved Comments 4 C K ols t jl fe od ZL r t Ji ts of D E d i jn e of D P I t ju q of N V J u ja 4 of 0 U R t jt 7 F M S e i de cf F S H T o f 3 4 5 6 7 Ps 9 10 11 12 13 14 15 16 17 18 19 en 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 72 F D C 1 6 I T E M N O Fi I Ej L D i F D C 2 21 9 Q T R T O T A L Fy I E L D i F D C 1 1 1 3 Ol Uj T L I S TIS F I E L D r F D C 1 4 1 9 D A T E F I Ef L D y fe op E 4 A fe sh lb These four specifications define four data fields to be taken from each input record The data fields are specified in the same way as the previous record type Because the header specification omitted the control fields from the output record the two control field elements are respecified here as the first two data fields of the output record Chapter 2 Sorting Records from a Single File 29 Processing These Specifications The FMTDTA command that could be used to process the specification is Specified on FMTDTA Command Explanation FMTDTA INFILE PROD SALEHIST The input records are to be taken from the fi
169. k area 13 number of records copy only requests 13 numeric constants Factor 2 field 97 numeric data interpreting 93 signed 92 numeric fields 91 packed format 91 zoned format 91 O omit record specifications 89 omit specifications 68 omitting input records 89 opposite control field 102 150 field specification 102 output option 106 opposite control field definition 150 opposite sorting 29 optional attributes of output file 11 optional specifications 6 OPTIONS CHK 78 DUMP 78 NOCHK 78 NOPRT 78 NOSECLVL 78 SECLVL 78 keyword value options parameter 78 OR a record specification 90 OR extension 108 to forced field 108 160 Sort User s Guide and Reference order of field specifications in source file 99 order of fields 99 order of specifications 2 78 ordering specifications 6 output file 11 150 header specification 83 physical 17 35 67 record address 41 record length 11 same as input file 12 storage 13 type 83 output file parameter FMTDTA command 76 output record building of 7 creation 10 exceeding maximum length for 109 format 12 length print file 12 order of fields 7 padding with blanks 7 102 type 7 output redirecting 12 overflow field 48 field length 109 handling overflow 48 indicator 48 64 indicator field specification 108 overflow field definition 150 overflow indicator field definition 150 overflow indicator definition 150 overriding defaults 11 source file
170. lacing a single character or all characters are based on an input record that has not been changed by the alternative collating sequence Any control field specification that has an A in column 20 must not be packed or zoned Do not code a P or U in column 8 If you specify an alternative collating sequence for a particular input field this sequence will be applied to any other input record type that uses the same input field as part of its control field The alternative collating sequence will apply only to the specified normal and opposite control fields that were indicated in this way ALTSEQ specifications never change data fields in records or forced control field characters Characters defined for an alternative collating sequence could be inter preted as other data fields Appendix C Standard and Alternative Collating Sequences 121 How to Code an ALTSEQ Specification For each character whose collating sequence you want to change from the standard EBCDIC enter the original hexadecimal value followed by the new hexadecimal value into the ALTSEQ specification The system then sorts the char acter according to its new position relative to the other characters You can code as many changes into one ALTSEQ specification as will fit WECECHECECEEROCSAGES Figure 31 How You Code an ALTSEQ Specification Use the following steps to code ALTSEQ specifications You can code them onto any Sort specifications form 1
171. le You may insert comment specifications where they are most useful Sequencing the Specifications The Sort utility orders the specifications by occurrence in the source member This order shown in Figure 4 is 1 The header specification 2 ALTSEQ specifications if any These specifications are optional 3 One or more record specifications 4 One or more field specifications for each record specification Follow the record specification by the field specifications that pertain to it Repeat steps 3 and 4 for each input output record type desired The Purpose of Record and Field Specifications Together record and field specifications determine the records to be sorted the sorting order and the information that will be written to the output file If all input records are to be sorted in the same way no record specifications need to be entered the field specifications are entered by themselves and apply to all input records A sort program could thus consist of only two specifications a 6 Sort User s Guide and Reference header specification and a field specification to define the control field When run all input records would be sorted according to the data in the control field Record Types Record specifications define which records are to be selected from an input file At least one record specification each grouping is called a set is needed to define a type of record Entering the first of a seri
172. lumn entries that are this example are described FIELD SPECIFICATIONS important to Statement F D Field Location Forced Overflow i ja Charac Field T Je t T ters Length y l jay p d p R S C E e e ju jo Number Start End c b n JA Reserved Comments CK o s jt 1 Zs r t i tS DE d i jn e D P I t ju q N JV J u ja a 0 JU R t it F IMS e i F IS HT o B n jA 3 4 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 F D C 7 2 1 2 8 FIU EJAT D 7 Fl DI Cc 6 6 7 1 F I EJE D 6 F D C 5 2 6 5 F I E L D 5 F D C 4 8 5 1 F I ENU D 4 F D C 2z 4j 7 FIT E L D 3 F DIC ki 2 1 F I ENE D 2 F D C 1 2 F I E L D 1 eel da he ha he ee ee RS Note that the entries in columns 9 16 reorder the fields on the output record in the reverse order from what they are in in the input record Only the fields that are specified will appear in the output record Chapter 6 Copying and Merging Records from Several Files into One 71 Processing These Specifications Assuming that the input records are in the same input files the specifications are in the same source file and the output file is to be the
173. meric data 92 interpreting numeric data 93 interpreting the sign of anumber 94 J Jamo definition 150 Japanese character set Kanji definition 150 Japanese double byte character set definition 150 Japanese double byte character sets character sequences 129 character type 130 DBCS code sequence 130 radical 129 Sei On Katakana sequence 130 Japanese double byte character sets continued character sequences continued single pronunciation 129 strokes 129 tie breaker 130 character type 130 DBCS code sequence 130 radical sequence 129 Sei On Katakana sequence 130 single pronunciation 129 strokes 129 tie breaker 130 Japanese non Kanji character set definition 150 job summary sort 104 justification entering fields 4 K Kanji character set basic definition 150 Kanji character set extended definition 150 Katakana definition 150 key sequence 41 key sequence ascending definition 149 keyboard locked 16 keyed access path 11 keyed logical file 11 keying specifications 3 keyword Factor 2 record specification 97 UDATE 95 UDATE Factor 2 field 97 UDAY Factor 2 field 97 UMONTH 95 UMONTH Factor 2 field 97 UYEAR 95 UYEAR Factor 2 field 97 value for Factor 2 96 Korean character set non Hangeul non Hanja 150 Korean double byte character set definition 150 Korean double byte character sets pronunciation 142 sort tables 125 L length exceeding maximum for output record 109 Factor 1 and Factor 2 fields 92 Factor
174. mmary data field You can designate an overflow indicator in addition to overflow fields Examples Following are four examples that illustrate the summary sort feature 48 Sort User s Guide and Reference Example 1 Sorting a File and Summing Data in Certain Fields One Record Type This example checks certain stock items for shortages Here the input file contains all inventory transactions These are composed of three different record types according to the original data description inventory records receipt records and adjustment records The record code in column 2 I R or A of the input record identifies which of the three types the input record belongs to Only the records with an A in column 2 adjustment records are to be selected Figure 12 on page 50 shows part of the input file These adjustment records are sorted and the number of items QUANTITY ORDERED field is totaled for each item identified by the item number in the ITEM NUMBER field The ITEM NUMBER field therefore is the control field and the QUANTITY ORDERED field is the summary data field The output records are 14 columns long the first 8 columns contain the control field data the item number and the last 6 columns contain the totals for each item The output records are sorted so that the item numbers are in ascending order according to the standard EBCDIC collating sequence for character data There will be as many output records as there ar
175. n Aid e ADTS 400 Screen Design Aid for the System 36 Environment SCO9 1893 Short title ADTS 400 Screen Design Aid for the System 36 Environment e ADTS 400 Source Entry Utility SCO09 1774 Short title ADTS 400 Source Entry Utility e Backup and Recovery Advanced SC41 3305 Short title Backup and Recovery Advanced Copyright IBM Corp 1994 Data Management SC41 3710 Short title Data Management System Operation for New Users SC41 3200 Short title System Operation for New Users CL Programming SC41 3721 Short title CL Programming CL Reference SC41 3722 Short title CL Reference Programming Reference Summary SX41 3720 Short title Programming Reference Summary Publications Ordering SC41 3000 Short title Publications Ordering 147 148 Sort User s Guide and Reference Glossary active sort table A system supplied DBCS sort table that contains the collating sequences for all defined double byte characters in a double byte character set These tables are maintained by the character generator utility function of the Application Programming Tools licensed program alternative collating sequence A user defined col lating sequence that replaces the standard EBCDIC col lating sequence ascending key sequence The arrangement of data in order from the lowest value of the key field to the highest value of the key field Contrast with descending key sequence binary 1 Pertaining to a system
176. nal force applied to the control field A force all specification must be the last in a series of conditional force spec ifications Note that you need one conditional force specification for each character you want to change in the control field For example e If the control field contains a C replace it with a 1 e If the control field contains an F replace it with a 2 e lf the control field contains a replace it with a 3 e lf the control field does not contain a C an F or a put an X into it Enter a separate conditional force field specification for the first three cases and a conditional force all specification for the last case A conditional force all field is specified in the same way as an unconditional force field except that it is related to the preceeding statements using a continuation character in column 19 If you do not place a force all statement after a conditional force line and the Sort utility does not find the specified characters in the control field of the input record then Sort will e Replace the control field character with X FF if you specified ascending sequence in the header statement e Replace the control field character with X 00 if you specified descending sequence in the header statement Chapter 10 Field Specifications 103 Note If however the series of conditional force statements are entered as contin uation specifications of a normal or opposite control field any charact
177. nd Chapter 7 The Format Data FMTDTA Command describes this method What Happens when You Use the FMTDTA Command The following section provides a general description of processing 1 Select records The FMTDTA command first processes the information in the header specification and copies each input file into a work area in main storage Only those records that are identified by the selection criteria on the record specifications will be copied Be aware that once the records matching one record type are selected they are no longer accessible for further selection Thus the number of input records available for processing decreases with the specification of each new record type This method of selection can be regarded as a limitation but it also means that by arranging your record types carefully you can maximize the sort process by entering a minimum number of specifications Chapter 1 Introduction 9 2 5 Reformat records The utility then restructures each input record according to the data field specifications for the record type It takes sections of the input record then changes and repositions them to create the output record Putting together the control field For each record type you can specify one or more elements from the input record to make up the entire control field The total length of all these elements must not exceed the length entered in columns 15 through 17 of the header specification
178. ns 17 through 18 Comparison Operator Although all entries are valid for Hangeul characters only EQ and NE are mean ingful when Factor 1 and Factor 2 contain all other DBCS characters Column 19 Type of Data Contained in Factor 2 Enter to allow a DBCS data type field in the input record Factor 1 to be compared to a DBCS constant that will be represented for example by SOKKKKSI DBCS constant Enter S to allow a DBCS constant to be shifted one byte to the left A blank will be placed on the right Factor 2 as a constant may contain shift in or shift out characters that are not defined as part of Factor 1 If Factor 2 is a DBCS constant then it must be delimited by shift out SO and shift in SI on the record specification If shift in is not included in the Factor 2 comparison the length of Factor 2 must be specified as the length of Factor 1 minus 1 Note For packed data Factor 2 must be the same size as the Factor 1 field Appendix D Sorting Double Byte Character Sets 127 FIELD SPECIFICATIONS Statement Field Location Forced Overflow Charac Fiel T vox Number E Br ZCHVOND Husem ra ovk Start End 9 10 11 12 13 14 15 16 ters Length 17 o n jA Reserved Comments t i n u q a t i o n iT A 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 X N
179. ns a Z Factor 1 field is alphanumeric but only 16 characters the digit portion of the character is to be used column 8 contains a D Factor 1 field is numeric in packed format 8 bytes equivalent to 15 digits and the sign column 8 contains a P Factor 1 field is numeric in zoned format 16 bytes equivalent to 16 digits and the sign column 8 contains a U the sign is included in the last byte Note To describe a one character Factor 1 field leave columns 9 through 12 blank and enter the number of the record position that contains the char acter into columns 13 through 16 end position Columns 13 through 16 Factor 1 End Position The entry in these columns identifies the end position of the Factor 1 field in the input record The entry must be right justified If columns 9 through 12 are blank an entry in columns 13 through 16 defines the location of a one character field in the input record Columns 17 and 18 Comparison Operator These columns specify how the contents of the Factor 1 and Factor 2 fields must compare in order for the input record to be used The possible entries are EQ Factor 1 must be equal to Factor 2 NE Factor 1 must not be equal to Factor 2 LT Factor 1 must be less than Factor 2 GT Factor 1 must be greater than Factor 2 LE Factor 1 must be less than or equal to Factor 2 GE Factor 1 must be greater than or equal to Factor 2 Chapter 9 Record Specifications 95 The collating sequence
180. ntical digit portions 93 identical zone portions 92 insertion into sort sequence 122 special 117 substitution field specification 108 forced definition 149 forced example 36 checking sequence 101 status of job 14 syntax System 36 Sort Utility 113 Chinese double byte character sets Simplified Chinese character type sequence 135 code sequence 136 radical sequence 135 single pronunciation sequence 135 sorting considerations 135 strokes beyond radical sequence 135 strokes sequence 135 tie breaker sequence 136 Traditional Chinese character sequences 139 character type sequences 139 code sequence 139 radical sequence 139 sorting considerations 139 strokes beyond radical sequence 139 strokes sequence 139 CL commands 4 ALCOBJ 10 12 DLCOBJ 10 12 DSPMSGD display message 15 154 Sort User s Guide and Reference CL commands continued FMTDTA Format Data See FMTDTA Format Data CL command language 73 STRSEU 4 coding negative constants into record specifica tions 97 collating sequence alternative by field 109 definition 149 order of sort records 10 using ALTSEQ specifications to describe 5 definition 149 determines comparison value 96 standard and alternative 117 System 38 Conversion Reformat Utility 115 column entries ALTSEQ specification 122 comment specification 111 field specification 100 header specification 82 record specifications 87 command language CL See CL commands command line entering FMTDTA command f
181. o Alphabetic Characters You can alter the normal collating sequence several of ways For example you can insert a character between two existing characters take a character out of the sequence or change characters put A where Z is and Z where A is Regardless of how you alter the sequence you must specify every character that is to be changed by the alteration For example if you want a dollar sign to be posi 122 Sort User s Guide and Reference tioned in the collating sequence between A and B change the normal sequence as follows Normal Altered Sequence Sequence IZrOammMVvUIOADS ITOAMmMVIUIOWSKDY Note For this sequence assign the dollar sign the same value as B B the same value as C continue this process until the has the same value as an unprintable character This produces the desired results because there are no printable characters between and J See Figure 28 on page 118 The ALTSEQ specification used to enter this alternative collating sequence is 1 2 3 4 5 6 7 8 910 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 43 44 45 A L T S E Q 5 B C 2 C 2 C 3 c 3 c 4 c 4 C 5 c 5 c 6 c 6 c 7 c 7 c 8 c 8 c 9 c 9 C A Columns Entry Explanation 1 6 ALTSEQ Identifies
182. o sort the reformatted output record The Data Description Field specifications allow you to completely restructure input records and build output records and sort them in any way you choose To enable you to do this the Sort utility ignores the data description already associated with the files it proc esses It treats both input and output files as unformatted strings of bytes the length of the string is determined by the record length As part of the sort specifications therefore you must define the input fields and the output fields and specify their start and end positions Sort then divides the data in the files according to these specifications and sorts and reformats the input records accordingly Ensure that the lengths of the fields you specify match the data in the file For example if positions 5 to 10 contain a date and positions 11 to 32 contain a name the start and end positions of your fields will probably be 5 10 11 and 32 Using FMTDTA to Process the Specifications Once the specifications for a particular job have been entered in a source file use the FMTDTA command and its parameters to run Sort Refer to Chapter 7 The Format Data FMTDTA Command for a complete description of how to use this command Note Running a sort job never changes your input files unless you specify the input file as the output file 8 Sort User s Guide and Reference As a Line Command Enter the command followed by th
183. o you Copyright International Business Machines Corporation 1994 All rights reserved US Government Users Restricted Rights Use duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp Contents Copyright IBM Corp 1994 Notices 2 i462 o 424 oS GeO Be Meee Soe Pe hee OER SARS ix Trademarks and Service Marks 2 20 00000002 ix About This Manual 0 00022 ee xi Who Should Use This Manual 0 200000 eee een xi Chapter 1 Introduction 2 0 20200220204 1 General Description 00 000 02 1 How to Use Sort 2 2 a 2 Entering the Sort Specifications 0 00000 ee ees 3 Specifications Forms 0 0 0 0 00 0 3 Entering Specifications Interactively 2004 4 Contents of the Source File 0 0 200200 222 5 Types of Specifications ooa oaa 5 Sequencing the Specifications oaoa 2 20 20 00002 2 ee 6 The Purpose of Record and Field Specifications 6 Record TYDES eraa a T ha oe te ae a e 7 Selecting Control and Data Fields Building the Output Record 7 Building the Control Field aaa aaa 8 The Data Description 0 00000 deaa Daea 8 Using FMTDTA to Process the Specifications 8 As a Lihe Command ori 205 eAive jeu Re kh ee ee ee el hem ee 9 From Screen Displays 0 0 0 000002 e eee eee 9 What Happens when You Use the FMTDTA
184. of the digits 0 to 9 plus the sign of the number or In unpacked format each digit is composed of eight bits the first four bits form the zone portion and the last four bits form the digit portion The zone portion of the rightmost byte represents the sign Unpacked format is also called zoned format because it is the addition of a zone portion to each digit that unpacks the format In packed format each digit is composed of only four bits The rightmost four bits of the entire number represent the sign for the number rather than a digit Because Sort reads the input record as a sequence of unformatted bytes and bits column 8 specifies how many bits are to be assigned to each character For example in packed format each digit is represented by four bits in zoned format by eight bits Chapter 9 Record Specifications 91 When the fields contain alphanumeric data either the digit portion the zone portion or both portions of each character can be used When the fields contain signed numeric data you must specify whether the format is to be unpacked or packed Depending on which type of field you specify there are certain restrictions on the length of Factor 1 and Factor 2 fields The possible entries are shown in Figure 23 Column 8 Maximum Field Entry Compare Operations Length c Use both zone and digit 256 characters portions of the characters Alpha numeric lt 4 Z Use only the zone
185. ogram Identification Any name can be entered in these columns This entry is treated as a comment Chapter 8 The Header Specification 85 86 Sort User s Guide and Reference Chapter 9 Record Specifications Use record specifications to select the input records you want to process or to define which records you want to omit from processing If all input records are to be processed these specifications are not necessary Sort treats all input files as unformatted strings of bytes You must divide the unfor matted input file into the fields that are to be sorted or reformatted The record specification identifies the input records to be used sorted or omitted by identifying two fields called Factor 1 and Factor 2 It states what the contents of these two fields should be and what the relationship of these contents should be to each other in order for the input record to be processed During processing the Sort utility scans the input file for records whose contents match these conditions and includes or omits them from the sort Set of Record Specifications You can use one or more record specifications to establish all the conditions you want the input record to meet before being selected for sorting and reformatting Record Type Any difference in either the conditions established for the selection of an input record or the field specifications that define how these input records are to be processed is considered as a diffe
186. ol Language CL commands to enter and then process the appropriate instructions With Sort you can e Sort records from one file called the input file and store the result in a single physical output file This output file is called a physical file because it contains the actual records that were sorted You can also divide the input records into fields and reformat select and rearrange those fields in the output records See Chapter 2 Sorting Records from a Single File for examples Sort records from several input files and store the result in a single phys ical output file You can also divide the input records into fields and reformat them in the output records See Chapter 3 Sorting Records from Several Files for examples Sort records from a single input file and store the result in a single record address RA output file This output file does not contain the actual records that were sorted rather it contains a sorted list of addresses of the records in the original input file This has the advantage of keeping the sorted result up to date for changes to previously existing records However if you add or delete records from the input file the RA file does not have the addresses for the new records and will still contain the addresses of the old records See Chapter 4 Sorting Records from a Single File to Produce a Record Address File for examples Produce an output file containing totals rather
187. omments hed e SORTA v n e vit Ef e 1 256 c qle fi d e d H A Ss y F X 3 4 5 6 7 8 9 10 11 12 13 14 15 16 mia 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 72 0 O 1 H S OJ R T R 8 X N 0 C O N T R Of L eale a Hf Columns Entry Explanation 6 H Identifies that this is a Header Specification 7 12 SORTR This is a regular sort the output is to be a physical file 17 8 The maximum control field length is 8 characters 28 X The control field will not appear in the output record 40 72 Comments Identifies that the control field will be dropped 136 Sort User s Guide and Reference RECORD SPECIFICATIONS Statement C D Factor 1 Com F _ _ Factor 2 Constant ______ f f o ja pari la 7 T In t son c Factor 2 gt e 7 y t Jat Oper t Keyword A Number p i y Start End ator o Comments Z e n p Position Position r Factor 2 gt e 7 uje 2 Field Pot I Je c Ts ok 0 Z c Location L 4 JA D EQ NE F Loh o P LT GT K Start End L 4 3 4 5 6 5 3 9 10 11 12 13 14 15 16 aa 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s5 by 0 oO 2
188. on One or more comment specifications can be used to document the job that is being done so that you and other people will understand the sort process that is coded into the file The comment specification can be inserted anywhere in the file and can also precede the header specification RECORD SPECIFICATIONS Factor 2 Constant Statement Factor 1 Com vovo gt vo A Factor 2 e Keyword Number Start End ator Position Position Comments lt Factor 2 s Location On ova GUONG m i Start End LE GE 17 18 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 SSN NNR NN NN RR NR RS Figure 27 Comments Can Be Entered onto Header Record or Field Specification Forms Summary of Column Entries Table 1 summarizes the column entries for the comment specification Table 11 Summary of Column Entries for the Comment Specification Columns Entry Explanation 6or7 Identifies this specification as a comment specification 8 72 Any entry Comments Detailed Description of Each Column Entry Column 6 or 7 Specification Identifier Column 6 or 7 must contain an to identify this specificati
189. on as a comment specifi cation Columns 8 through 72 Comments These columns are available for comments Copyright IBM Corp 1994 111 112 Sort User s Guide and Reference Appendix A Information for System 36 Sort Utility Users Porting to the AS 400 System This appendix describes those differences between the AS 400 system and System 36 that affect the way you enter Sort specifications Running a System 36 Sort Utility Job on the AS 400 System Your System 36 specifications will continue to work on the AS 400 system You should however be aware of the following items Header Specification Print Option Column 27 Although Sort will accept all of the options available in the System 36 Sort Utility assume the following 0 Prints sort specifications diagnostic messages and program status message 1 2 0r 3 This column is syntax checked but no printout is gener ated when the job is run Note No messages are displayed Ideographic Sort Column 35 Valid on DBCS systems only Support for ideographic fields e One Ideographic Character IGC field type is used e Multiple IGC fields are used Null Output Column 36 Within the AS 400 system the entry in this column is syntax checked only Output Record Length Columns 29 to 32 When the output file is an externally described file these columns are syntax checked Record and Field Specifications System 36 Sort Utility Level Support When you s
190. on bytes of storage 5 Add the storage required for the output file to determine the total amount of storage required to resequence the specified number of input records Tracking Any Problems When the processing of a sort job ends the system sets a return code If the job was successtul the return code is set to 0 if it was not successful the code is set to 2 Use this value to check the status of a sort job and to direct the system to perform certain tasks based on the result To access the return code value use the CL command RTVJOBA and its appropriate parameters The CL Reference manual contains information about this command Message and Help Information When you work with the Sort utility the system responds to your commands by processing them and also by providing messages These messages are displayed on your screen or sent to a printer Each message contains a minimum of three parts 5763SS1 V3R1MO 910329 IBM SORT MESSAGE S LINE 00001 MSGID FMT1080 SEVERITY 30 B Message Maximum control field length entry is greater than 256 Cause Columns 13 17 of the header statement contains numeric entry greater than 256 Recovery Choose the correct entry Resubmit the request 00005 MSGID FMT6010 SEVERITY 00 Message 1 error s found in source file in library mbr Recovery Correct any errors Resubmit the request 0 errors found in source file QFMTSRC in lib
191. onding to the original data definition for the input records 40 72 Comments Identifies the name of the field selected as a data field from the input record The field specification is followed by four more specifications each defining a new data field UNIT QTY DATE and ORDERNO corresponding to the original data description for the input records Notice the order in which these fields are entered into the source file represented by the number in columns 3 through 5 This is the order in which they will be put into the output record not the order in which they occur in the input record Chapter 2 Sorting Records from a Single Fie 21 Processing These Specifications An example of the FMTDTA command used to process these statements is given below Specified on FMTDTA Command Explanation FMTDTA INFILE PROD INVENTRY MONDAY The input records are to be taken from member MONDAY of database file INVENTRY in library PROD OUTFILE PROD NEWORD MONDAY The output records are to be put into member MONDAY of file NEWORD in library PROD The specifications are automatically taken from the first member of file QFMTSRC default source file in the library list The OPTION parameter defaults to CHK PR NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMATDTA command is entered from a display station Example 2 Sorting Two Types of Records from the Input File Example 2 al
192. one data type System considers each byte as one digit as for unpacked data Only the zone portions are added together Note When using summary data fields you must ensure that the data in the input file matches the data type given in the field specifications other wise the results are unpredictable e Enter the start and end position of that part of the input record that is to become the summary data field Like normal data fields the starting position need not be specified for a field that is only one position long To allow the Sort utility to also take data from type R records specify another record type by entering a second set of record and field specifications You need the new field specifications because the start and end positions of the ITEM NUMBER and SELLING PRICE fields for the R input records are different from those for the input records Chapter 5 Sorting Records from a File and Producing Totals 59 RECORD SPECIFICATIONS Statement C D Factor 1 Com F Factor 2 Constant f f o ja pari a U of T In t son c Factor 2 gt e 7 y t aT Oper t Keyword r S i Number p i y Start End ator o Comments E e n p Position Position r Factor 2 gt e is ff ule 2 Field ae I le c i 0 Z Location hy o
193. onstant ______ f f o ja pari la 7 T In t son c Factor 2 gt e 7 y t Jat Oper t Keyword A Number p i y Start End ator o Comments Z e n p Position Position r Factor 2 gt e 7 uje 2 Field Pot I Je c Ts ok 0 Z c Location L 4 JA D EQ NE F Loh o P LT GT K Start End L 4 3 4 5 6 5 3 9 10 11 12 13 14 15 16 aa 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 s5 by 0 oO 2 I c 1 2 2 o el al sl ol k xl xl x x x x kl KI KI kl tl cl ol ml e al ele 9 SRNE a e i 5 1 I of Hoy Columns Entry Explanation 6 I Specifies that the records described in this specification are to be included in the sort 8 c Identifies the data for Factor 1 and Factor 2 as character data The system will look at both the zone and the digit portions of each byte when comparing Factor 1 with Factor 2 9 12 12 Factor 1 field begins in column 12 of the input record 13 16 29 Factor 1 field ends in column 29 of the input record 17 18 EQ The data in the Factor 1 field must equal the data in the Factor 2 con stant for the input record to be selected for sorting 19 S The data in the Factor 2 field is constant and is shifted one column to the left before comparison 20 0 Represents the shift out character 21 38 KKKKKKKKKKKKKKKKKK The 9 two byte characters Purchasing Department to be compared 25 I Represen
194. ord is replaced 18 This contains the value that is substituted 19 An X in this column links the field specification to the previously entered field specification Here the last six specifications describe the same field 38 Sort User s Guide and Reference FIELD SPECIFICATIONS Statement Field Location Forced Overflow Charac Field Number T ouK asoon xANOCZO aera Br ZCHVOND Lu wan me a Start 9 10 11 12 End 13 14 15 16 17 18 ters Length R S A Reserved Comments asonm macan eraoE A 9 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 J N BNR RR NNN RR RRR RRR g aS G S esos e ae Sst OO 2 CO This field specification identifies the data fields to be included in the output records No start or end positions are specified therefore all the input data fields are to be included in the output The data in these fields is character data column 8 con tains a C Processing These Specifications Following is an example of a FMTDTA command that could be used to process this specification It is through this command that you state the five input files from which the input records are selected Specified on FMTDTA Command FMTDTA INFILE
195. portion 1 character Data of the character D Use only the digit portion 16 characters 5 of the character r 8 bytes or P Numeric data is packed 15 digits Signed plus sign Numeric4 Data Ux Numeric data is unpacked 16 digits zoned For both Factor 1 and Factor 2 fields Do not use a packed or zoned data type for Factor 1 field in an include or omit specification P or U in column 8 if you specify an alternative collating sequence S in column 26 in the header specification Figure 23 Column 8 Restrictions on Length of Factor 1 and Factor 2 Fields Note If an alternative collating sequence is specified ALTSEQ statements are present column 8 cannot contain a P ora U Only alphanumeric data can be compared Interpreting Alphanumeric Data Each EBCDIC character has two parts a zone portion and a digit portion Some characters may have identical zone portions or identical digit positions but no two characters can have an identical combination of zone and digit portions See Table 5 92 Sort User s Guide and Reference Table 5 Binary Representation of Selected AS 400 Characters Binary Representation AS 400 Character Zone Portion Digit Portion 3 0101 1100 1 1111 0001 2 1111 0010 3 1111 0011 4 1111 0100 5 1111 0101 6 1111 0110 7 1111 0111 8 1111 1000 9 1111 1001 0 1111 0000 K 1101 0010 0110 1111 P 1101 0111 blank 0100 0000 1 0 1111 0000 1 1 Note that the digit portion of a zero
196. put RA file has an arrival sequence access path A relative record number of minus one 1 indi cates the end of an RA file Each record selected for processing produces a 4 byte binary relative record number in the RA file When the relative record numbers are written to the output RA file they are blocked up to the record size Each output record represents a record in the input file The position of the record in the output RA file is the position the input record has after the sort When being printed or displayed the RA file is read sequentially to process the records in the input file As each relative record number is read it can be used to access the original file directly Copyright IBM Corp 1994 41 Automatic Updating An RA file is not a database object and does not have all the characteristics of a database file It only reflects the characteristics of the input file at the time that it was created it is not maintained dynamically as are database file access paths If the input file is changed after the RA is created you should be aware of the following Records added to the input file after the RA file is created cannot be accessed by the RA file If an RA file attempts to access a record that has been deleted from the input file an exception condition will occur Records that have been updated in the input file can still be accessed by the RA file and will reflect the new data field values When you sort a sin
197. put records have a one character control field that can be either 1 2 or 3 The zone and digit portion of each character is Character Zone Digit A 0101 1100 1 1111 0001 2 1111 0010 3 1111 0011 If you want the records resequenced in ascending order using the digit position of the control field characters enter D into column 8 The records will then be sorted in this order O NM If you want the records resequenced in ascending order using both the zone and digit positions enter C into column 8 The records will then be sorted in this order OnM Suppose you place a Z into column 8 and want the records resequenced in ascending order You can be sure that the records with an control field will precede the records with a 1 2 or 3 control field Because 1 2 and 3 have iden tical zone positions records with any of these numbers as a control field will be in the order in which they were encountered in the input file If you want to force characters into your data field place a V into column 8 and specify the character to be forced in column 18 That character will be placed in the first available data field position of the output record 106 Sort User s Guide and Reference Columns 7 and 8 Details Table 10 shows the possible combinations for columns 7 and 8 Table 10 Combinations of Column 7 and Column 8 Entries Column 7 Column 8 Maximum Field Length Nor 0 256 1 11 16 1 81 16 1
198. r 2 Constant F f o ja pari a f T n t son c Factor 2 gt e 7 y t aT Oper t Keyword L 4 Number p i y Start End ator o Comments E e n p Position Position r Factor 2 fd uje 2 Field tig oh I je c AME 0 Zz c Location fod JA D EQ NE F ae 0 P LT GT K Start End ki T x u LE GE S E 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 t A L L R E c 0 R D S of 1 t I N C L U D Ej D I N s of RT 2 1 of te of ESF Because all input records are to be processed no record specifications need to be entered as indicated by the above comment specifications Chapter 2 Sorting Records from a Single File 31 FIELD SPECIFICATIONS l A Statement F D Field Location Forced Overflow Fel i ja Charac Field Le oil T Je t T ters Length 4 y ll fay EREE a Sa 7 p d p R S C of e e elu jo ET Number Start End c b n JA Reserved Comments i Uk C K o fs jt 1 7 ZL r lt i ts 4 DE d i n e 7 D P I t u q L 4 N V J u a ef 0 U R t t L 4 F M S e i t 1 F S H T o AEE x B n A EA 3 4 5 6 7 8 9 10 1112 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 72 e E F
199. rary USELIB mbr SUMMARY 16 records read and 16 records selected from TESTS in library USELIB mbr TESTS 16 total records read and 16 total records selected 1 records placed in output file TESTOUT in library USELIB mbr TESTSOUT REQUEST SUCCESSFUL 12 25 91 08 40 40 gt L J Figure 7 A Sample Screen Display of Sort Messages EY A number indicating the seriousness of the error 14 Sort User s Guide and Reference Severity Meaning 00 Informational The message is for your information only no error has been detected and no reply is necessary It suggests that a function is either in progress or reached a normal successful com pletion 10 Warning A potential error condition exists A function may have been only partially completed for example some items in a list may have succeeded while others have failed Or the program may have taken a default to fill in missing input and the default chosen may not have been valid Thus the results of the operation may be dif ferent from what you intended and the program cannot determine if they are valid 20 Error A definite error has been detected but it is one for which automatic recovery procedures have probably been applied and for which processing has continued A default may have been used to replace erroneous input The results of the operation may not be valid 30 Severe error The error detected is too serious for automatic recovery and no defaults are possible I
200. rence in record type Each new record type must be defined by its own set of record specifications RECORD SPECIFICATIONS Statement Factor 1 Factor 2 Constant Number on poH E vo SUONG Start Position Position 9 10 11 12 13 14 15 16 F a c Factor 2 e t Keyword o Comments r Factor 2 e 2 Field Location F K Start End LE GE S 17 1 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 43 44 45 46 47 48 49 50 51 52 53 54 55 a N AAA NN SN Sa S A RNS SNR RW RRR TNR TNT Figure 22 Form Used to Enter Record Specifications Summary of Column Entries Table 2 summarizes the column entries for the record statements Table 2 Page 1 of 2 Summary of Column Entries for the Record Specification Columns Entry Explanation 1 2 00 99 Page number no entry required 3 5 000 999 Statement number no entry required Copyright IBM Corp 1994 87 Table 2 Page 2 of 2 Summary of Column Entries for the Record Specification Columns Entry Explanation 6 I The record is to be included in the sort 0 The record is to be omitted from the sort Identifies this specification as a comment specification 7 Blank This specification begins the def
201. ria of the specified comparisons are not to be included in the output file Following the omit specifications is an include all specification which specifies that all records not meeting the criteria of the specified omit comparisons are to be included in the output file All data fields in the input records are included in the output records Entering the Specifications Complete the following specifications Only those columns that are important to this example are described HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79 80 Page Identification Statement Output Type SORTR y Number p SORTRS e SORTA 3 4 5 6 7 8 9101112 R e s e r v e d 13 14 Maximum Control Field Length Reserved S1 Reserved Comments ecotec 1 256 poaosmcaomu o ae lt s0u0n oF a F X 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 43 44 45 46 47 48 49 50 51 52 53 54 55 a N H S O R T R SSN NNN NNR Se SS SS SR This header specification states that a copy only request is performed No control field information is needed on a copy only request because the records are copied in the order they are found No sorting is done 68 Sort User s Guide and Ref
202. rol field using character type sequence t 100 Sort User s Guide and Reference Table 8 Page 2 of 2 Summary of Column Entries for the Field Specifications Columns Entry Explanation 9 12 1 9999 The start position of the field This entry can be left blank 13 16 1 9999 The end position of the field If columns 9 through 12 are blank this entry defines a one character field in the position specified in columns 13 through 16 If columns 9 through 12 and 13 through 16 are blank the field is the entire input record 17 Any character The force character that is to be changed Also used for summary overflow indicator fields if so this is the character to be used as the overflow indicator 18 Any character The force character that is to be substituted Also used for summary overflow indi cator fields if so this is the character that is to be put into the overflow indicator field if there is no overflow 19 Blank This specification begins the definition of a field Any character This specification is a continuation of the previous field specification 20 22 1 256 Overflow field length used for summary sort only A column Alternative collating sequence by field 20 only 23 39 Blank Reserved 40 72 Any entry Comments Detailed Description of Each Column Entry Columns 1 and 2 Page and Columns 3 through 5 Statement Number Together these columns form a 5 digit sequence number Use the CHK option of the FMTDT
203. rom 9 comment specification 111 comments entering 5 field specification 109 header specification 85 location of comment specifications 111 record specification 98 comparing Factor 1 and Factor 2 fields 95 comparison operators description 96 EQ 96 GE 96 GT 96 LE 96 LT 96 NE 96 record specification 95 comparison using the collating sequence 96 conditional force conditionally forced character description 108 field specification 108 definition 149 conditional force continued force all control field 102 description 103 field 103 forced control field 102 forced field 103 constant Factor2 96 format of 97 signed Factor 2 field 97 constant value for Factor 2 96 constant value for Factor 2 record specification 96 continuation 108 continue begin record definition record specifica tion 89 control field alternative collating sequence 120 building of 8 23 changing content of 102 characters changing 104 composition of 83 definition 149 duplicate values 10 field specifications 102 forced conditional 103 definition 149 field specification 102 normal opposite 104 unconditional 104 length 83 maximum length in System 38 Conversion Reformat Utility 115 maximum length of 83 normal definition 150 field specification 101 102 omission of 83 opposite definition 150 field specification 102 output option 106 output option with opposite 106 packed 106 specifying data fields as 102 summary sort 48 zoned 106 control fiel
204. rst member of file SALEHIST in library PROD OUTFILE PROD ITEMSALE The output records are to be put into the first member of file ITEMSALE in library PROD The specifications are automatically taken from the first member of file QFMTSRC default source file in the library list The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FATDTA command is entered from a display station Example 3 Reformatting Records 1 The order in which you select the input fields to be processed determines the order in which they will appear in the output records Suppose you have an input record that looks like this FIELD NAME FIELD POSITION INPUT RECORD ITEM PRICE BAL REORD item price number reorder number per item in stock point 4 gt 4 gt lt gt 1 12 15 21 23 29 You want your output record however to look like this FIELD NAME FIELD POSITION OUTPUT RECORD ITEM REORD BAL You also want to reorder all the records by item number 30 Sort User s Guide and Reference Entering the Specifications To sort this file enter the following header record and field specifications Only those columns that are important to this example are described HEADER SPECIFICATIONS 12 73 74 75 76 77 78 79
205. rt utility only half of the original field will appear in the output record Also if a field that was originally defined to data management as a character field is speci fied by the Sort utility as a numeric field the output may not be as you expected Limitations on the Number of Records for Copy Only Requests The Sort utility can copy an unlimited number of records provided enough storage is available Although the Sort utility does generate tables during a copy only request the storage these tables occupy is insignificant in comparison to the amount of auxiliary storage available for the output file To determine the approximate number of records you can copy subtract 100 000 bytes from the amount of auxiliary storage you have available for your output file and divide the remainder by the length of the records you are copying Limitations on the Number of Records for Sort Requests The number of records that can be processed by a sort as opposed to a copy only request is also restricted by the amount of auxiliary storage available For sort requests this amount must be sufficient to hold both the output file and the work area constructed during sorting 1 Determine the length of the work records that occupy the work area for a sort request by adding together the following e The length of the output record e The total length of the control field elements that the Sort utility uses e The value 4 for the 4 byte binary relative
206. rter output records so that all record lengths for all record types are equal to the output file record length Normal and Opposite Control Fields N or O in Column 7 Normal control fields sort according to the entry in column 18 of the header specifi cation Opposite control fields sort opposite to the entry found in column 18 of the header specification Forced Control Fields F in Column 7 You can change the contents of a control field force them to be something else for the duration of the sort before they are used to sort or reformat the input record There are three types of forced control fields e Conditional depends on the data found in the input record e Conditional force all defines a value for records not meeting conditional force criteria e Unconditional forces a specified character into a control field A control field that is forced can be only one character long 102 Sort User s Guide and Reference The contents of columns 9 through 19 and the position of this specification relative to other field specifications in the same set determine if the forcing is to be condi tional conditional force all or unconditional See Column 17 Conditionally Forced Character on page 108 Column 18 Forced Character on page 108 and Column 19 Continuation on page 108 for information on how to fill out the field specifications when you are using forced control fields Conditional Forced Fields
207. s instructions reformatting Output file gt contains result sorted and reformatted records Figure 2 The Sort Process What Happens in Step 3 of Figure 1 1 Entering the Sort Specifications There are two ways to enter Sort specifications e Complete the appropriate specifications forms and submit them to be keyed into the system e Use the Source Entry Utility to enter the specifications directly Specifications Forms The three Sort specifications forms are shown in Figure 3 on page 4 and are fol lowed by a description of how to complete them Chapter 1 Introduction 3 HEADER SPECIFICATIONS 73 74 75 76 77 78 79 80 Page Program Identification AR i Statement R J A RIO tf Output Type e Maximum e 1 eju L1 T s Control q tC s t Ed y SORTR e Field u o elp Ff Number p SORTRS r Length e Reserved S1 rju Reserved Comments L 4 e SORTA v n e vit L1
208. s selected from a single file and produce a copy of the records that reflects the new order see Figure 8 It can also reformat select change or rearrange fields within each record Sort utility specifications from source file Input records from a single file The FMTDTA Database file or Device Command logical or physical file Output records sorted and possibly reformatted into a physical file Figure 8 Sorting and Reformatting a Single File into One Physical File The output is a physical file in the database meaning that it contains a sorted and reformatted copy of the actual input records When sorting a single file to produce a physical output file note the following e The output type on the header specification must be SORTR e The maximum control field length must be greater than zero e Field specifications must be entered to define the control field e You need not enter a separate field specification for each input field you want to appear in the output record If there are to be no changes in their order or content you can enter just one field specification that treats the entire input record as a single output field e The INFILE parameter of the FMTDTA command has only one value because only one input file is being specified Examples The following examples extract records from a single input file Example 1 Sorting
209. same output file as in Example 1 Copying a File with No Reformatting on page 68 enter the same FMTDTA command as in Example 1 Copying a File with No Reformatting on page 68 in order to process the specifications See below Specified on FMTDTA Command Explanation FMTDTA INFILE PROD DISKET1 MONDAY Specifies three input files all in library PROD PROD DISKET2 PROD DISKET3 OUTFILE PROD TRANSM The output file is TRANSM in library PROD Since a member name is not specified the output records are stored in the first member of the file SRCFILE TEST EXAMPLE The reformat specifications are taken from SRCMBR EXAMPLE4 member EXAMPLE4 in data file EXAMPLE which is in library TEST The OPTION parameter defaults to CHK PRT NODUMP and NOSECLVL The plus sign shown for continuations is not required if the FMATDTA command is entered from a display station 72 Sort User s Guide and Reference Chapter 7 The Format Data FMTDTA Command The CL command Format Data FMTDTA when used with the appropriate param eters processes a series of Sort specifications previously stored as a member in a library This chapter describes the parameters and options of this command and how to use it You must enter values for the first two parameters INFILE and OUTFILE The remaining parameters are optional Default values are assumed for parameters that you omit Accessing and Using the FMTDT
210. sequence S Alternative collating sequence across the entire control field F Alternative collating sequence for certain columns of the control field as specified by the field specifications for the control field Note For copy only requests this column must be left blank If an alternative collating sequence is specified you must enter the appropriate ALTSEQ specifications to define the alternative collating sequence ALTSEQ state ments if used must immediately follow the header specification Column 27 Reserved This column must be blank Column 28 Include Exclude Control Field in Output This column specifies whether or not the control field is to appear in the output records Possible entries are Blank The control field will appear as the first field in the output record X The control field will not appear in the output record Notes 1 Column 28 must contain an X for an RA sort 2 The control field will appear in the output records in the same format it was in when used for processing the records If however it was forced in any way altered by the field specifications or specified as being in packed format the control field data will appear quite different from the source fields from which it was constructed 84 Sort User s Guide and Reference Columns 29 through 39 Reserved These columns must be blank Columns 40 through 72 Comments These columns are available for comments Columns 73 through 80 Pr
211. so takes records from a single file and puts the sorted output records into a physical file this time however two types of input records are selected for sorting those with IM in columns 79 through 80 of the input record and those with IQ in columns 79 through 80 This distinction corresponds to two record types ITEMASTER and QTRSALES as originally defined by the record data description for the input file There is an additional condition placed on the second record type only the QTRSALES records containing dates greater than or equal to October 7 1989 are to be included in the sort For ITEMNO records the ITEMNO DESC SUPPLY and SUPPADR fields are to be included in the output record For QTRSALES records the ITEMNO QTRTOTAL OUTLISTS and DATE fields are to be included in the output record Both record types are to be sorted in ascending order in the output file based on the control field ITEMNO QTRSALES records that have the same ITEMNO are arranged in descending order based on the control field QTRTOTAL The two record types are merged in the output file The first record will be the ITEMASTER record with the lowest ITEMNO and following it will be the QTRSALES record with the same ITEMNO If more than one QTRSALES record has the same ITEMNO the records will be arranged in descending order based on the QRTOTAL field 22 Sort User s Guide and Reference Entering the Specifications To sort this file enter the following header r
212. specify the statement number Column 6 Specification Identifier This column must contain an H to identify this specification as a header specifica tion If it contains an the specification will be treated as a comment Columns 7 through 12 Output File Type These columns identify the type of output to be produced Possible entries are SORTR Output is to be a set of physical records sorted as specified a physical file SORTRS Output is to be a set of physical records a physical file There is to be only one output record for each input record type the output record con tains the summed totals of given fields for all input records of that type SORTA Output is to be a list of addresses of the records that were sorted a record address file These addresses are pointers to the input file Note You must put an X into column 28 in order to omit the control field from the output record The presence of control field data in an RA file would give meaningless results Columns 13 and 14 Reserved These columns must be blank Columns 15 through 17 Maximum Control Field Length These columns contain a number from 0 to 256 which will be the length used for the control field in the output record Shorter control fields will be left justified in this space and padded on the right with zeros The number entered must be right justified For example if you enter a 6 into column 16 only the system would assume that you entered a
213. stem printer The output file looks like the following ITEM NUMBER QUANTITY ORDERED 10012000 1 20011230 11 30010010 2 40016210 4 Item Quantity Number Ordered 1 89 14 Example 2 Producing Summary Totals Based on Two Input Record Types In this example you want to sum and sort the same file shown in Figure 12 on page 50 in the previous example Two input record types are specified inventory records record code I and receipt records record code R Both are reformatted in the same way the control field ITEM NUMBER followed by the summary data field SELLING PRICE Both types of input record are to be sorted by item number If there are multiple occurrences of an item number the selling prices are to be summed to produce a total selling price for each item number total sales 54 Sort User s Guide and Reference Figure 13 below shows the two record types and the significant input fields for this file INVENTORY RECORDS RECORD CODE ITEM NUMBER SELLING PRICE I 70015120 212 I 10012000 295 I 70015120 212 I I 50011230 325 I 50011230 325 I 20011230 515 I 40016210 42 I 40016210 42 I 50011230 325 I 10012000 295 RECORD ITEM SELLING CODE NUMBER PRICE 2 3 10 11 38 39 43 RECEIPT RECORDS
214. stroke radical sequence B Sort the Traditional Chinese control field into 128 2 byte characters 256 bytes character type radical strokes beyond radical sequence K Use the primary Hangeul pronunciation of Hanja 128 2 byte characters 256 bytes characters L Use the secondary Hangeul pronunciation of 128 2 byte characters 256 bytes Hanja characters that start Korean DBCS words and primary Hangeul pronunciation for all other Hanja characters E Sort a Katakana control field in SEI ON 170 1 byte characters 170 bytes sequence I Sort the Japanese DBCS control field into single 128 2 byte characters 256 bytes pronunciation stroke tie breaker sequence J Sort the Japanese DBCS control field into single 128 2 byte characters 256 bytes pronunciation stroke radical tie breaker sequence R Sort the Japanese DBCS control field into 128 2 byte characters 256 bytes radical stroke tie breaker sequence S Sort the Japanese DBCS control field into stroke 128 2 byte characters 256 bytes radical tie breaker sequence Chapter 10 Field Specifications 105 Table 9 Page 3 of 3 Possible Column 8 Entries and Restrictions on Field Length Col 8 Character Portion Used Maximum Entry Field Length T Sort the Japanese DBCS control field into 128 2 byte characters 256 bytes character type order Note x Note that 3 is less than 0 and 5 is greater than 6 Suppose for example that your in
215. supported by the system Japanese Korean Simplified Chinese and Traditional Chinese force all A specification that tests if the control field in the input record contains a particular entry If it does not the control field character is replaced before the record is sorted forced character substitution The substitution of one character of the control field by another for sorting purposes forced control field A one position control field that results from replacing one character with another or from forcing a character into a control field position Hangeul A written language of Korea Each Hangeul character is composed of two to six Jamo characters Hanja Chinese characters used in Korean written lan guage Hiragana A native Japanese character set used mainly to express the pronunciation of native Japanese words Contrast with Katakana 149 include set Sequence specifications that identify one or more record types to be sorted Jamo Elements of Korean written language Korean alphabet Japanese basic Kanji character set A subset of Japanese DBCS consisting of commonly used Kanji characters There are 3 226 Kanji characters in this set Japanese extended Kanji character set A subset of Japanese DBCS consisting of less commonly used Kanji characters There are 3 487 characters in this set Japanese double byte character set An IBM defined double byte character set for Japanese consisting of the
216. t File Name before you run the sort job These names must already exist in the system All other parameters have default values which you can change if necessary Press F10 to display additional parameters Additional parameters are found on this display Format Data FMTDTA Type choices press Enter Additional Parameters Prints Niles ea e ran oe als QSYSPRT__ Name ETBra ys te bie Sete K Se a LIBL Name LIBL CURLIB Optionse s nk Sessa BoP ew CHK NOCHK PRT NOPRT for more values Program date 2 0 sice oe CURRENT Date CURRENT Bottom F3 Exit F4 Prompt F5 Refresh F12 Cancel F13 How to use this display F24 More Keys Figure 20 The Second FMTDTA Display When you have entered the option values you need Press Enter to begin proc essing or press F3 to exit without processing the command The Parameters of the FMTDTA Command In the description of the parameters that follow the defaults appear first The parameters are presented in the sequence you would follow when entering the command on the command line The parameter keyword is shown first followed by the corresponding prompt that appears on the FMTDTA prompt display INFILE Input file Specifies the names of the libraries files and members from which the input records are selected If you type a plus sign into this field you can enter up to eight input files file_name Enter the name of the file This is a
217. ta file identifier for the diskette unit file name specified member_name For database files enter the name of the member in which the source specifications are to be found The following parameters are shown on the second FMTDTA display PRTFILE Print file name Specifies the library and name of the printer device file to which the listing will be written The possible values for the file name are QSYSPRT The contents of this file are printed automatically by the system printer print_file_name Enter the name of a particular printer device file library_name The name of the library containing the print file Possible values are Chapter 7 The Format Data FMTDTA Command 77 LIBL The current library list The system searches this list for the printer device file The first file it finds with the specified file name is the one that it uses as the printer device file CURLIB The current library If you have not specified a current library QGPL is used library_name The name of the particular library where the printer device file is to be found OPTION Options Specifies the sequence checking and print options to be used If you specify more than one value for an option the last value specified will be the value that is used Enter a plus sign into the field to the right of the for more values to enter more than one value The possible options and their values are CHK The Sort specifications are sequence c
218. the specification as an ALTSEQ specification 7 8 Blanks 9 12 5BC2 The is given the same value as the B 13 16 C2C3 The B is given the same value as the C 17 20 C3C4 The C is given the same value as the D 21 24 C4C5 The D is given the same value as the E 25 28 C5C6 The E is given the same value as the F 29 32 C6C7 The F is given the same value as the G 33 36 C7C8 The G is given the same value as the H 37 40 C8C9 The H is given the same value as the I 41 44 COCA The is given the same value as an unprintable character Example 2 Making Characters Equal If you want one character to be considered the same as another both must hold the same position in the collating sequence For example you may want a blank to be considered a zero Therefore you need to define an alternative collating sequence in which the blank is the same as the zero because it holds the same position in the sequence Appendix C Standard and Alternative Collating Sequences 123 The corresponding ALTSEQ specification would look like this 1 2 3 4 5 6 7 8 910 11 12 13 14 15 16 17 18 19 20 21 aele ed TTT TT Columns Entry Explanation 1 6 ALTSEQ Identifies the specification as an ALTSEQ specification 7 8 Blanks 9 12 40FO The blank is given the same value as the zero Whenever a blank is read and used in a comparison it is considered to be a zero Thus if you were comparing the numbers 0036 and bb36 where b blank both wo
219. ting the fields in these specifications all entries must be right justified in the spaces provided unless otherwise indicated in the description If you enter anything that is not right justified the system pads your entry with zeros Entering a 1 that is not right justified for example could be interpreted as a 10 or a 100 depending on where you place it in the field Entering Specifications interactively Use the Source Entry Utility SEU to enter source statements Enter the specifica tions for a particular sort job into a member of a source file with SEU SEU is accessed through the CL command STRSEU The ADTS 400 Source Entry Utility SC09 1774 describes how to use the Source Entry Utility 4 Sort User s Guide and Reference Contents of the Source File The sort specifications you enter are stored in a member of a source file The types of specifications and the rules regarding the sequence in which they must appear are described below Types of Specifications There are five types of Sort specifications you can use to describe what you want sorted and how The header specification describes general information such as output file type and collating sequence used There must be only one for each sort job Chapter 8 The Header Specification describes all the possible entries The ALTSEQ specifications are optional If you want a collating sequence other than the standard one use these specifications to d
220. tion 2 Code the required ALTSEQ specifications to immediately follow the header spec ification Sort will apply these changes to the entire job The appropriate characters are changed in all input records before any processing is done this means that the selection of input records as stated on the record specifications for the job is based on the changed characters as specified in the alternative collating sequence Forced characters and any other constants and comparisons will also be changed and controlled by the alternative collating sequence Note Do not use packed or zoned Factor 1 or Factor 2 fields in an include or omit record specification P or U in column 8 if you specify an alternative col lating sequence on the entire control field You can only do so when you are using an alternative collating sequence only on specified parts of the control field Specifying an Alternative Collating Sequence on Parts of the Control Field To specify an alternative collating sequence for normal and opposite control fields 1 Enter F in column 26 of the header specification 2 Code the required ALTSEQ specifications immediately following the header spec ification 3 Enter an A in column 20 of those field specifications that define an input field that is part of the control field and to which the alternative collating sequence applies Be aware that Record selection including or omitting records and conditional force rep
221. to be included These record spec ifications are also known as include specifications 0 The record that is being identified is to be omitted These record spec ifications are also known as omit specifications The record specification is being treated as a comment If there are no conditions specified meaning that columns 7 to 39 of the record specification are blank Sort will use all the input records that were not used by previous include or omit record specification sets Such a record specification also known as an include all specification must be the last in a series of record specifi cation sets Only one such blank record specification can be used per sort job You can also omit the blank record specification If field specifications are entered on their own that is without being preceded by record specifications for a record type Sort assumes the field specifications apply to all the remaining unprocessed input records Again such field specifications must be the last ones entered for the particular sort job Column 7 Begin Continue Record Definition Column 7 is used to either begin a record specification set or to continue one by specifying new criteria to be met The possible entries are Blank This specification is the first of a set of include or omit specifications for a particular input record type A This specification is part of the definition of a record type It is in an AND relationship with the pr
222. ts the shift in character 40 72 Comments Identifies that two Kanji characters are being compared Appendix D Sorting Double Byte Character Sets 141 FIELD SPECIFICATIONS Statement Field Location Forced Overflow T asoon vox Number onoz 34 5 a aera BEECH VOND Husem ra ovk Charac Field ters Length S Start End A Reserved Comments asonan7 UETA X N A 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 43 44 45 46 47 48 49 50 51 52 53 54 55 2 9 S R S E Q U E N C E EREE 2 CO SNR RRR RN RRR RRR RRR RRR Columns Entry Explanation 6 F Identifies that this is a field specification 7 N Identifies the field as a normal control field The control field data is not forced modified before it is used to control the sort 8 H The data field contains a DBCS control field using character type strokes radical sequence 9 12 2 The data field begins in column 2 of the input record 13 16 9 The control field ends in column 9 of the input record 40 72 Comments Identifies the sort as a Strokes Radical sequence Sorting Considerations for Korean Double Byte Character Sets The Korean double byte character set consists of two distinct types of
223. ual input records Copying records in this way has two aspects e Specifying Sort options with no reformatting of records e Copying records and at the same time reformatting the output These two aspects follow the same rules as previously stated for example up to eight input files can be specified When copying and merging records from several files into one to produce a single physical output file note the following e Enter SORTR as the output type on the header specification e Enter 0 as the maximum control field length as there is to be no control field This also implies that columns 15 to 39 of the header specification should be left blank because the entries in these columns all pertain to the sorting process e Enter record specifications if any conditions are placed on the input records selected for copying or merging e Enter field specifications if the input record is reformatted in any way Copyright IBM Corp 1994 67 Examples The following examples show the copying capabilities of Sort Example 1 Copying a File with No Reformatting This example illustrates how to copy records from a file without sorting Here records from three input files are to be merged into one output file The header and field specifications do not specify any control field information A number of omit record specifications see Column 6 Specification Identifier on page 89 are present records that meet the crite
224. uble byte character set Japanese 24x24 font table holds Copyright IBM Corp 1994 Japanese extended Kanji and user defined characters Korean 24x24 font table holds a subset of Hanja and user defined characters Traditional Chinese 24x24 font table holds a subset of primary Traditional Chinese all secondary Chinese and user defined characters Sim plified Chinese 24x24 font table holds user defined characters A 32x32 DBCS font table holds character images of a complete double byte character set including its user defined characters DBCS number The decimal value two through five digits in length that identifies a double byte character DBCS sort table A system supplied object that con tains sequencing information to sort double byte charac ters See also master sort table and active sort table descending key sequence The arrangement of data in order from the highest value of the key field to the lowest value of the key field Contrast with ascending key sequence Double Byte Character Set DBCS A set of charac ters in which each character is represented by 2 bytes Languages such as Japanese Chinese and Korean which contain more symbols than can be represented by 256 code points require double byte character sets Because each character requires 2 bytes typing dis playing and printing DBCS characters requires hard ware and supporting programs that are DBCS capable There are four double byte character sets
225. uld equal 0036 Note Use care when using D digit or U unpacked fields with an alternative sequence The sign in the number is stored as part of the number and could therefore be translated into a character that could be sorted the record could be positioned at an unexpected place in the file 124 Sort User s Guide and Reference Appendix D Sorting Double Byte Character Sets This appendix describes the requirements for sorting double byte character sets DBCS in the following languages e Japanese e Simplified Chinese e Traditional Chinese e Korean The ADTS 400 Character Generator Utility SCO9 1769 contains additional informa tion about creating and maintaining user defined double byte character sets and updating the DBCS Sort Tables Before you can sort double byte characters you must have the following e The DBCS version of the AS 400 system installed on your system e A DBCS capable display station if you want to display or enter double byte characters in your source file e A printer capable of printing characters in your language if you are going to print double byte characters e Sort tables DBCS master sort table The DBCS master sort table for each language contains the sort informa tion to specify for each user defined DBCS character in that language Every time you define a new character or make changes to an existing character you must update the sort information for that character in this
226. vit e 1 256 c qje bot d e d H A s yea i D F L l 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 0 O 1 H S O R T R 8 X N 0 C Of N T R Of L F IEJ L M f E i Columns Entry Explanation 7 12 SORTR This is a regular sort the output is a physical file 17 8 The maximum control field length is 8 characters 28 X The control field does not appear in the output record 40 72 Comments Identifies that the control field is dropped RECORD SPECIFICATIONS Lo of Statement C D Factor 1 Com F Factor Conatan a i o ja pari a 7 T In t son c Factor 2 gt e 7 y t aT Oper t Keyword fe ed Number p i y Start End ator o Comments 4 e n p Position Position r Factor 2 e 7 u e 2 Field L l I je c Lt 0 Z c Location 1 JA D EQ NE F fnt 0 P LT GT K Start End ff JU LE GE S Le i 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 43 44 45 46 47 48 49 50 51 52 53 54 55 72 e IA 0 0 3 I c 1 2 1 5 E Q S O K K K K I c O M P A R E 2 C H A R S A e IA LL e IA of vo
Download Pdf Manuals
Related Search
Related Contents
Main subject title, according to the doc properties Benutzung Bay Collection ShoreTel 265 IP Phone Quick Reference CR-3306 BT Rádio FM com Bluetooth® MANUAL DO USUÁRIO 抱っこひも等の安全対策について - 東京くらしWeb Manual de instruções Owner's Manual - AHI check out the user`s manual Amana Deepfreeze Upright Freezers User's Manual NX-700 Series/ NX-800 Series Copyright © All rights reserved.
Failed to retrieve file