Date: Wed, 20 Apr 2011 12:47:27 -0400
Reply-To: "Bian, Haikuo" <HBian@FLQIO.SDPS.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Bian, Haikuo" <HBian@FLQIO.SDPS.ORG>
Subject: Re: date format problem
In-Reply-To: <52075.53541.qm@web37506.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Hokut,
This may not be your solution, but the ways around this that I can think of ( I am sure many other will come up much slicker idea upon this one):
1. Using format input, you need to leave enough space for your missing date value, such as following:
data test;
infile cards ;
input date $10. b c;
cards;
12/25/1999 2 1
2 1
;
run;
2. Using list input, you will need delimiter other than just space for your raw data.
data test;
infile cards dlm=',';
length date $ 10.;
input date b c;
cards;
12/25/1999 ,2, 1
, 2, 1
;
run;
Regards,
Haikuo
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of oslo
Sent: Wednesday, April 20, 2011 11:46 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: date format problem
Dear Haikuo;
Here is the results I am getting after spesifying $10. In that colums
essantially . is missing value of date but 1 22 are from two following coulms.
3/23/1999
. 1 22
. 1 20
3/23/1999
Regards,
Hokut
________________________________
From: "Bian, Haikuo" <HBian@NW7.ESRD.NET>
To: SAS-L@LISTSERV.UGA.EDU
Sent: Wed, April 20, 2011 10:21:36 AM
Subject: Re: date format problem
Hi Hokut,
Are you saying that missing values did not cause problem before? What is the
problem like? Can we have some more details? Such as your log, the sample data
w/ missing values...
Thanks,
Haikuo
From: oslo [mailto:hokut1@yahoo.com]
Sent: Wednesday, April 20, 2011 11:14 AM
To: Bian, Haikuo; SAS-L@LISTSERV.UGA.EDU
Subject: Re: date format problem
Dear Haikuo;
Thanks so much. This works better. However since using $10. problem occurs when
there is missing value in date.
Regards,
Hokut
________________________________
From: "Bian, Haikuo" <HBian@NW7.ESRD.NET>
To: SAS-L@LISTSERV.UGA.EDU
Sent: Wed, April 20, 2011 9:57:21 AM
Subject: Re: date format problem
try to define "date $10." Instead of "date $"
Regards,
Haikuo
-----Original Message-----
From: SAS(r) Discussion
[mailto:SAS-L@LISTSERV.UGA.EDU<mailto:SAS-L@LISTSERV.UGA.EDU>] On Behalf Of oslo
Sent: Wednesday, April 20, 2011 10:45 AM
To: SAS-L@LISTSERV.UGA.EDU<mailto:SAS-L@LISTSERV.UGA.EDU>
Subject: Re: date format problem
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<mailto:HBian@FLQIO.SDPS.ORG>>
To: SAS-L@LISTSERV.UGA.EDU<mailto: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<mailto:SAS-L@LISTSERV.UGA.EDU>] On Behalf Of oslo
Sent: Wednesday, April 20, 2011 10:23 AM
To: SAS-L@LISTSERV.UGA.EDU<mailto: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
-----------------------------------------
Email messages cannot be guaranteed to be secure or error-free as
transmitted information can be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
Centers for Medicare & Medicaid Services therefore does not accept
liability for any error or omissions in the contents of this
message, which arise as a result of email transmission.
CONFIDENTIALITY NOTICE: This communication, including any
attachments, may contain confidential information and is intended
only for the individual or entity to which it is addressed. Any
review, dissemination, or copying of this communication by anyone
other than the intended recipient is strictly prohibited. If you
are not the intended recipient, please contact the sender by reply
email and delete and destroy all copies of the original message.
ID EBV_MBS;
-----------------------------------------
Email messages cannot be guaranteed to be secure or error-free as
transmitted information can be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
Centers for Medicare & Medicaid Services therefore does not accept
liability for any error or omissions in the contents of this
message, which arise as a result of email transmission.
CONFIDENTIALITY NOTICE: This communication, including any
attachments, may contain confidential information and is intended
only for the individual or entity to which it is addressed. Any
review, dissemination, or copying of this communication by anyone
other than the intended recipient is strictly prohibited. If you
are not the intended recipient, please contact the sender by reply
email and delete and destroy all copies of the original message.