|
Alex,
Your example shows a fixed format (not tab delimited) file. If that is
the case, try something like the following:
filename dates 'c:\dates.txt';
Data One ;
infile dates ;
Input Date1 DDMMYY10. @17 Date2 DDMMYY10. ;
Run ;
Proc Print
Data = One ;
Format Date1 Date2 Date9. ;
Run ;
HTH,
Art
----------
On Mon, 18 Dec 2006 00:38:13 +0000, Alex S <alex4sas@YAHOO.CO.IN> wrote:
>Hi Toby,
> Thanks for you reply.
> If i read the dates from cards input.it is working,if i read the same
from file( in this case .txt file) it is not working.
>
> The below code is working fine for me too (like ur code below)
> data date_3;
> attrib
> Rat_Sta_Dat format=yymmdd10. label='Start Date'
> Rat_end_Dat format=yymmdd10. label='End Date'
> ;
> infile cards dsd dlm='09'x;
> input Rat_Sta_Dat ddmmyy10. Rat_end_Dat ddmmyy10.;
> cards;
> 26/09/2005 31/12/2005
> ;
>
> Please try to read two dates on the same line from one raw file. you
would get error message.
>
> Thank you
>
> Regards,
> Alex S
>
>toby dunn <tobydunn@HOTMAIL.COM> wrote:
> Data One ;
>infile Cards ;
>Input Date DDMMYY10. ;
>Cards ;
>26/09/2005
>31/12/2005
>;
>Run ;
>
>Proc Print
>Data = One ;
>Format Date Date9. ;
>Run ;
>
>
>
>
>Toby Dunn
>
>To sensible men, every day is a day of reckoning. ~John W. Gardner
>
>The important thing is this: To be able at any moment to sacrifice that
>which we are for what we could become. ~Charles DuBois
>
>Don't get your knickers in a knot. Nothing is solved and it just makes you
>walk funny. ~Kathryn Carpenter
>
>
>
>
>
>
>From: Alex S
>Reply-To: Alex S
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Help plz... Reading dates from raw files
>Date: Mon, 18 Dec 2006 00:21:30 +0000
>
>26/09/2005 31/12/2005
>
>_________________________________________________________________
>Share your latest news with your friends with the Windows Live Spaces
>friends module.
>http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?
href=http://spaces.live.com/spacesapi.aspx?
wx_action=create&wx_url=/friends.aspx&mk
>
>
> Send free SMS to your Friends on Mobile from your Yahoo! Messenger.
Download Now! http://messenger.yahoo.com/download.php
|