| Date: | Sun, 27 May 2001 18:42:28 -0700 |
| Reply-To: | kmself@IX.NETCOM.COM |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Karsten M. Self" <kmself@IX.NETCOM.COM> |
| Subject: | Re: newbie question: julian date |
| In-Reply-To: | <3B11A3F0.22512DD6@pantera.ri.mgh.mcgill.ca>; from
hugues@PANTERA.RI.MGH.MCGILL.CA on Mon, May 28,
2001 at 01:04:07AM +0000 |
| Content-Type: | multipart/signed; micalg=pgp-sha1;
protocol="application/pgp-signature"; |
|---|
on Mon, May 28, 2001 at 01:04:07AM +0000, Hugues Richard (hugues@PANTERA.RI.MGH.MCGILL.CA) wrote:
> Hello ,
>
> I have a file in a julian format (yyddd) similar to the following
> example . I am sure it's obvious , but what I am doing wrong ?
>
> DATA un ;
> INPUT matb $ @4 deces julian5. ;
> CARDS ;
> m1 95120
> m2 00000
> ;
> PROC PRINT ;
> thanks a lot,
> hugues
>
>
> log:
> NOTE: Invalid data for deces in line 882 4-9.
> RULE:----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9--
>
> 882 m2 00000
> matb=m2 deces=. _ERROR_=1 _N_=2
> NOTE: The data set WORK.UN has 2 observations and 2 variables.
> NOTE: DATA statement used:
> real time 0.03 seconds
> cpu time 0.00 seconds
I believe that this is indicating that '00000' is considered an invalid
julian date. There is no 'day 0' of a year.
You may want to verify this with some data step code testing various
Julian values. The SAS online documentation indicates that valid day
values are in the range 1-366.
I believe you'll have to add some conditional processing to test your
data before assigning it to a julian date, e.g.: (untested code, and
I'm getting rusty):
drop _juldate;
input @4 _juldate $4.;
if 1 le input( substr( _juldate, 3, 3 )) le 366
then deces = input( _juldate, julian5. );
else deces = . ;
Cheers.
--
Karsten M. Self <kmself@ix.netcom.com> http://kmself.home.netcom.com/
What part of "Gestalt" don't you understand? There is no K5 cabal
http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org
Disclaimer: http://www.goldmark.org/jeff/stupid-disclaimers/
[application/pgp-signature]
|