mid2 is an array, so you can't use it to define it's own size... but I think it goes further than that, as being a structure member the size can't really be determined until after all the alignment has been taken care of. But size(mid2(1)) doesn't work either, I suspect because the compiler isn't as devious as humans.
Anyway, this sort of thing works:
dcl
1 aMid1,
3 low3 Unsigned Bin Fixed (32),
3 low4 Char (8);
dcl
1 aMid2,
3 low3 Unsigned Bin Fixed (64),
3 low4 Char (48);
Dcl
1 top1 Structure ,
2 mid1 like aMid1,
2 mid2 ((4096 - size(aMid1)) / size(aMid2)) like aMid2;
Possibly there are other variants.
brataj