Date: Tue, 22 Jan 2002 08:51:04 -0500
Reply-To: Ian Whitlock <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <WHITLOI1@WESTAT.COM>
Subject: Re: Date formatting
Content-Type: text/plain; charset="iso-8859-1"
Yvette,
Now that you have explained the problem and shown code the answer is simple.
Use
Proc Cimport data = in.file_master
infile = d:/somefile.trp;
format dateinfo month2. ;
run;
Or if you need the sort then place
format dateinfo month2. ;
in the PROC SORT code.
IanWhitlock@westat.com
-----Original Message-----
From: Yvette [mailto:hollied@OLIN.WUSTL.EDU]
Sent: Monday, January 21, 2002 11:14 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Date formatting
You are right that it is not an ASCII file. .trp is a SAS file that
is automatically formatted when I download the data from a financial
database. Unfortunately the information I needed is dated the last
business day of the month although I only need the month (notated by a
number).
The command to import this file is:
Proc Cimport data = in.file_master
infile = d:/somefile.trp;
run;
The date information is imported with a 'date9.' format. However, I
want to change it to a 'month2.' format which I've been doing after
the import and a sort function.
I hope this helps you to help me :-)
Cassell.David@EPAMAIL.EPA.GOV (David L. Cassell) wrote:>
> Uh-oh. There's your first problem. You are trying to read in some
> manner
> of transport file or proprietary formatted file as if it is a simple
> ASCII
> file. What format is that, and how did it get that .trp extension?
>
> Please reply to the list, so you can get more help...
> David