From: vncntj on
My data consist of dates:
November09
November09
November09
December09
December09
December09
December09

When I data step through, how can I convert and sort by a date format

data photos;
infile 'blah.txt' dsd;
length billDate 11.;
input billDate mmddyy10.
;
run;
quit;
From: Reeza on
On May 27, 1:43 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
> My data consist of dates:
> November09
> November09
> November09
> December09
> December09
> December09
> December09
>
> When I data step through, how can I convert and sort by a date format
>
> data photos;
>  infile 'blah.txt' dsd;
>  length billDate 11.;
>  input  billDate mmddyy10.
> ;
> run;
> quit;

What do you want the output dates to look like?
A date value has a day attached. All your data has is month and I'm
assuming year, but is that fiscal or calendar year?
From: Ya on
On May 27, 1:43 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
> My data consist of dates:
> November09
> November09
> November09
> December09
> December09
> December09
> December09
>
> When I data step through, how can I convert and sort by a date format
>
> data photos;
>  infile 'blah.txt' dsd;
>  length billDate 11.;
>  input  billDate mmddyy10.
> ;
> run;
> quit;

Assume the year part has 2 digits only.

data xx;
input rawdt $1-20;
sasdt=input('01'||substr(rawdt,1,3)||
substr(rawdt,length(rawdt)-1),date.);
format sasdt date.;
cards;
November09
November09
November09
December09
December09
December09
December09
;

proc print;
run;

Obs rawdt sasdt

1 November09 01NOV09
2 November09 01NOV09
3 November09 01NOV09
4 December09 01DEC09
5 December09 01DEC09
6 December09 01DEC09
7 December09 01DEC09

HTH

Ya
From: Arthur Tabachneck on
Vincent,

The following is simply another way of accomplishing what Ya had
suggested. Both methods appear to produce the same result:

data xx;
input;
sasdt=input(catt(substr(_infile_,1,3),
substr(_infile_,length(_infile_)-1)),anydtdte.);
format sasdt date.;
cards;
November09
November09
November09
December09
December09
December09
December09
;

HTH,
Art
--------------
On May 27, 4:43 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
> My data consist of dates:
> November09
> November09
> November09
> December09
> December09
> December09
> December09
>
> When I data step through, how can I convert and sort by a date format
>
> data photos;
>  infile 'blah.txt' dsd;
>  length billDate 11.;
>  input  billDate mmddyy10.
> ;
> run;
> quit;

From: vncntj on
Many Thanks!!!!
On May 27, 6:26 pm, Arthur Tabachneck <art...(a)netscape.net> wrote:
> Vincent,
>
> The following is simply another way of accomplishing what Ya had
> suggested.  Both methods appear to produce the same result:
>
> data xx;
>   input;
>   sasdt=input(catt(substr(_infile_,1,3),
>    substr(_infile_,length(_infile_)-1)),anydtdte.);
>   format sasdt date.;
> cards;
> November09
> November09
> November09
> December09
> December09
> December09
> December09
> ;
>
> HTH,
> Art
> --------------
> On May 27, 4:43 pm, vncntj <vincent.s.jo...(a)gmail.com> wrote:
>
>
>
> > My data consist of dates:
> > November09
> > November09
> > November09
> > December09
> > December09
> > December09
> > December09
>
> > When I data step through, how can I convert and sort by a date format
>
> > data photos;
> >  infile 'blah.txt' dsd;
> >  length billDate 11.;
> >  input  billDate mmddyy10.
> > ;
> > run;
> > quit;