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
 

 

PL/I - redefines problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Fri Jan 16, 2009 7:31 pm    Post subject: I have query of same type on Redefining an array
Reply with quote

I have a program where

DCL 01 A PIC 'ZZZZZZ9' INIT ((13)0);


DCL 01 A_CHAR (13) CHAR (07)
DEF A(13);

at the time of compilation it throws an error saying the redefined variable doesn't fit with the based variable. Could anyone help me with this problem.

Thanks in advance,
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Jan 16, 2009 9:17 pm    Post subject:
Reply with quote

I would prefer to use based addressing for this.

Code:
DCL 01 A PIC 'ZZZZZZ9' INIT ((13)0);

DCL 01 A_CHAR (13) CHAR (07) BASED(ADDR(A(1));


You want the first byte of the based variable to be aligned with the 1st byte of the first element in the array. To me, it looks like you're positioning A_CHAR on the 13th element, so it extends past the end of the array.

Garry.
Back to top
View user's profile Send private message
anadhamohan

New User


Joined: 27 Sep 2005
Posts: 25
Location: india

PostPosted: Mon Jan 19, 2009 4:06 pm    Post subject: Reply to: PL/I - redefines problem
Reply with quote

Thanks Garry, It worked for me.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon Jan 19, 2009 4:47 pm    Post subject:
Reply with quote

Glad to have been able to help. Thanks for letting us know.

Garry.
Back to top
View user's profile Send private message
donateeye
Warnings : 2

New User


Joined: 01 Jun 2007
Posts: 62
Location: chennai

PostPosted: Tue Feb 17, 2009 12:17 pm    Post subject: Reply to: PL/I - redefines problem
Reply with quote

DEF can be used ONLY to redefine data types of exactly the same attributes.... in the problem we have PIC and CHAR, which are different. Hence the error.
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 -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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