Micro Focus mfsort command


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:

  1. mfsort instructions
  2. 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 SQ RECORD F,80

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值