View previous topic :: View next topic
|
Author |
Message |
sam_duniya
New User
Joined: 21 Sep 2007 Posts: 6 Location: chennai
|
|
|
|
I am reteving a Curr_Date date field from table which is defind as S9(9) comp (ccyymmdd). I want to move this field to another working storage variable WS-DATE which is also a S9(9) comp field in the format 000yymmdd. so my small doubt is can i move it directly as
MOVE Curr_Date(3:6) TO WS-Date(4:6).
Whether it will work or not. I know it's a silly doubt but i had so much of date logic in this program, that i confused little bit.
Thanks in advance,
Sam |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
I have never seen reference modification used on comp variables.
I am under impression that this should be used for strings only.
Thanks,
Santosh. |
|
Back to top |
|
|
sam_duniya
New User
Joined: 21 Sep 2007 Posts: 6 Location: chennai
|
|
|
|
Can i have the other way of doing it.. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Yes.
Move Curr_Date to the ws-variable with declaration of usage diaplay format of same size and then use reference modification on ws-variable.
Hope this helps you. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
move it to an S9(6) comp field.
the reference modification will not work because you need to move 3.5 bytes.
reference modification will work for any datatype. whether your results are correct or not depends upon the definitions and what you are trying to do. |
|
Back to top |
|
|
Santoshdorge
New User
Joined: 27 Jun 2006 Posts: 48 Location: Pune
|
|
|
|
Dick,
I tried running reference modification on usage comp and comp-3 variableb but it;s giving me error compile time error.
here is the error
Code: |
IGYPS2214-S REFERENCE-MODIFIED DATA ITEM "D" WAS NOT DEFINED
WITH "USAGE DISPLAY", "USAGE DISPLAY-1" OR "USAGE NATIONAL".
THE STATEMENT WAS DISCARDED.
|
maybe this had to do something with compiler options but as of now
i am on the side that we can use reference modification on usage display variables only.
Please correct me if I am wrong.
Thanks,
Santosh. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Santosh,
Sorry, you are right.
I normally ref-mod on a group or redefined reference thus never encounter the compiler error. (or I did once and now automatically redefine fields that I will ref-mod). |
|
Back to top |
|
|
|