View previous topic :: View next topic
|
Author |
Message |
mythili.m
New User
Joined: 23 Feb 2006 Posts: 12
|
|
|
|
Hi
I would like to know if it is possible to define a member in a structure with respect to another member which is initialized :
eg :
dcl 1 struct,
2 a pic '99' init(12),
2 b char(3) init('abc),
2 c char(2) def b position(1);
Awaiting reply. |
|
Back to top |
|
|
nutakkimurali
New User
Joined: 15 Nov 2005 Posts: 22
|
|
|
|
YES C WILL HAVE THE VALUE 'AB'
FROM POSITION 1 TO CHAR(2) I.E 'AB'
C SHOULS ALWAYS DECLARE LESS THA OR EQUAL TO B.
Muralee |
|
Back to top |
|
|
mythili.m
New User
Joined: 23 Feb 2006 Posts: 12
|
|
|
|
Hi ,
I tried it already.It is not working. I don't think it is possible within a structure as with individual variables.It works if it is declared in lvl 1 defined in terms of another variable like:
dcl x pic'(6)9' init(123456);
dcl 1 struct def x position(1),
2 a pic '99' ,
2 b pic '99' ,
2 c pic '99' ;
but what if i have to define between members ? Is that possible ?
Mythili. |
|
Back to top |
|
|
jawadshaik Warnings : 1 New User
Joined: 27 Sep 2005 Posts: 16
|
|
|
|
Yes the element of a structure cant be defined over the other element of same structure.
if iam wrong let me know |
|
Back to top |
|
|
mythili.m
New User
Joined: 23 Feb 2006 Posts: 12
|
|
|
|
Hi,
Can anyone tell me if it is possible to use 'defined' or 'union' attribute in a structure (having different data types) other than level 1 .I tried using it but i get an error of 8 saying that the 'defined' or 'union' attribute is getting ignored.
Awaiting reply eagerly.
Pls let me know.............. |
|
Back to top |
|
|
|