IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Value of S9(9) variable on moving spaces??


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vampire

New User


Joined: 12 Oct 2009
Posts: 15
Location: Pune

PostPosted: Thu Jan 21, 2010 9:58 am
Reply with quote

I have a variable ABC of format PIC S9(9)

On moving spaces into ABC, getting the result is 0.

MOVE SPACES TO ABC.
DISPLAY ABC.

Result: 0

What is the reason for this??

Please explain?

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 21, 2010 10:28 am
Reply with quote

Hello,

Quote:
What is the reason for this??
Because the designers made it work this way. . .

Even though it "works this way", it should be unacceptable to move spaces to a numeric-defined field. It is a very poor programming practice.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top