View previous topic :: View next topic
|
Author |
Message |
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi all,
can we move any data from alphanumeric to comp-3 or comp variables?
or do we need to move initially from alphanumeric to numeric and then move to comp variables?
Thanks!
Rathna. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi Ekata, I have gone thru that link but i couldn't understand the solution from the link
if you have any idea please let me know.
Thanks!
Rathna. |
|
Back to top |
|
|
arindam111
New User
Joined: 29 Nov 2006 Posts: 27 Location: India
|
|
|
|
I have just ran this code, it works. Its self explanetory.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST4.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77 A PIC X(4) VALUE '9999'.
77 B PIC 9(4) COMP-3.
PROCEDURE DIVISION.
1000-MAIN-PARA.
MOVE A TO B.
DISPLAY "B= " B.
1000-EXIT.
STOP RUN.
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If you do this, you must first check the x field for a valid numeric value. If the value in the A field were changed to 'QQ2*' you will have problems. |
|
Back to top |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
yes dick is rigth
if the alphanumeric contains the numeric value
then then it works
but if alphanumeris contains othere than numeric value then it not works
soc7 or maxcc |
|
Back to top |
|
|
|