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
 

 

move statement with comp-3

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

New User


Joined: 18 Jun 2008
Posts: 4
Location: India

PostPosted: Fri Jan 30, 2009 7:29 am    Post subject: move statement with comp-3
Reply with quote

I have 2 comp-3 variables A and B,
A PIC S9(015)V99 COMP-3.
B PIC S9(015)V999 COMP-3.


I have a statement

MOVE A TO B

what happens when I move a
S9(015)V99 COMP-3 to to S9(015)V999 COMP-3

There is no statement to initialise B. Will there be 1 character with junk data vin B?
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jan 30, 2009 8:33 am    Post subject:
Reply with quote

Read about the MOVE verb in the COBOL Manuals.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7932
Location: Bellevue, IA

PostPosted: Fri Jan 30, 2009 8:38 am    Post subject:
Reply with quote

No, the last digit will become a zero -- following the usual rules of arithmetic. From the COBOL Language Reference (manuals link at the top of the page):
Quote:
5.1.6.6 Alignment rules


The standard alignment rules for positioning data in an elementary item depend on the category of a receiving item (that is, an item into which the data is moved; see "Elementary moves" in topic 6.2.24.1).

Numeric
For such receiving items, the following rules apply:

1. The data is aligned on the assumed decimal point and, if necessary, truncated or padded with zeros. (An assumed decimal point is one that has logical meaning but that does not exist as an actual character in the data.)

2. If an assumed decimal point is not explicitly specified, the receiving item is treated as though an assumed decimal point is specified immediately to the right of the field. The data is then treated according to the preceding rule.
Back to top
View user's profile Send private message
Sakthi393

New User


Joined: 18 Jun 2008
Posts: 4
Location: India

PostPosted: Fri Jan 30, 2009 9:33 pm    Post subject: Reply to: move statement with comp-3
Reply with quote

Thank you for the reply....
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
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
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am


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