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: 7235

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: 1716
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: 7913
Location: Bellevue, IA

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 in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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