Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

NUMERIC NON-INTEGER to alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: NUMERIC NON-INTEGER to alphanumeric
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: 785
Location: Chennai, India

PostPosted: Mon Mar 31, 2008 8:21 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Mar 31, 2008 9:23 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 01, 2008 8:44 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue Apr 01, 2008 7:21 pm    Post subject: Reply to: NUMERIC NON-INTEGER to alphanumeric
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Casting a Binary Number to Numeric in... Bob Steinkraus Java & MQSeries 6 Tue Aug 09, 2016 5:58 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us