Extract state record to hrl for use in yz