简体   繁体   English

偶然发现FMTDTA(IBM i)

[英]stumbled on FMTDTA (IBM i)

I stumbled on some FMTDTA which seem to be a query/sort language that predates SQL in an old RPG System. 我偶然发现了一些FMTDTA,它似乎是一种在旧RPG系统中早于SQL的查询/排序语言。 I am trying to unravel it's usage. 我试图解开它的用法。

Example: 例:

Physical file layout: 物理文件布局:

ORNO         S      9 0     1     9 Order No       
ORCSTNO      A     10      10    19 Custno        
ORDAT        S      6 0    20    25 Order Date     
ORAMT        S     12 2    26    37 Order Amt  

Sort Criteria in PF source member ORDSRT: PF源成员ORDSRT中的排序标准:

HSORTR    25A                      Keyfields are 25 characters long - Sort Ascending
FNC  20  25                        KEY 1: ORDER DATE              
FNC   1   9                        KEY 2: ORDERNO                 
FNC  10  19                        KEY 3:  CUST NO                 
FDC   1  37                        Take whole record (1-37)       

Sort command 排序命令

FMTDTA INFILE((MYLIB/ORDHED)) OUTFILE(QTEMP/ORDHED)          
SRCFILE(MYLIB/MYSRC) SRCMBR(ORDSRT) OPTION(*NOPRT)       

Result: 结果:

successfully sorts by DATE/ORD#/CUST# 成功按DATE / ORD排序#/ CUST#

However, there are a few other lines in FMTSRC that I am not sure of their purpose. 但是,FMTSRC还有其他几条线路,我不确定它们的用途。 Examples: 例子:

FOU 
FOC
FNU
O C   1   1EQCD                    CANCELLED  
I C   8   8EQCB                    CREDIT NOTE
O C   1   1EQCX                    OMIT CANCELLED

Here's what those six lines mean: 以下是这六行的含义:

FOU

Col 6: F means it's a Field statement 第6列:F表示它是Field声明

Col 7: O means the field is an opposite control field 第7列:O表示该字段是相反的控制字段

Col 8: U means the field contains signed decimal data in zoned format 第8列:U表示该字段包含分区格式的带符号十进制数据

FOC

Col 6: F means it's a Field statement 第6列:F表示它是Field声明

Col 7: O means the field is an opposite control field 第7列:O表示该字段是相反的控制字段

Col 8: C means the field contains character data 第8列:C表示该字段包含字符数据

FNU

Col 6: F means it's a Field statement 第6列:F表示它是Field声明

Col 7: N means the field is a normal control field 第7列:N表示该字段是正常控制字段

Col 8: U means the field contains signed decimal data in zoned format 第8列:U表示该字段包含分区格式的带符号十进制数据

O C   1   1EQCD                    CANCELLED

Col 6: O means OMIT 第6栏:O表示OMIT

Col 8: C means Factor 1 and Factor 2 must contain character data 第8列:C表示因子1,因子2必须包含字符数据

Col 9: 1 is the starting position of Factor 1 第9:1列是因子1的起始位置

Col 13: 1 is the ending position of Factor 1 第13:1列是因子1的结束位置

Col 17: EQ means Factor 1 must equal Factor 2 第17列:EQ表示因子1必须等于因子2

Col 19: C means Factor 2 is constant 第19列:C表示因子2是常数

Col 20: D is the constant or keyword against which Factor 1 is compared 第20列:D是与因子1进行比较的常数或关键字

Col 40: CANCELLED is a comment Col 40:CANCELED是评论

I C   8   8EQCB                    CREDIT NOTE

Col 6: I means INCLUDE 第6栏:我的意思是包括

Col 8: C means Factor 1 and Factor 2 must contain character data 第8列:C表示因子1,因子2必须包含字符数据

Col 9: 8 is the starting position of Factor 1 第9:8列是因子1的起始位置

Col 13: 8 is the ending position of Factor 1 第13:8列是因子1的结束位置

Col 17: EQ means Factor 1 must equal Factor 2 第17列:EQ表示因子1必须等于因子2

Col 19: C means Factor 2 is constant 第19列:C表示因子2是常数

Col 20: B is the constant or keyword against which Factor 1 is compared 第20列:B是与因子1进行比较的常数或关键字

Col 40: CREDIT NOTE is a comment 第40栏:CREDIT NOTE是一条评论

O C   1   1EQCX                    OMIT CANCELLED

Col 6: O means OMIT 第6栏:O表示OMIT

Col 8: C means Factor 1 and Factor 2 must contain character data 第8列:C表示因子1,因子2必须包含字符数据

Col 9: 1 is the starting position of Factor 1 第9:1列是因子1的起始位置

Col 13: 1 is the ending position of Factor 1 第13:1列是因子1的结束位置

Col 17: EQ means Factor 1 must equal Factor 2 第17列:EQ表示因子1必须等于因子2

Col 19: C means Factor 2 is constant 第19列:C表示因子2是常数

Col 20: X is the constant or keyword against which Factor 1 is compared 第20列:X是与因子1进行比较的常数或关键字

Col 40: OMIT CANCELLED is a comment 第40栏:OMIT CANCELED是评论

Reference 参考

More on the stumbling. 更多关于绊脚石。 In SEU on the control line. 在控制线上的SEU。 IP? IP? and you can bring up a prompt line for sort Below I have RF F lines in the sort and I press f1 on the start position. 你可以提出一个排序的提示行下面我有排序的RF F线,我在开始位置按f1。 it won't auto prompt for me today when I press f4 or type something in wrong it won't find it but you can press f1 help when the prompt is up. 我今天不会自动提示我,当我按下f4或键入错误的内容时它将无法找到它,但是当提示符启动时你可以按f1帮助。 Then you translate it to something a little more modern. 然后你把它翻译成更现代的东西。 选择提示 提示rf 救命

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM