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

What is UNION in PL/I


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

Active User


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

PostPosted: Thu Jul 10, 2008 4:44 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jul 10, 2008 4:48 pm
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

Active User


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

PostPosted: Thu Jul 10, 2008 5:08 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jul 10, 2008 5:22 pm
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
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 Illegal use of keyword fetch. Token w... DB2 2
No new posts Can we Update cursor with group by an... DB2 5
No new posts Union or join query DB2 2
No new posts UNION in PLI PL/I & Assembler 2
No new posts Column Correlation names in UNION DB2 7
Search our Forums:

Back to Top