No, you can Move Alphabetic data to Numeric, if the LValue is stored in Alphanumeric DataType (X).
See this sample Program.
Code:
EDIT IBMMF.EXPERT.FORUM(SAMPLE) - 01.36 Columns 00001 00072
Command ===> Scroll ===> 005
****** ***************************** Top of Data ******************************
000100 ID DIVISION.
000200 PROGRAM-ID. SAMPLE.
000300 DATA DIVISION.
000310 WORKING-STORAGE SECTION.
000320 01 A PIC X(2) VALUE "AB".
000321 01 B PIC 99.
000330 PROCEDURE DIVISION.
000600 PRA1.
000700 MOVE A TO B.
000701 DISPLAY "VALUE IS" B.
000704 STOP RUN.
****** **************************** Bottom of Data ****************************
The output is:
Code:
********************************* TOP OF DATA **********************************
VALUE ISA2
******************************** BOTTOM OF DATA ********************************
Quote:
01 A PIC X(5) Value HI
01 B PIC 9(5)
MOVE A TO B.
Gives u Soc7 Error,since ur moving alphabets to numeric field.Now:
Moving alphabets to numeric field at compile time will not give S0C7.
Code:
01 A PIC X(5) Value HI
01 B PIC 9(5)
MOVE A TO B.
You will get Compiler Error as:
Code:
IGYGR0145-S "HI" was not defined as a "SYMBOLIC CHARACTERS" figurative constant. "HI" was discarded.
IGYGR1080-S A "VALUE" clause literal was not compatible with the data category of the subject data item. The "VALUE" clause was discarded.