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
 
Can we move directly comp element into alphanumeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
jackal
Currently Banned

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Thu Jan 31, 2008 1:43 pm    Post subject: Can we move directly comp element into alphanumeric
Reply with quote

Hi All,
can we move directly comp element into alphanumeric.Thanks
i.e
pic 9(4) comp to x(15)
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jan 31, 2008 2:21 pm    Post subject:
Reply with quote

if the alphafield is an edit mask then the conversion will take place; otherwise the answer is no.
Back to top
View user's profile Send private message
jackal
Currently Banned

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Thu Jan 31, 2008 3:03 pm    Post subject: Reply to: Can we move directly comp element into alphanumeri
Reply with quote

If No, then will it give compilation error?run time error?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jan 31, 2008 5:38 pm    Post subject:
Reply with quote

????????????? you don't have access to a computer?
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Thu Jan 31, 2008 6:06 pm    Post subject: Reply to: Can we move directly comp element into alphanumeri
Reply with quote

The move should be okay
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jan 31, 2008 6:53 pm    Post subject: Re: Reply to: Can we move directly comp element into alphanu
Reply with quote

jackal wrote:
If No, then will it give compilation error?run time error?
Some times a little self-coding gives better answers...
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 965
Location: Richmond, Virginia

PostPosted: Thu Jan 31, 2008 6:57 pm    Post subject:
Reply with quote

Let's see now - a new user (above) says that the "move should be ok" (my emphasis).

Would you rather rely on this? Or, just spend one minute of your own time to test it, then you'll be the alphanumeric move guru.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jan 31, 2008 7:10 pm    Post subject:
Reply with quote

I spent the necessary minute to code and test a module.

moved comp, binary, & packed-decimal +50 to alpha. ok

moved comp, binary, & packed-decimal -50 to alpha. not ok, sign is not moved.

and this was cobol 2. so the conversion of the numbers will take place, but the sign will not be converted or moved.

which leads me to ask, since the conversion only half works, why do it?
Back to top
View user's profile Send private message
rag swain

New User


Joined: 17 Dec 2007
Posts: 33
Location: pune,INDIA

PostPosted: Thu Jan 31, 2008 7:52 pm    Post subject: Reply to: Can we move directly comp element into alphanumeri
Reply with quote

I completely agree with 'Phrzby Phil' and dbzTHEdinosauer. Only this is possible when comp variable is +ve. I did not give a thought about -ve at first sight. I should have done that one minute test. icon_redface.gif

No, of course not, i don't rely on this type of move which does have any existence in APLLICATION world.

Thank You.
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 Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
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

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