51%macro mcf_string2file(wrap=NO
52 ,insert_cmplib=DEPRECATED
57%local i var cmpval found;
58%
if %mcf_init(mcf_string2file)=1 %then %
return;
60%
if &wrap=YES %then %
do;
61 proc fcmp outlib=&lib..&cat..&pkg;
64function mcf_string2file(filepath $,
string $, mode $);
65 if mode=
'APPEND' then fmode=
'a';
68 rc=filename(fref,filepath);
69 if (rc ne 0) then
return( -1 );
70 fid = fopen(fref,fmode);
71 if (fid = 0) then
return( -1 );
80%
if &wrap=YES %then %
do;
85%let cmpval=%sysfunc(getoption(cmplib));
87%
do i=1 %to %sysfunc(countw(&cmpval,%str( %(%))));
88 %let var=%scan(&cmpval,&i,%str( %(%)));
89 %
if &var=&lib..&cat %then %let found=1;
91%
if &found=0 %then %
do;
92 options insert=(CMPLIB=(&lib..&cat));