| Date: | Wed, 22 Aug 2001 07:17:53 -0700 |
| Reply-To: | Pete Lund <pete.lund@NWCSR.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Pete Lund <pete.lund@NWCSR.COM> |
| Subject: | Re: writing out a file |
|
| In-Reply-To: | <80256AB0.004E9553.00@fil-notes01.filcs.com> |
| Content-Type: | text/plain; charset="iso-8859-1" |
Hi Graeme-
You can use the END= option on the SET statement to flag when the last
record is being processed. This option creates a variable that is true (1)
on the last record and false (0) on all others.
Just change your SET statement to: set final end=eof;
The code you have would then put the ' }}' at the end of the file. If
you really want a CR-LF and then two braces, try this:
if Eof then
do;
put ;
put '}}';
end;
- or -
if eof then put / '}}';
Both of these will put a CR-LF and then the braces.
---------------------------------------------------------------------
Pete Lund
Northwest Crime and Social Research, Inc.
313-D Fifth Ave SE
Olympia, WA 98501
(360) 582-8970 - voice
(360) 280-4892 - cell
(360) 570-7533 - fax
pete.lund@nwcsr.com
www.nwcsr.com
---------------------------------------------------------------------
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Graeme Kirton
Sent: Wednesday, August 22, 2001 7:18 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: writing out a file
Im writing out the contents of a dataset 'final'. This works fine, only at
the
end I want a CR LF then two braces, can I do something like this???
Just incase, my dset looks like this;
x y diepass
1 2 0
1 3 1
1 4 1
2 2 1
filename sample 'c:\winnt\profiles\gkirton\desktop\map.txt' lrecl=2048;
data _null_;
set final;
by descending y x;
file sample;
if _n_ NE 1 and first.y then PUT;
put diepass +(-1)@;
if Eof then PUT ' }}'; /*DOESNT WORK*/
run;
____________________________________________________________________________
________________________________
Disclaimer
This email may contain privileged/confidential information and/or copyright
material. It is intended only for the use of the person(s) to whom it is
addressed and any unauthorised use may be unlawful. If you receive this
email
by mistake, please advise the sender immediately by using the reply facility
on
your email software and delete the material from your computer.
Opinions, conclusions and other information in this email that do not relate
to
the official business of this organisation shall be understood as neither
given
nor endorsed by it.
If this message forms part of a quotation, the quotation is an invitation to
treat only. No contract subsists until Filtronic Plc (or its subsidiary
companies) accepts your order. Acceptance of your order is made subject to
our
standard Terms and Conditions.
Website Address http://www.filtronic.com
|