1. INITIALIZE
INITIALIZE statement는 identifier-1에 기술한 데이터 카테고리에 따라 특정 값을 identifier-1에 설정하거나 REPLACING phrase가 지정되어 있는 경우는 identifier-2 또는 literal-1의 값을 identifier-1에 설정하는 구문이다. 기능적으로 한개 혹은 이상의 MOVE statement와 동일하다.
다음은 statement의 각 설정 항목에 대한 설명이다.
-
identifier-1
-
RENAMES CLAUSE를 가져서는 안된다.
-
값이 설정되는 receiving area로 다음과 같은 항목을 지정할 수 있다.
항목 설명 그룹 항목
Alphanemeric 데이터가 올 수 있다. REPLACING phrase가 있을 때 identifier-1이 alphanumeric group 항목일 경우 identifier-1의 하부 element 항목들은 REPLACING 절의 규칙에 따라 initialized 된다.
elementary 데이터 항목
Alphabetic, Alphanumberic, Alphanumeric-edited, DBCS, numeric, numeric-edited, internal/external floating-point의 카테고리에 속하는 데이터 항목이다.
-
-
identifier-2, literal-1
-
MOVE 또는 SET statement에서 sending area에 지정가능한 elementary 데이터 항목이나 literal을 지정할 수 있다.
identifier-1, identifier-2에 특수 레지스터를 지정하는 경우는 각각 MOVE statement에서 receiving area 또는 sending area로 지정이 가능해야 한다.
-
-
REPLACING phrase
-
REPLACING phrase에 지정한 데이터 카테고리와 identifier-1의 카테고리가 동일한 경우 identifier-2 또는 literal-1의 값이 identifier-1에 설정된다.
-
Floating-point 항목의 경우 NUMERIC 카테고리로 취급된다.
-
REPLACING phrase에 동일한 카테고리를 중복해서 지정해서는 안된다.
-
|
identifier-1, identifier-2, REPLACING phrase에 지정한 카테고리에 사이의 유효성은 내부적으로 체크하지 않는다. 따라서 사용자가 MOVE 또는 SET규칙에 맞는 데이터 항목 및 카테고리를 지정해야 한다. |
다음은 REPLACING pharse가 지정되지 않은 경우 identifier-1에 설정되는 값에 대한 설명이다.
-
identifier-1의 카테고리가 alphabetic, alphanumeric, alphanumeric-edited, DBCS인 경우는 Figurative constant space가 설정된다.
-
identifier-1의 카테고리가 numeric, numeric-edited, external floating-point인 경우는 Figurative constant zero가 설정된다.
-
identifier-1의 카테고리가 pointer인 경우는 Figurative constant null이 설정된다.