Date: Wed, 20 Apr 2011 17:32:10 -0400
Reply-To: Arthur Tabachneck <art297@ROGERS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@ROGERS.COM>
Subject: Re: date format problem
Content-Type: text/plain; charset=ISO-8859-1
Hokut,
I'm going to deviate a bit from what my colleagues have suggested. You can
read your data directly from Excel if you use the clipboard. You'll
probably have to correct the following code to match what your data actually
looks like but try something like the following:
1. In SAS create, but don't run, a program like the following to read all of
your data. The only things that you might need to change are the input
statement, and informat and format statements to reflect your actual data:
filename clipbrd dde 'clipboard';
data want;
infile clipbrd dsd dlm="09"x
lrecl=32768 notab missover;
informat date mmddyy10.;
informat breed $15.;
format date date9.;
input ID breed date;
run;
filename clipbrd clear;
2. Then, in Excel, highlight the data (but NOT the variable names) and then
click on copy.
3. In SAS, run the program
That MAY be all you will need to read the file(s) correctly.
HTH,
Art
---------
On Wed, 20 Apr 2011 07:44:48 -0700, oslo <hokut1@YAHOO.COM> wrote:
>Dear Haikuo;
Thanks for writing. It is much appeciated. Here is the code:
Regards,
Hokutdata a;
input
cards;�
data b;
input
cards;
�dataab;mergea(in=ina) b(in=inb); ifinb;run;
ID Breed $�date $ cards;
________________________________
From: "Bian, Haikuo" <HBian@FLQIO.SDPS.ORG>
To: SAS-L@LISTSERV.UGA.EDU
Sent: Wed, April 20, 2011 9:32:38 AM
Subject: Re: date format problem
I 'd appreciate that you can post some of your code involved. For now, my
wild
guess is that your date variable is not numeric and the first appearing
dataset
in your merging process has a length of 8 for this variable, so anything
upcoming longer than 8 is truncated to 8.
Regards,
Haikuo
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of oslo
Sent: Wednesday, April 20, 2011 10:23 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: date format problem
Dear SAS user;
I tried to merge to different data set and import it into csv file. The date
spesification in my data set is as 3/18/1999, 2/6/1999, 11/19/1999,
11/4/1999
and so and.
When SAS merges data set it gives the datse column correctly for for example
2/6/1999. However it cuts the last one or last to digits of year in dates
for
3/18/199 and 11/19/19� respectively. What is the why to makes read date
correctly as what they are
Regards
Hokut