Date: Thu, 3 Jul 2003 16:46:51 -0400
Reply-To: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Sigurd Hermansen <HERMANS1@WESTAT.COM>
Subject: Re: Writing a text file with "if ... then put" statements
Content-Type: text/plain; charset="iso-8859-1"
The 'header= ...' option only works when writing print files. Include the
keyword PRINT in the FILE statement.
Sig
-----Original Message-----
From: Tyler Barbour [mailto:sim7396@HOTMAIL.COM]
Sent: Thursday, July 03, 2003 4:13 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Writing a text file with "if ... then put" statements
I want to create a text file using a FILE statement. The code I used
resulted in the header line being printed several times, but I only
want it printed once at the top of the page (my text file will seldom,
if ever, be longer tnan one page)
This is what I tried. What did I do wrong?
data _null_;
file "c:\lola.txt" header=pagetop;
if (1) then put "This is a test";
if (0) then put "This will not print";
if (1) then put "This is another test";
return;
pagetop:
put @15 "This is the header line";
return;
run;