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 (June 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 16 Jun 2007 08:33:18 -0700
Reply-To:   barry.debenham@TALK21.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   barry.debenham@TALK21.COM
Organization:   http://groups.google.com
Subject:   Re: Macro text to file
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1181983893.933434.86650@c77g2000hse.googlegroups.com>
Content-Type:   text/plain; charset="us-ascii"

On 16 Jun, 09:51, abose <hira...@gmail.com> wrote: > Hi, > Is there any foolproof way to output the text generated by any macro > to a file (using data _null_ and put may be)? > > The reason I ask: > > Where I work, it is a mainframe system. I can put JCL and SAS commands > to a special file, to create a new job. I would like to have some > macro which can create new jobs. Example, I would want to have a macro > %Fork which can create a new job, taking the argument as a macro which > generates SAS code: > > %Macro Process(parameter); > ...whatever the job should do... > %Mend; > > %Fork(%Process(a)) > %Fork(%Process(b)) > %Fork(%Process(c))

You can write the output of a sas macro to an external file using the 'mfile mprint' option.

e.g. /* issue the options statement */ options mfile mprint;

/* Allocate a filename to recieve the macro output */ filename mprint 'aaaa.bbbb.cccc.ddd(xxxx)';

/* Run your macros */ %Fork(%Process(a)) %Fork(%Process(b)) %Fork(%Process(c)) Filename mprint clear;

The code generated by the macro swill be placed in the file allocated as mprint. It will be available at the end of you SAS session for debugging. From a JCL submitted job it is available at the end of the job step. I hope that this might be of some help.

Regards,

Barry D.


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