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
 

 

Doudt reg move statement

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

New User


Joined: 23 Aug 2006
Posts: 12
Location: Chennai

PostPosted: Thu Oct 12, 2006 12:15 pm    Post subject: Doudt reg move statement
Reply with quote

Hi All,

Can anyone tell me the output of this code, and the reason behind that.

Code:
01 Ws-var.
              10  A                     PIC  x(10) values 'ABCDE12345'.
              10 B REDEFINES A OCCURS 5 TIMES PIC X(2).
 
         02    WS-SUB          PIC 99               VALUE ZERO.
         02    NUM1              PIC  99 COMP-3 VALUE ZERO.
         02    NUM2              PIC  99               VALUE ZERO.
 
 
 
             2000-MAIN-PARA.
 
LABELA    MOVE  B(2) TO   NUM2.
LABELB   DISPLAY 'NUM2'    NUM2.
LABELC   MOVE  B(5) TO   NUM1.
LABELD    DISPLAY 'NUM1'    NUM1.
LABELE   MOVE  B(1) TO   NUM1.
LABELF    DISPLAY 'NUM1'    NUM1.
LABELG   MOVE  B(2) TO   NUM1.
LABELH    DISPLAY 'NUM1'    NUM1.
Back to top
View user's profile Send private message

bhavishya_bhandari

New User


Joined: 30 May 2006
Posts: 7

PostPosted: Thu Oct 12, 2006 12:27 pm    Post subject:
Reply with quote

are u trying to move Alphabatic value to numeric ??
it will give S0C7 ..!!
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Oct 12, 2006 12:43 pm    Post subject:
Reply with quote

Hi there ,

It will display

NUM2:C4 because b(2) contain CD & u declare num2 as 99
not sure abt this why it is changiung it to C$.
NUM1:45 because b(5) contain 45
NUM1:12 because b(1) contain AB & u declared it 9(2) comp-3
NUM1:34 because b(2) contain CD & u declared it 9(2) comp-3
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 ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm


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