f



Re: FW: Include SAS code w/o including SAS code

On Tue, 12 Aug 2008 13:36:52 +0000, Don Henderson
<donaldjhenderson@HOTMAIL.COM> wrote:

>resending as I did not mean to send to just Andre
>
>----------------------------------------
>> From: donaldjhenderson@hotmail.com
>> To: wielki@ined.fr
>> Subject: RE: Include SAS code w/o including SAS code
>> Date: Tue, 12 Aug 2008 13:34:41 +0000
>>
>>
>> Alan,
>>
>> If you want the generated SAS code try (untested):
>>
>> data _null_;
>>  file "code.sas";
>>  length code $32000;
>>  code = resolve('%xyz');
>>  put code;
>> run;
>>
>> You may want to format it (e.g., new line whenever you start a new
statement).
>>
>> HTH,
>> donh
>>
>> ----------------------------------------
>>> Date: Tue, 12 Aug 2008 14:52:02 +0200
>>> From: wielki@INED.FR
>>> Subject: Re: Include SAS code w/o including SAS code
>>> To: SAS-L@LISTSERV.UGA.EDU
>>>
>>> Alan,
>>> not precisely clear what you are searching
>>> think thus also about this kind of program
>>> in addition to the mprint mfile answer of  ~data _null_
>>> HTH
>>> Andre
>>>
>>> libname malibmac "d:\temp";
>>> options mstores sasmstore=malibmac;
>>> %macro foobar(aarg)/store source des='nothing or interresting';
>>> %put arg=&arg;
>>> %mend;
>>> %copy foobar/source;
>>>
>>>
>>>
>>> Alan Churchill a 飲it :
>>>> All,
>>>>
>>>>
>>>>
>>>> Ok, I think this might be doable but I am drawing a blank.
>>>>
>>>>
>>>>
>>>> Suppose I have this code:
>>>>
>>>>
>>>>
>>>> %macro xyz;
>>>>
>>>>    data temp.temp4;
>>>>
>>>>    .do some sas stuff.
>>>>
>>>>   run;
>>>>
>>>> %mend;
>>>>
>>>>
>>>>
>>>> Is there a way to write the macro statements out to a file? I can run
them
>>>> but I would also like to save them outside of SAS.
>>>>
>>>> bname malibmac "d:\f\";

Ugly but, what about the PRINTTO procedure and the MPRINT option?  At the
end of your program, after you invoked the closing PRINTTO procedure, you
could grab the lines you wanted, with the nuance that macros could be
called within macros, but it should be a trifle.

HTH,

Kevin
0
citam.sasl (448)
8/13/2008 2:25:53 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

0 Replies
927 Views

Similar Articles

[PageSpeed] 18

Reply: