IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is DEFINED and what is the use of it in pl1 Declaration


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
malli419

New User


Joined: 16 Apr 2012
Posts: 5
Location: india

PostPosted: Wed Apr 25, 2012 3:28 pm
Reply with quote

Hi am new to pl1 and and want to know the used of DEFINED keyword

Eg:DCL 1 IN_LOC DEFINED IN_REC
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Apr 25, 2012 3:31 pm
Reply with quote

The manuals will explain it all.
Back to top
View user's profile Send private message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Wed Apr 25, 2012 3:47 pm
Reply with quote

Hi,
The DEFINED attribute indicates that PL/I is not to allocate storage for the variable, but is to map the description of the variable onto the storage of another variable called the base variable. The DEFINED attribute provides a way to access the same data using different names .
Code:
DECLARE NAMES(10) CHARACTER(5) DEFINED (LIST),
        LIST(10) CHARACTER(5)

In this example, the variable NAMES is a defined variable; its data description is mapped to the storage occupied by the variable LIST. Any reference to NAMES or to LIST is resolved to the same location in memory.
Please correct me if i am wrong.
Back to top
View user's profile Send private message
malli419

New User


Joined: 16 Apr 2012
Posts: 5
Location: india

PostPosted: Wed Apr 25, 2012 4:00 pm
Reply with quote

Thanks dear
Back to top
View user's profile Send private message
malli419

New User


Joined: 16 Apr 2012
Posts: 5
Location: india

PostPosted: Wed Apr 25, 2012 4:04 pm
Reply with quote

Thank you
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Apr 25, 2012 4:22 pm
Reply with quote

DEFINED is not deprecated (and won't be ever) , but using UNION is nowadays the preferred alternative and results in better code (and, like based, allows you to overlay anything with anything)
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts using based or defined variables PL/I & Assembler 2
No new posts Call DB2 user defined function from C... DB2 5
No new posts COBOL file declaration COBOL Programming 2
No new posts In which program the FILE CONTROL wil... COBOL Programming 2
Search our Forums:

Back to Top