View previous topic :: View next topic
|
Author |
Message |
pa3lo
New User
Joined: 26 Mar 2007 Posts: 9 Location: Argentina
|
|
|
|
Hi everybody, i'm having problems moving a Numeric non integer var to a alphanumeric one.
I have this two variables:
10 WS-IMP-OPE-2 PIC 9(16)V9(2).
03 CI01-COD-FORMATO PIC X(1500).
and when i make MOVE WS-IMP-OPE-2 TO CI01-COD-FORMATO I get this error:
"WS-IMP-OPE-2 (NUMERIC NON-INTEGER)" and "CI01-COD-FORMATO (ALPHANUMERIC REFERENCE MODIFIED ITEM)" di d not follow the "MOVE" statement compatibility rules. The statement was discarded.
Could someone help me with this? I'm sure i have done this kind of moves and never got this error.
Thanks. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Are you on Enterprise COBOL for Z/OS?
Bur this is allowed.
Code: |
77 WS-IMP-OPE-2 PIC 9(16).9(2).
77 WS-IMP-OPE-1 PIC 9(16)V9(2).
77 CI01-COD-FORMATO PIC X(1500).
.
.
.
|
Code: |
.
.
.
MOVE WS-IMP-OPE-1 TO WS-IMP-OPE-2.
MOVE WS-IMP-OPE-2 TO CI01-COD-FORMATO.
.
.
. |
|
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
If you can use ref mod try:
MOVE WS-IMP-OPE-2(1:) TO CI01-COD-FORMATO |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I'm sure i have done this kind of moves and never got this error. |
Why would you do this? What would you want as a result when you move an 18-digit number to a 1500-byte field? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi,
Quote: |
I'm sure i have done this kind of moves and never got this error.
|
You probably moved something like PIC 9(18). - an integer. But why DO you want to make that kind of move? - just curious. |
|
Back to top |
|
|
pa3lo
New User
Joined: 26 Mar 2007 Posts: 9 Location: Argentina
|
|
|
|
gnanas wrote: |
Are you on Enterprise COBOL for Z/OS?
Bur this is allowed.
Code: |
77 WS-IMP-OPE-2 PIC 9(16).9(2).
77 WS-IMP-OPE-1 PIC 9(16)V9(2).
77 CI01-COD-FORMATO PIC X(1500).
.
.
.
|
Code: |
.
.
.
MOVE WS-IMP-OPE-1 TO WS-IMP-OPE-2.
MOVE WS-IMP-OPE-2 TO CI01-COD-FORMATO.
.
.
. |
|
Thanks gnanas, it worked quite well.
And for the questions about why i want to do this... i'm just doing exactly what i'm asked to do |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
pa3lo wrote: |
And for the questions about why i want to do this... i'm just doing exactly what i'm asked to do |
And another classic 'non-answer'...... |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
pa3lo,
How would you like an ans like that when you ask your next ques? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Sounds eerily like "I was just following orders. . ."
"Sorry i crashed the payment system. . . "
or
"Oops, the automatic dosage system issued incorrect medicines to the people in the Intensive Care Unit. . ."
Quote: |
i'm just doing exactly what i'm asked to do |
pa3lo,
most of us have to follow directions most of the time (even if we provided that direction). That doesn't mean that the directions should not be understood by the "followers"and when it makes sense, changed. When you have directions that are questioned by others (like the people who responded here) i'd suggest that you make sure you undstand why they are asking the question(s).
For this time thru, i'm sure you need to follow the "rule" in place, but over time you may be able to influence this and other "rules" that may have better alternatives. Many of us who contribute here did just that. . . I suppose much of that would depend on what you have in mind for your next 5, 10, or more years.
FWIW,
d |
|
Back to top |
|
|
|