View previous topic :: View next topic
|
Author |
Message |
simha_it
New User
Joined: 05 May 2005 Posts: 30
|
|
|
|
anybody explain about National Datatype in cobol with examples?
Eg:
declared VAR1 PIC X(3) value '001'.
I want to convert above value into S9(5) comp-3,
Example have seen that, doing the above by using Var2 as 9(3) National.
01 Var2-x
03 Var2 PIC 9(3) National.
MOVE ALL X'00' TO Var2-x
MOVE Var1 (01:1) TO Var2 (02:01)
MOVE Var1 (02:1) TO Var2 (04:01)
MOVE Var1 (03:1) TO Var2 (06:01)
Could you plz tell me waht is the value of Var2? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
declared VAR1 PIC X(3) value '001'.
I want to convert above value into S9(5) comp-3, |
Has nothing to do with Natoinal. . . Unless i completely misunderstand what you want to do. If you are sure VAR1 will be numeric, simply move the NUMVAL of VAR1 to a comp-3 variable.
I don't understand why National is mentioned. . . |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Why not just experiment with this? Manual |
|
Back to top |
|
|
|