| Date: | Sun, 7 Sep 2008 01:05:30 -0700 |
| Reply-To: | Barry Schwarz <schwarzb@DQEL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Barry Schwarz <schwarzb@DQEL.COM> |
| Organization: | Aioe.org NNTP Server |
| Subject: | Re: convert date format |
|
| Content-Type: | text/plain; charset=us-ascii |
On Sat, 6 Sep 2008 12:25:16 -0700, hg448@YAHOO.COM (hua gang) wrote:
>Sorry for not including complete program, so I sent again.
>
>Thanks for reply, Dan.
>
>I used the following to compute the difference between yearsly dates,
>only my first date variable, "date_base" has different format like, 03JUN08.
>Because of it, the computation didn't work. Once I got ride of date_base,"
>and datedif0 it worked perfectly. So, this is the reason for me to try to
>convert "date_base", but I can't find a way to do it right away.
Don't you think it would help if you told us what went wrong?
>
>Thanks again for your help.
>
>Hua
>
>
>arraydc{4} date_base dateyear_1 dateyear_2 date_year3;
>arraydd{4} daydif0 daydif1 daydif2 datedif3;
>
>seth4;
What kind of statement is this.
>doi=2to4;
Maybe you should cut and paste your code rather than retyping it.
> last_date=.;
> j=i;
> dd{i}=.;
> dountil((last_date ne .) or (dc{i} = .));
> j=j-1;
Horizontal white space is free and make your code much easier to read.
> ifdc{j} ne .thenlast_date=j;
> elseifj=1thenleave;
> end;
>
>/* only need to do a diff here since SAS dates count days from a set point */
> ifnmiss(last_date,dc{i})=0thendd{i}=dc{i}-dc{last_date};
>end;
>
>dropi j; *last_date;
>
>run;
--
Remove del for email
|