View previous topic :: View next topic
|
Author |
Message |
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
can any one explain what is UNION in PL/I ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
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 |
|
|
|