Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us