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
 
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: 1894
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: 8165
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts it is possible output a SET value fro... Martylin JCL & VSAM 5 Fri Sep 22, 2017 7:08 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

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