IBM MAINFRAME HELP FORUMS for COBOL, JCL, CICS, DB2, IMS etc...
Help & Support Forums for IBM Mainframe computers Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7, CA-11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, VSAM, ISPF, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

What is UNION in PL/I

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
View previous topic :: View next topic  
Author Message
murugan_mf



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

Posted: Thu Jul 10, 2008 4:44 pm    Post subject: What is UNION in PL/I  

can any one explain what is UNION in PL/I ?
Back to top  
enrico-sorichetti



Joined: 14 Mar 2007
Posts: 2661
Location: italy

Posted: Thu Jul 10, 2008 4:48 pm    Post subject: Reply to: UNION  

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  
murugan_mf



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

Posted: Thu Jul 10, 2008 5:08 pm    Post subject:  

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



Joined: 14 Mar 2007
Posts: 2661
Location: italy

Posted: Thu Jul 10, 2008 5:22 pm    Post subject: Reply to: UNION  

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  
cgk_106



Joined: 22 Dec 2006
Posts: 19
Location: chennai

Posted: Thu Jul 17, 2008 4:56 pm    Post subject:  

Quote:
Back to top  
dick scherrer



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

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

Hello,

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

d
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> PL/I & ASSEMBLER
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM
Related Links