Date: Thu, 1 Oct 2009 16:39:41 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: PROC IMPORT Bug in 9.2 TS2M0
Content-Type: text/plain; charset=ISO-8859-1
On 10/1/09, Deborah Testa <email@example.com> wrote:
> My years-old PROC IMPORT code broke in 9.2 TS2M0.
There are always incompatibilities with version upgrades. They are
hard to find, and like this one very annoying. We (SAS-L) have
already identified a bug in PROC IMPORT with regards to LRECL on the
I'm not sure I would have trusted PROC IMPORT for "production"
program. Did the CSV change format from run to run that made PROC
IMPORT more convenient?
If you only need to know variable order from row 1 and type and other
attributes are static you can write a two data step program that
simulates what PROC IMPORT is doing for now. This program would be
less likely to out smart itself.
> The algorithm to determine if a value is a date, datetime or time was
> changed in SAS 9.2. Unfortunately it looks like there is a problem with
> typing some of the values to determine if the value is a date, time or
> datetime. I will report this problem to the developer. In the
> meantime, you will need to recall the generated DATA step code assuming
> you are using PROC IMPORT in interactive mode. To recall the generated
> DATA step code, you will need to make certain you have the EDITOR window
> active and then do a RUN-RECALL LAST SUBMIT after the PROC IMPORT has
> run. The generated DATA step will appear in the Editor Window and you
> can change the INFORMAT, FORMAT and INPUT statement for the 2 variables,
> VSBT and GNDRCODE, so they are read in as character. Then you will
> resubmit the generated DATA step code to receive expected results.
This could be automated with a PROC PRINTTO LOG= and a fiddly data
step. Might be fun to try that.
> Since I still have SAS 8.2 installed, I'm going to run my PROC IMPORT
> steps in 8.2 rather than introduce the manual step into the middle of an
> automated series of steps.
> My data contains codes for gender (2201 for Male and 2202 for Female).
> When I read those values from a .csv file into SAS using PROC IMPORT,
> SAS creates a numeric variable (fine) but uses a datetime. format and
> the anydtdtm40. informat. , creating raw values of 1956614400 and