|
Ron,
Thanks for the suggestions. I found many, but not all of the source
codes and have now recompiled them for Version 9 (using the / source
option).
I've tried writing a short macro to PRINT UP all of these sources from
a new 9.1.3 catalog but keep getting a ...
ERROR: Macro library damaged. Cannot execute macro DOIT.
ERROR: The macro DOIT will stop executing.
... message.
It may have something to do with a macro compiled in WORK.sasmacr
trying to access a stored sasmacr catalog? Do you have any ideas why
this is not working?
* ========= My code follows ======================================= ;
* Getting the source from stored_compiled(with source) macro catalogs ;
libname oldmacs v9 'C:' ;
ods output catalog_random=cr ; * this creates a dataset containing the
name of all the macros in the catalog
;
ods listing close ;
proc catalog c=oldmacs.sasmacr ;
contents ;
quit;
ods output close ;
ods listing ;
proc sql noprint ;
select objname into :o1-:o1000 from cr ; * this creates macro
variables
containing the names of
the
macros in the stored
catalog;
select count(objname) into :n from cr ; * this returns the NUMBER of
names found ;
quit;
options mstored sasmstore=oldmacs ;
%macro doit ;
%do i=1 %to &n ;
%copy &&o&i / source ; * this will go to the log ;
%copy &&o&i / source outfile= "$HOME/OLDMACS.&&o&i" ; * this will
create output files ;
%end ;
%mend doit ;
%doit ;
* ======== End of code ========================================== ;
Thanks for any insight,
Mark
Fehd, Ronald J. PHPPO wrote:
> > From: Mark S Goldberg
> >
> > We recently migrated around 20,000 datasets from Version 6.12
> > to 9.1.3. For
> > most of the process we used proc migrate. For older datasets (6.08
and
> > earlier) we used transport engine. For format catalogs we
> > used cport/import.
> >
> > NOW... we suddently discovered some 25 macro catalogs
> > (sasmacr.sct01) with
> > no source code and "apparently" there is no way to
> > migrate/convert/change
> > these catalogs to 9.1.3. I say "apparently" because I'm hoping
that
> > someone has some way to do this that I've missed.
>
> it was a busy morning:
> you'll want to run
>
> libname LibRef '.';
>
> PROC Catalog catalog = LibRef.SASmacr
> entrytype = macro
> ;contents
> ;quit;
>
> for each macro named
> search for a file named <macroname>.sas
>
> if that fails
> then you'll be searching *.sas
> for <macroname>
> or the option 'store'
>
> these compiled and stored macros will have the following option:
>
> %Macro <MacroName> (<parameter list>)
> /store;
>
> if the authors had any class at all
> the macros would also have a description
> which may help in identifying them.
>
> %Macro <MacroName> (<parameter list>)
> / des = 'some description goes here'
> store
> ;
>
> Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
>
> do not fold, spindle, or mutilate -- IBM punch card
> ... the folder with the compiled and stored macros
|