UNION statement



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

UNION statement

Postby Alison Oliveira » Wed Jun 20, 2012 7:04 pm

Hi all,

in a UNION statement, can i put two types of variables, at the same UNION like this??

DCL 1 * UNION,               
      2 W_AUX      CHAR(001),
      2 W_AUX_BIT  BIT (001);


PL/I ENTERPRISE...

thanks
Alison Oliveira
 
Posts: 37
Joined: Fri Jan 20, 2012 9:08 pm
Has thanked: 0 time
Been thanked: 0 time

Re: UNION statement

Postby Akatsukami » Wed Jun 20, 2012 8:17 pm

Yes. Remember, though, that when you refer to the bit variable, the Enterprise compiler will generate instructions to set the "slack" (unused) bits of the character variable to '0'B;
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post