The FDA036 rule says: “Variable length should be assigned based on actual stored data to minimize file size. Datasets should be re-sized to the maximum length of actual data used prior to splitting”. As someone translating rules in code, I would say that the rule is pretty “fuzzy”. Essentially, the FDA rule FDAC036 (in the P21 interpretation) is more strict than the SDTM-IG. It means that when your longest test code is 7 characters, you should set the variable length to 7.
The background of all this is that SAS-XPT is spoiling bytes. For example, if you have one value for a variable that is really 200 long, and all other values for the same variable are only 1 long, you will need to set the variable length to 200 due to that one value. In the SAS-XPT file, all other values (being 1 long) for that variable will have 199 blanks to fill the field. What a waste!!!
It is really time that the FDA starts accepting other “smart” formats like XML or JSON.