IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

NUMERIC NON-INTEGER to alphanumeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Mon Mar 31, 2008 8:07 pm
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Mon Mar 31, 2008 8:21 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Mar 31, 2008 8:35 pm
Reply with quote

If you can use ref mod try:

MOVE WS-IMP-OPE-2(1:) TO CI01-COD-FORMATO
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 31, 2008 9:23 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Apr 01, 2008 1:45 am
Reply with quote

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
View user's profile Send private message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Tue Apr 01, 2008 7:59 am
Reply with quote

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 icon_neutral.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Apr 01, 2008 8:44 am
Reply with quote

pa3lo wrote:
And for the questions about why i want to do this... i'm just doing exactly what i'm asked to do icon_neutral.gif
And another classic 'non-answer'......
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Apr 01, 2008 6:14 pm
Reply with quote

pa3lo,

How would you like an ans like that when you ask your next ques?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 01, 2008 7:21 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts Handling the numeric data in unstring... COBOL Programming 18
No new posts convert alphanumeric PIC X(02) to hex... COBOL Programming 3
Search our Forums:

Back to Top