Date: Fri, 13 Mar 2009 12:46:58 -0400
Reply-To: "F. J. Kelley" <jkelley@UGA.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "F. J. Kelley" <jkelley@UGA.EDU>
Subject: Re: Outputting SAS tables into notepad with positions
Content-Type: text/plain; charset=us-ascii
you may use column or formatted output (the PUT stmt, reverse of INPUT stmt)
data _NULL_;
set sasdata;
file "path\file";
put @1 code1 $6.
@7 code2 $20.
the $ indicates character data (since you do say "characters". If, say, code1 were numeric:
@1 code1 6.
there are _lots_ of SAS formats that control the display of data.
---- Original message ----
>Date: Fri, 13 Mar 2009 09:31:30 -0700
>From: Styrmir <styrmirg@GMAIL.COM>
>Subject: [SAS-L] Outputting SAS tables into notepad with positions
>To: SAS-L@LISTSERV.UGA.EDU
>
>Hi everybody
>
>I recently started working with SAS which means I am by no means an
>expert. I have a questions about something I have been struggling with
>today at work.
>
>I have a table which I need to output to a text file (notepad). The
>recipient of the file has made some requests which I have completed.
>Except one. They have asked for a special position where each column
>should start. Like column 1 should be 6 character long and start in
>position 1, next column should be 20 character long and start in
>position 7 etc. The variables in column 2 only contain 16 characters
>which means there should be 4 spaces between column 2 and 3 since
>column 2 is 20 character long.
>
>Can anyone tell me how I output the table with those positions? It
>shouldnt be too hard but still I struggle with it.
>
>Thanks in advance.
|