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: 1848
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: 8132
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 Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 8 Thu Jun 29, 2017 1:41 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm


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