Date: Sun, 24 Jan 2010 20:53:55 -0800
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Exporting SAS data in a Free-Column format
Content-Type: text/plain; charset=ISO-8859-1
data _null_;
set old;
file 'longcommafile' dlm=',' lrecl=30000;
put id sex age ht @;
run;
On Jan 24, 8:28 pm, Yaw <link...@gmail.com> wrote:
> Thanks,
> I am working with this other program that clumsily reads data in only
> this format. My aim is to get a comma delimited text file without any
> columns.
>
> This will wrap around after every 4 vars like this id,sex,age,ht,id,
> sex, age,ht, etc, rather than a csv file which is in a column format.
>
> Thanks.
>
> On Jan 24, 5:21 pm, art...@NETSCAPE.NET (Arthur Tabachneck) wrote:
>
>
>
> > Yaw,
>
> > As long as you define ID as a format z3. (or z whatever its length is)
> > I think you can get what you want with something like:
>
> > data have;
> > input id sex age ht;
> > format id z3.;
> > cards;
> > 001 2 6 120
> > 002 1 4 90
> > ;
>
> > PROC EXPORT DATA= WORK.HAVE
> > OUTFILE= "c:\want.csv"
> > DBMS=CSV REPLACE;
> > RUN;
>
> > HTH,
> > Art
> > -----------
> > On Jan 24, 3:55 pm, Yaw <link...@gmail.com> wrote:
>
> > > Hi Community:
>
> > > I have this data set in SAS that I want export in the free column
> > > format(comma or space delimited) to enable me read it into another
> > > program.
>
> > > My current data is in this format:
>
> > > id sex age ht
> > > 001 2 6 120
> > > 002 1 4 90;
>
> > > and I want it in this format: 001,2,6,120,002,1,4,90.
>
> > > Any ideas?
>
> > > Thanks!- Hide quoted text -
>
> - Show quoted text -
|