SAS cannot use SPSS files that contain variables with
numeric formats that have a larger number of decimal places than the
width of the entire variable. For example, if you have a variable
that has a width of 17 and also has 35 decimal places, then SAS will
return errors when you try to run a DATA step on the file or view
it with the table viewer. To use the SPSS file with SAS, you have
to reformat the variables.
You can reformat the
variables by reducing the number of decimal spaces to a value that
will fit within the width of the variable. In the following code example
the statement
revision=cat(format,formatl,'.2');
converts
the number of decimal spaces to 2. This value reduces the number of
decimal spaces so that it is not greater than the width of the variable.
libname abc spss 'FILENAME.POR';
proc contents data=abc._all_ out=new; run;
filename sascode temp;
data _null_; set new; file sascode;
if formatd > formatl then do;
revision=cat(format,formatl,'.2');
put 'format' +1 name +1 revision ';' ;
end;
run;
data temp; set abc._all_;
%inc sascode/source2;
run;
Note: The OPTIONS NOFMTERR statement
does not allow SAS to use the data set with a DATA step or the table
viewer. You have to reformat numeric variables that have a larger
decimal value than their width before you can use a DATA step or the
table viewer.