Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
What are the truncation rules when moving DISP to COMP

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
iknow

Senior Member


Joined: 22 Aug 2005
Posts: 582
Location: Colarado, US

PostPosted: Thu Oct 13, 2005 8:25 am    Post subject: What are the truncation rules when moving DISP to COMP
Reply with quote

Hi folks,
What are the truncation rules, when we are moving data in variable of
usage DISPLAY to a variable having usage COMP, COMP2, COMP3. where as sending field is large then the receiving.
Back to top
View user's profile Send private message
References
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 107
Location: Concord, New Hampshire, USA.

PostPosted: Thu Oct 13, 2005 8:48 am    Post subject:
Reply with quote

Hi,
The sending field is converted to the respective COMP format and then moved.For ex.Sending field here,is converted to floating point and then moved for COMP-1 or COMP - 2 receiving field. Truncation rules for numeric is applied.
Regards,
Sridevi.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Fri Oct 14, 2005 6:31 am    Post subject:
Reply with quote

The hi ord digits are truncated.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Sun Oct 16, 2005 7:37 am    Post subject:
Reply with quote

Sorry. My previous reply was incomplete.

The hi ord digits before the decimal point of the longer (in terms of digits) sending field are truncated.

However, the low order digits after the decimal point of the sending field are truncated if their number is greater than that of the receiving field.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1526

PostPosted: Tue Oct 18, 2005 4:38 am    Post subject:
Reply with quote

Iknow,

If you're still out there give us a sign.

Here's one last comment re. your ques that I should have included:

The truncation I mentioned only works for COMP fields that are present in a pgm compiled w/the TRUNC(STD) option. Any other TRUNC option will not perform as desired.

It's better to use COMPUTE with the ON SIZE ERROR clause to prevent erroneous truncation.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1