Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
What is UNION in PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
murugan_mf

New User


Joined: 31 Jan 2008
Posts: 49
Location: Chennai, India

PostPosted: Thu Jul 10, 2008 4:44 pm    Post subject: What is UNION in PL/I
Reply with quote

can any one explain what is UNION in PL/I ?
Back to top
View user's profile Send private message
References
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3273
Location: italy

PostPosted: Thu Jul 10, 2008 4:48 pm    Post subject: Reply to: UNION
Reply with quote

did You care to look at the manual ,

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ibm3lr60/8.9?SHELF=IBMSH360.bks&DT=20071130131006

if something is not clear somebody will be glad to explain
Back to top
View user's profile Send private message
murugan_mf

New User


Joined: 31 Jan 2008
Posts: 49
Location: Chennai, India

PostPosted: Thu Jul 10, 2008 5:08 pm    Post subject:
Reply with quote

thanks enrico I got some idea but I am having one doubt:
How the size mismatch can occur for Individual and First_Name.

Code:
Declare 1 Client,
                 2 Number pic '999999',
                 2 Type bit(1),
                 2 * bit(7),
                 2 Name union,
                   3 Individual,
                     5 Last_Name char(20),
                     5 First_Name union,
                       7 First   char(15),
                       7 Initial char(1),
                   3 Company char(35),
                 2 * char(0);
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 3273
Location: italy

PostPosted: Thu Jul 10, 2008 5:22 pm    Post subject: Reply to: UNION
Reply with quote

The UNION attribute is just a more flexible form of DEFINED,
it just determines the starting point of a field with no checking of lengths IIRC

- DEFINED works only at the 1 level ( or no level ) variables

so to achieve the same result with the defined
You would have to repeat the whole structure
Back to top
View user's profile Send private message
cgk_106

New User


Joined: 22 Dec 2006
Posts: 19
Location: chennai

PostPosted: Thu Jul 17, 2008 4:56 pm    Post subject:
Reply with quote

Quote:
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 9191
Location: 221 B Baker St

PostPosted: Thu Jul 17, 2008 10:56 pm    Post subject: Reply to: What is UNION in PL/I
Reply with quote

Hello,

Did you have something to ask/add. . . .?

d
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1