Created
June 1, 2023 09:56
-
-
Save rudvfaden/fa59c09e8f53e625cf73b0c77a24ced6 to your computer and use it in GitHub Desktop.
This file contains 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 characters
%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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment