Date: Thu, 13 Nov 2008 11:07:42 -0500
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: Editing a SAS File from Macro
In-Reply-To: <000101c94578$a1411980$1e02a8c0@SIRIUS.ANAXIMA.COM>
Content-Type: text/plain; charset=us-ascii
this wiki page shows code
which (over)writes a text file with fopen, fput, fwrite, and fclose
http://www.sascommunity.org/wiki/Saving_sas_logs#Save-SAS-logs_sas
you say 'data sets' so this may not be what you want
I have other code that reads a data set
but does not write to.
Ron Fehd the module/routine/subroutine maven CDC Atlanta GA USA RJF2
at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Allen Ziegenfus
> Sent: Thursday, November 13, 2008 5:15 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Editing a SAS File from Macro
>
> Hi fellow SAS hackers,
>
> Is it possible to create/edit a SAS table using pure macro programming
> (without a data step)? I am very fond of using the open()
> function from
> Macro code to read in data sets like so:
>
> %let dsid=%sysfunc(open(master.prices,i));
> %if (&dsid = 0) %then
> %put %sysfunc(sysmsg());
> %else
> %put PRICES data set has been opened;
>
> and I was curious if one could, you know, go all crazy and
> also edit SAS
> files. In the help, the open function is only listed as
> having read access,
> and there is no "setvarc" function.
>
> Yours in SAS,
>
> Allen
>
>
|