Unless my understanding of SMF records is incorrect, I think your example SMF program smfp.c has a bug. The RDW length is a halfword which includes the length of the RDW itself.
The Co:Z example JCL that drives this code specifies the -rdw switch, which is a 4 byte length. So, the provided smfp.c sample code will work properly (see http://www.dovetail.com/docs/coz/cookbook.html#4_5).
However, you can get your version to work if you specify the -ibmrdw option on the fromdsn call, which will give you the IBM style RDWs.
Thanks steve, now I understand. I like the design, it simplifies a tricky header. I think you should mention -ibmrdw on the cookbook page to
avoid any more confusion.
When fiddling about with well known protocols you have to be a LOT more specfic in your docs...