Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 788
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
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us