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
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 COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


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