05-07-2015 05:41 AM
I try to import a CSV file with the following code
proc import data file = "& data directory. \ c_can.csv"
out = cardiacancer
dbms = csv
getnames = yes;
DataRow = 2;
guessingrows = 5000;
When I do it in sas9.1 I get the following
NOTE: The data set WORK.CARDIACANCER has 5141 observations and 82 variables.
When I run it in sas9.3 I get the following
NOTE: The data set WORK.CARDIACANCER has 5141 observations and 65 variables.
why this difference in variables?
I need to run the code in sas9.3, since the code is part of a program that uses the functionality only in sas9.3
In addition, I find that the sas9.3 not load the entire variable length
05-07-2015 11:29 AM
You've got some sort of length setting that is different between the two versions. Each version has its own configuration files and I bet they are different. The easiest way to find the difference might be to run PROC OPTIONS; in each. The LRECL default in PROC IMPORT; may be different.
05-07-2015 11:33 AM
I basically use Proc Import to generate a base datastep to read CSV files. Look in the log to see the generated code to see the details of how the file was read in each version.
I then save the starting code, modify it as I need specifying informats, formats, lengths, labels and such. Then I'm not getting different behaviors, especially for lengths of character variables, for different versions of the input data set OR across SAS versions.
05-08-2015 02:05 AM
It is also the solution I've used so far. but there are occasionally new variable to CSV files, and it's a little inconvenient to have to fix the code to, instead of being able to use a proc import