View previous topic :: View next topic
|
Author |
Message |
LinkinPark Warnings : 1 New User
Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
|
|
|
|
date w 7 n value 2002111
date-julian w 4 p 0
while
move date to date-julian
Why not get correct value in date-julian ?
i want the value of date-julian is X'2002111C', how can I code it ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
What is in date-julian after the move? |
|
Back to top |
|
|
bijumon
New User
Joined: 14 Aug 2006 Posts: 20 Location: Pune,India
|
|
|
|
Hi,
If you are using MOVE statement to move data from
date to date-julian, then it is an alphanumeric move that is taking place, this does not do a type conversion, instead of using the move statement try using the assignment operatior, i.e., '='
date-julian = date
This will do a type converted assignment.
Regards,
------------
Biju |
|
Back to top |
|
|
LinkinPark Warnings : 1 New User
Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
|
|
|
|
it works well instead of using move statement,
so is there any other difference between MOVE statement and assigment
operotr '=' ?
Thank you very much |
|
Back to top |
|
|
bijumon
New User
Joined: 14 Aug 2006 Posts: 20 Location: Pune,India
|
|
|
|
You are welcome :)
Major difference is that it does not do a type conversion, and the other difference that i know is like, you cant use assignment operator, i.e, '='
to assign the built in constant values, like:
WS-TEST-ALPHA = SPACES
WS-TEST-NUM = ZEROES
instead you will have to use MOVE.
:) |
|
Back to top |
|
|
noorkh
New User
Joined: 06 Mar 2006 Posts: 76 Location: Chennai
|
|
|
|
But while assigning any statement be careful it will not give any warning or abend but it will simply truncate your data and move it to output field.
So be cautious about assignment statement. |
|
Back to top |
|
|
|