57%macro mx_append2pgm(loc
62%local platform name shortloc coderef combref work tmpfile viyaref;
63%let platform=%mf_getplatform();
65%
if &mdebug=1 %then %
do;
66 %put &sysmacroname entry vars:;
69%
if &syscc ne 0 %then %
do;
70 %put syscc=&syscc - &sysmacroname will not execute in
this state;
76 length name shortloc $500;
78 name=scan(loc,-1,
'/');
79 shortloc=substr(loc,1,length(loc)-length(name)-1);
80 call symputx(
'name',name,
'l');
81 call symputx(
'shortloc',shortloc,
'l');
85%let combref=%mf_getuniquefileref();
86%let work=%sysfunc(pathname(work));
87%let tmpfile=&combref..sas;
88filename &combref
"&work/&tmpfile" lrecl=32000;
90%
if &platform=SASVIYA %then %
do;
92 %let viyaref=%mf_getuniquefileref();
93 filename &viyaref filesrvc folderpath=
"&shortloc";
95 file &combref lrecl=32000 termstr=crlf;
96 infile &viyaref(
"&name..sas") lrecl=32000 end=last;
100 filename &viyaref clear;
101 %symdel _FILESRVC_&viyaref._URI;
105 %let coderef=%mf_getuniquefileref();
106 %mx_getcode(&loc, outref=&coderef)
108 file &combref lrecl=32000 termstr=crlf;
109 infile &coderef lrecl=32000 end=last;
113 filename &coderef clear;
118 file &combref lrecl=32000 termstr=crlf mod;
119 infile &inref lrecl=32000;
125%if &platform=SASJS %then %do;
126 %ms_deletefile(&loc..sas)
127 %ms_createfile(&loc..sas, inref=&combref, mdebug=&mdebug)
129%else %if &platform=SASVIYA %then %do;
130 %mv_deletefoldermember(path=&shortloc, name=&name..sas, contenttype=file)
131 %mv_createfile(path=&shortloc, name=&name..sas, inref=&combref)
135 %mm_deletestp(target=&loc)
136 %mm_createstp(stpname=&name
146filename &combref clear;