Here describe the micro focus utility 'mfsort' usage, and give some samples:
Command Options
Usage: mfsort . . . TAKE [CHAR-EBCDIC|SIGN-EBCDIC] SORT|MERGE FIELDS (start,length,type,A|D,...)|COPY RECORD F|V,min,max USE filename ORG LS|SQ|RL|IX RECORD F|V|FCxxx|FVxxx,min,max [KEY (start,length,P|A|AD|C,...)] GIVE (with parameters as for USE) INCLUDE|OMIT COND=(condition) [FORMAT=type] INREC FIELDS=(field-specifier...) OUTREC FIELDS=(field-specifier...) MODS {exit-name=(exit-routine)}... SUM FIELDS=(sum-field-specifier)|NONE [FORMAT=type] OUTFIL GIVE STARTREC start-record ENDREC end-record INCLUDE|OMIT SAVE SPLIT OUTREC LINES/HEADER1/TRAILER1/HEADER2/TRAILER2/SECTIONS/NODETAIL
Detail Options
There are 2 types of command line syntax:
- mfsort instructions
- mfsort take instruction_file
Option 1, instructions are placed in command line directly.
Option 2: instructions are placed in a file, and use 'take' option set the file.
Notice: lines start with a star('*') in instruction_file are comment lines.
Instruction SORT/MERGE
SORT/MERGE is the key instruction; SORT and MERGE are mutually exclusive.
Syntax:
SORT/MERGE FIELDS=(field_instruction,…)
field_instruction ::=
(<start>,<length>,{<type>},<A|D>,...){,FORMAT=<type>}
|
Instructions |
Description |
|
SORT FIELDS=(1,2,NU,D) |
sort field start from 1, and length is 2 |
|
SORT FIELDS=(1,2,NU,D,5,2,CH,A) |
sort 2 fields |
|
SORT FIELDS=(1,2,D),FORMAT=NU |
use FORMAT instruction to define format |
|
MERGE FIELDS=COPY |
COPY |
There are common used data types:
|
Data type |
COBOL data type |
|
CH |
PIC X USAGE DISPLAY |
|
NU |
PIC 9 USAGE DISPLAY |
|
PD |
PIC S9 COMP-3 |
|
BI |
USAGE COMP |
Instruction USE
The USE Statement declares the input files, as well as record type, and record length, and the overall organization of the file.
Syntax:
USE <filename> ORG <LS|SQ|RL|IX> RECORD <F|V>,min,max [KEY …,]
Instruction GIVE
The GIVE Statement declares the output files, as well as record type, and record length, and the overall organization of the file.
More than one GIVE instruction can be used when we need to output multiply output files, for example:
GIVE DATA.SORTOUT1
GIVE DATA.SORTOUT2 ORG LS
GIVE DATA.SORTOUT3 ORG SQ
GIVE DATA.SORTOUT4 ORG

本文介绍了Micro Focus的mfsort工具的使用,包括SORT/MERGE、USE、GIVE等指令及其子指令,以及执行顺序和OUTREC样例。mfsort用于文件排序和合并,提供了丰富的选项来处理输入和输出文件,如指定输入输出文件格式、过滤记录、重定义输入输出记录等。
最低0.47元/天 解锁文章
3336

被折叠的 条评论
为什么被折叠?



