Help using Base SAS procedures

proc import problem csv sas9.1 and sas9.3

Reply
New Contributor
Posts: 3

proc import problem csv sas9.1 and sas9.3

Hi

I try to import a CSV file with the following code

proc import data file = "& data directory. \ c_can.csv"
      out = cardiacancer
      dbms = csv
      replace;
      getnames = yes;
      DataRow = 2;
      guessingrows = 5000;

run;

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

Trusted Advisor
Posts: 2,115

Re: proc import problem csv sas9.1 and sas9.3

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.

New Contributor
Posts: 3

Re: proc import problem csv sas9.1 and sas9.3

The lrecl is 32767 in both sas9.1 and sas9.3

Super User
Posts: 11,343

Re: proc import problem csv sas9.1 and sas9.3

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.

New Contributor
Posts: 3

Re: proc import problem csv sas9.1 and sas9.3

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

Ask a Question
Discussion stats
  • 4 replies
  • 267 views
  • 1 like
  • 3 in conversation