Download Sort User`s Guide and Reference

Transcript
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)+
SRCMBR(EXAMPLE3)+
The reformat specifications are taken from
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
1 2
73 74 75 76 77 78 79 80
┌──┬──┐
Program
┌──┬──┬──┬──┬──┬──┬──┬──┐
│ │ │
Identification
│ │ │ │ │ │ │ │ │
└──┴──┘
└──┴──┴──┴──┴──┴──┴──┴──┘
┌───────────┬─────────────────┬─────┬────────┬──┬────────────────────┬──┬──┬──┬────────────────────────────────┬──────────────────────────────────────────────────/
/──┐
│ Statement │
│ R │
│ S│
│A │ R│O │
│
/
/ │
├────────┬──┤
Output Type
│ e │Maximum │ e│
│l │ e│u │
│
/
/ │
│
│T │
│ s │Control │ q│
│tC│ s│t │
│
/
/ │
│
│y │
SORTR
│ e │Field
│ u│
│ o│ e│p │
│
/
/ │
│ Number │p │
SORTRS
│ r │Length │ e│
Reserved
│Sl│ r│u │
Reserved
│
Comments
/
/ │
│
│e │
SORTA
│ v │
│ n│
│e │ v│t │
│
/
/ │
│
│ │
│ e │(1─256) │ c│
│q │ e│ │
│
/
/ │
│
│ │
│ d │
│ e│
│ │ d│ │
│
/
/ │
│
│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 52 53 54 55
/
/72│
├──┬──┬──┼──┼──┬──┬──┬──┬──┬──┼──┬──┼──┬──┬──┼──┼──┬──┬──┬──┬──┬──┬──┼──┼──┼──┼──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┼──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──/
/──┤
│ │ │ │ H│ S│ O│ R│ T│ R│ │ │ │ │ 2│ 1│ A│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ S│ O│ R│ T│ │ I│ N│ P│ U│ T│ │ │ │ │ │ │ /
/ │
├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──/
/──┤
│ │ │ │ *│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ F│ I│ E│ L│ D│ S│ │ │ │ │ │ │ │ │ │ │ /
/ │
└──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──/
/──┘
Page
FIELD SPECIFICATIONS
┌───────────┬──┬───┬───────────────────────┬────────┬────────┬──────────────────────────────────────────────────┬───────────────────────────────────────────────────────────/
│ Statement │F │D │
Field Location
│ Forced │Overflow│
│
/
├────────┬──┤i │a ├───────────┬───────────┤ Charac-│Field
│
│
/
│
│T │e │t T│
│
│ ters
│Length │
│
/
│
│y │l │a y│
│
├──┬──┬──┤
│
│
/
│
│p │d │ p│
│
│R │S │C │
│
│
/
│
│e │ │ e│
│
│e │u │o │...
│
│
/
│ Number │ │ │
│
Start
│
End
│c │b │n │A .
│
Reserved
│
Comments
/
│
│ │ │C,K│
│
│o │s │t │l .
│
│
/
│
│ │ │Z,L│
│
│r │t │i │tS.
│
│
/
│
│ │ │D,E│
│
│d │i │n │ e.
│
│
/
│
│ │D │P,I│
│
│ │t │u │ q.
│
│
/
│
│ │N │V,J│
│
│ │u │a │ .
│
│
/
│
│ │O │U,R│
│
│ │t │t │ .
│
│
/
│
│ │F │M,S│
│
│ │e │i │ .
│
│
/
│
│F │S │H,T│
│
│ │ │o │ .
│
│
/
│
│* │* │B │
│
│ │ │n │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 56 57 58
/
├──┬──┬──┼──┼──┼───┼──┬──┬──┬──┼──┬──┬──┬──┼──┼──┼──┼──•──┬──┼──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┼──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──/
│ │ │ │ F│ N│ C │ │ │ 2│ 0│ │ │ 2│ 0│ │ │ │ • │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ S│ I│ N│ G│ L│ E│ -│ C│ H│ A│ R│ │ F│ I│ E│ L│ D│ │ │ /
├──┼──┼──┼──┼──┼───┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──•──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──/
│ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ • │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ /
└──┴──┴──┴──┴──┴───┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴─────┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──/
/──┐
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/ │
/72│
/──┤
/ │
/──┤
/ │
/──┘
Chapter 2. Sorting Records from a Single File
33