牛骨文教育服务平台(让学习变的简单)
博文笔记

DFSORT——前三位不等于0(COMP-3, COMP)

创建时间:2012-11-16 投稿人: 浏览次数:179

Requirement: The first 3 not equal to 0


(1) 01 WS-A PIC S9(09) COMP-3.
Analysis:
S9(09) COMP-3, X"000000", range is 999999999- and 999999999+
Check the 3 leftmost digits, then the range will be 000000999- and 000000999+

There are 2 solutions here:
1. COND=(1,5,PD,LT,-000000999,OR,1,5,PD,GT,+000000999)
2. COND=(1,2,PD,NE,0,AND,3,2,PD,NE,0,AND,5,2,PD,NE,0)

(2) 01 WS-B PIC S9(09) COMP.
Analysis:
S9(09) COMP, X"F0F0F0"

1. COND=(1,2,EQ,X"F0",AND,3,2,EQ,X"F0",AND,5,2,EQ,X"F0")

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。