⨳ Finding Conventions, Establishing Standards ⨳

2014 Aug 26, Tuesday

⨳ 1 minute read ⨳ 131 words ⨳ perlsas

I’m creating a perl script that reads through all .sas files in a directory taking note when a SAS macro is being defined.

I’m in a rut right now trying to figure out how to

%* in SAS, macros can be defined a few different ways;

%macro regular(param1);

%macro withDescription / des='bah';

%macro emptyOptions () ;

%macro noOptions;%mend;

%macro spacedOut (
) / some options;

%macro noSpace(a,b=c,d=e)/des='something';

%macro outside;
	%macro inside;

I’ve developed some perl code to index these macros.

(%macro\s.+?;) ## capture macro statement
%macro\s*(\w+)\s*(\(\s*.+?\s*\))??; ## capture macro name & paren with contents

Finding Conventions, Establishing Standards - August 26, 2014 - Richard Koopmann