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

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: 2180
Location: Hampshire, 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: 8449
Location: Dubuque, Iowa, 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 SDSF REXX for DB2 command output vasanthz CLIST & REXX 2 Thu Apr 25, 2019 11:29 pm
No new posts Any single step solution possible? Rohit Umarjikar SYNCSORT 7 Mon Apr 22, 2019 6:18 am
No new posts SDSF limit access to specifc output c... David Beckham All Other Mainframe Topics 1 Thu Mar 21, 2019 10:29 pm
No new posts Build Dynamic Sort output and limit '... balaji81_k DFSORT/ICETOOL 3 Sat Feb 02, 2019 4:40 am
No new posts Copy members from Input PDS to Output... Poha Eater JCL & VSAM 9 Tue Jan 29, 2019 3:56 pm

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