Are blank fields allowed in SAS data sets?

Douglas Bates bates@stat.wisc.edu
06 Jan 2000 17:51:14 -0600


Sorry to respond to my own post but I did a little more searching in
the Q&A document at SAS Institute regarding the FDA's adoption of the
SAS XPORT format and found they do address the issue I mentioned
and they have a solution.  The solution is "Don't do that!".  :-)

Here is the direct quote from
	http://www.sas.com/software/industry/pht/fda/faq.html

Q.     Is it difficult to detect the end of file when reading a data set stored in
       XPORT transport format? 

   A.  Under certain circumstances it is difficult to detect the end of file
       when reading a data set in XPORT transport format. Below is an
       explanation and a suggested fix that will alleviate the problem. 

       The problem occurs when the record length of a file is less than 80
       characters. The transport format writes 80 byte records. The last
       observation may not fill up an 80 byte record. When this happens the
       SAS System will pad the 80 byte record with blanks. When reading a
       transport file, the SAS System treats trailing blanks as insignificant. If
       the records are shorter than 80 bytes and if the last record written
       contains nothing but blank characters then the file comes up one
       record short. 

       The key to avoiding this potential problem is to undertake preventative
       measures described below. 

       One preventative measure could be to make sure that the
       circumstances do not exist. Avoid creating a data set where: 

         1.The observation length (the sum of the variable sizes) is less than
           80 and 
         2.The variables are all character and 
         3.The last record has all blank values. 

       Another preventative measure could be to save original data in
       transport format, extract new data from the transport file, then run
       PROC COMPARE to compare the original data to the new data.
       Output from PROC COMPARE can validate that the new data
       extracted from the transport file is identical to the original
       data. 
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._