LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2003, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 27 Feb 2003 14:16:52 -0800
Reply-To:   Ramesh Makkena <makkena@XOMA.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Comments:   To: Steve Jones <st_jones77@YAHOO.COM>
From:   Ramesh Makkena <makkena@XOMA.COM>
Subject:   Re: Help: Writing to an external file
Comments:   To: SAS-L@LISTSERV.VT.EDU
Content-Type:   text/plain; charset="iso-8859-1"

Try this:

%let outfile=test; %let indepvar=testindependent variable; data bins3; range=1; rangef=9; pctn=12.2; run;

data _null_; file &outfile; %let indepvar=%upcase(&indepvar); put @2 "%upcase(&indepvar)" ; put @4 'proc format' ';'; put @5 'value' @10 "&indepvar" ; run;

data _null_; file &outfile mod; set bins3; put @10 range rangef pctn percent9.2; run;

data _null_; file &outfile mod; put @20 'run;'; run;

HTH, Ramesh Makkena

-----Original Message----- From: Steve Jones [mailto:st_jones77@YAHOO.COM] Sent: Thursday, February 27, 2003 1:40 PM To: SAS-L@LISTSERV.VT.EDU Subject: Help: Writing to an external file

Hello everyone, I have a dataset with 3 variables: range rangef pctn. I am trying to write them to an external file. The problem is that the external file gets overwritten by subsequent 'put statements' in the data _null_ steps below. For example the external file/output generated from the code below contains only:

run;

I am sure I am doing something wrong. I'd appreciate any pointers.

Thanks, SJ

data _null_; file &outfile; put @2 "%upcase(&indepvar)"; put @2 'proc format' ';'; put @5 'value' @10 "&indepvar" ; run;

data _null_; file "&outfile"; set bins3; put @10 range rangef pctn percent9.2; run;

data _null_; file "&outfile"; put @2 'run;'; run;

-- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


Back to: Top of message | Previous page | Main SAS-L page