|
Well, I received a reply from SAS support. Unfortunately the reply
was...
"This is a bug in SAS for 9.1 and the developer is aware of the
problem. Unfortunately I do not have a work around other than not
using %COPY inside a macro."
...
I was, however, able to achieve a workaround as follows...
* ========================================================= ;
* Getting the source from stored_compiled(with source) macro catalogs ;
* Note: SAS 9.1 has KNOWN bug that doesn't allow %copy within a macro ;
libname oldmacs v9 '/sasprog/templates/macro_catalog_old'
access=readonly ;
ods output catalog_random=cr ; * this section can alternatively be done
with an SQL of dictionary.catalogs ;
ods listing close ;
proc catalog c=oldmacs.sasmacr ;
contents ;
quit;
ods output close ;
ods listing ;
data cr ;
set cr ;
var1='%copy ' ;
var2=' / source outfile="$HOME/'||trim(objname)||'.sas" ; ' ;
run;
options nodate nonumber ;
proc print data=cr noobs label ;
var var1 objname var2 ;
title1 'libname lib1 "/sasprog/templates/macro_catalog_old"
access=readonly ; ' ;
title2 'options mstored sasmstore=lib1 ; ' ;
label var1='*;' objname='*;' var2='*;' ;
run;
* ========================================================= ;
The output of this is the actual program needed to accomplish the %copy
within a macro.
|