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
 

 

Please give me solution(OUTPUT ) for the below

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

New User


Joined: 14 Jan 2015
Posts: 11
Location: India

PostPosted: Mon Feb 02, 2015 1:33 pm    Post subject: Please give me solution(OUTPUT ) for the below
Reply with quote

Please give me solution(OUT PUT ) for the below

01 A PIC X(5) Value 'ABC12'
01 B REDEFINE A PIC X(4).

PROCEDURE DIVISION.

MOVE 56 TO B.

DISPLAY A .
DISPLAY B.

OUT PUT : ????????????????????????????


Thanks in advance
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Feb 02, 2015 1:36 pm    Post subject: Reply to: Hi
Reply with quote

A:

Code:
56  2


B:

Code:
56 


Edit to include B. I thought you knew what B contained as you'd just MOVEd 56 to it.
Back to top
View user's profile Send private message
sivareddy123

New User


Joined: 14 Jan 2015
Posts: 11
Location: India

PostPosted: Mon Feb 02, 2015 1:50 pm    Post subject: Reply to: Hi
Reply with quote

Do you mean A value is 56 B value is 2 ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1768
Location: UK

PostPosted: Mon Feb 02, 2015 2:49 pm    Post subject:
Reply with quote

Why not code it up and run it? When you code it code your DISPLAYs in the following manner:
Code:
DISPLAY 'n >' n '<'.

where n is your variable. That way you will see any blanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8036
Location: East Dubuque, Illinois, USA

PostPosted: Mon Feb 02, 2015 6:32 pm    Post subject:
Reply with quote

Quote:
Do you mean A value is 56 B value is 2 ?
No, the value of A is 5 6 blank blank 2, while the value of B is 5 6 blank blank. Since there is a REDEFINE, the variables share the same memory (A has 5 bytes and B has 4 bytes, so the first 4 bytes of A will ALWAYS have the same value as B).
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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts scheduling between OPC and TWS give u... nsbl IBM Tools 4 Sun Mar 12, 2017 5:35 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm


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