Created
June 1, 2023 09:56
-
-
Save rudvfaden/fa59c09e8f53e625cf73b0c77a24ced6 to your computer and use it in GitHub Desktop.
Revisions
-
rudvfaden created this gist
Jun 1, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ %macro embed(f); %local p ref rc fid; %let p = %sysfunc(findc(&f,/\:.)); %if &p %then %let rc = %sysfunc(filename(ref, &f)); %else %let ref = &f; %let fid = %sysfunc(fopen(&ref)); %if &fid>0 %then %do %while(%sysfunc(fread(&fid))=0); %let rc = %sysfunc(fget(&fid, line, 32767)); &line %end; %else %put ERROR: Macro &sysmacroname - file "&f" cannot be opened.; %let rc = %sysfunc(fclose(&fid)); %if &p %then %let rc = %sysfunc(filename(ref)); %mend embed;