MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL Move

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rajeev5174
Beginner


Joined: 05 Jun 2007
Posts: 25
Topics: 10

PostPosted: Tue Mar 20, 2012 11:55 am    Post subject: COBOL Move Reply with quote

Hi,

I have field which is x(23), can i move the field to 9(9) comp field with out any truncation to happen.

Regards
Rajeev V
Back to top
View user's profile Send private message
rajeev5174
Beginner


Joined: 05 Jun 2007
Posts: 25
Topics: 10

PostPosted: Tue Mar 20, 2012 12:42 pm    Post subject: Re: cobol move Reply with quote

Hi,

I have field which is x(23), can i move the field to 9(9) comp field with out any truncation to happen.

Regards
Raj
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Mar 20, 2012 4:12 pm    Post subject: Reply with quote

probably not, and then again, maybe so.

1st. would not do a direct move. refer to cobol conversion move in manual. (links at top of this page)

2nd. the ARITH cobol compiler option has a lot of influence. if you potentially have 23 significant digits, ARITH(31) is the only way you are going to make it.

3rd. if you used comp-5 instead, you would have a better chance.

4th. get into the habit of using signed numeric fields.

5th. what values can be contained in the 23 bytes?

6th. look at NUMVAL (again, COBOL manual, link at top of page),
if the values conform to the NUMVAL command prerequisites

7th. even though E-Cobol allows for this kind of stupidity (MOVE X-TYPE to COMP-datatype)
i would never do it.
i would first insure the integrity of the data contained in the x(23) field.

last but not least, this is a 'free' forum,
posters contribute on their own time,
at their own expense,
with their own skill set, that they have developed thru work, reading, testing
and thinking.
posting twice is rude.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group