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
 

 

Have to move value of 10220 to s9(04) binary field

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

New User


Joined: 10 Oct 2005
Posts: 27

PostPosted: Fri Jul 06, 2007 6:37 pm    Post subject: Have to move value of 10220 to s9(04) binary field
Reply with quote

Could any pls help me on the below issue.

I have to move value of 10220 to s9(04) binary field.
I read in the cobol book that s9(04) binary can accomodate nbrs range from -32000 to +32000.
But when tried to move 10220 in this field..Data is getting truncated and saving only 4 digits like 0220.
Is there any way to accomodate this requirement instead of increasing the size of the receIving field.

Please advice.
Back to top
View user's profile Send private message

prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Jul 06, 2007 6:55 pm    Post subject:
Reply with quote

please refer to the following link, you may find your answer:

http://ibmmainframes.com/viewtopic.php?t=21648&highlight=9999&sid=16f4784a6a022e73196dcd9b95cec9e3
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 149
Location: Ottawa Canada

PostPosted: Fri Jul 06, 2007 7:52 pm    Post subject:
Reply with quote

The compile TRUNC option is key to your question.

Our shop has a standard that says we have to use TRUNC(OPT). This standard was based on some performance benchmarks that showed that TRUNC(OPT) runs significantly faster than the others. I am a bit skeptical about this but no big deal I guess...

Using TRUNC(OPT), this is what we observe...

The MOVE statement can safely move the value 12345 into a PIC S9(4) COMP field. However, the COMPUTE statement will truncate any result back to 4 digits. Very weird.
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 READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm


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