As charlie stated, yes it's legal, but not a good design.
Some poor sap in the future may think it's a bona-fide 200a, and start loading it up. Many 200a panels are rated for 30 to 40 circuits, and they may overload the 100a upstream.
Yea, I know, we can't enforce the future, but if nothing else, I would either remove the 200a and replace it with a 100a, or if there's a 100a breaker feeding the panel elsewhere, just put lugs in.