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

Another redefines in COBOL


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

New User


Joined: 05 Feb 2012
Posts: 1
Location: India

PostPosted: Fri Mar 20, 2015 1:40 am
Reply with quote

Hi,

01 WS-VAR1 PIC X(05) VALUE ‘AB12E’.
01 WS-VAR2 REDEFINES WS-VAR1 PIC 9(04).

PROCEDURE DIVISION.
1000-PARA-DISPLAY.
DISPLAY ‘WS-VAR1 BEFORE MOVE:’ WS-VAR1.
DISPLAY ‘WS-VAR2 BEFORE MOVE :’ WS-VAR2.

MOVE 45 TO WS-VAR2.
DISPLAY ‘WS-VAR1 AFTER MOVE:’ WS-VAR1.
DISPLAY ‘WS-VAR2 AFTER MOVE :’ WS-VAR2.

What will be the output?
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Fri Mar 20, 2015 2:06 am
Reply with quote

Antony, you seem to join the forum in 2012 and If you are a COBOL programmer then, instead of asking it in a forum, why don't you test it yourself?

AB12E
AB12
0045E
0045
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 Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top