Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sivareddy123

New User

Joined: 14 Jan 2015
Posts: 11
Location: India

 Posted: Mon Feb 02, 2015 1:33 pm    Post subject: Please give me solution(OUTPUT ) for the below 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

Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

Posted: Mon Feb 02, 2015 1:36 pm    Post subject: Reply to: Hi

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.
sivareddy123

New User

Joined: 14 Jan 2015
Posts: 11
Location: India

 Posted: Mon Feb 02, 2015 1:50 pm    Post subject: Reply to: Hi Do you mean A value is 56 B value is 2 ?
Nic Clouston

Global Moderator

Joined: 10 May 2007
Posts: 2407
Location: Hampshire, UK

Posted: Mon Feb 02, 2015 2:49 pm    Post subject:

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.
Robert Sample

Global Moderator

Joined: 06 Jun 2008
Posts: 8560
Location: Dubuque, Iowa, USA

Posted: Mon Feb 02, 2015 6:32 pm    Post subject:

 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).
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics DB2 - row_number function - Need 1st ... Q5P418 DB2 5 Wed Sep 09, 2020 8:35 am A very ingenious mainframe automation... hefiproject.de CA Products 1 Thu Aug 13, 2020 2:59 pm Write 9(07) comp-3 data into output file clearskynot DFSORT/ICETOOL 4 Thu Apr 16, 2020 11:00 pm Typing the CENT sign ยข on mainframe,... Rod Hittle All Other Mainframe Topics 2 Wed Apr 15, 2020 7:06 pm DFSORT Output file order query A_programmers DFSORT/ICETOOL 2 Thu Mar 26, 2020 11:59 pm

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us