1
0
mirror of https://github.com/sasjs/core.git synced 2025-12-10 14:04:36 +00:00

fix: missing param in webout of SASjs Server and Viya

This commit is contained in:
Allan
2023-07-24 16:59:29 +01:00
parent 76a20838ec
commit 3bb83be0c5
8 changed files with 44 additions and 36 deletions

40
all.sas
View File

@@ -2904,7 +2904,7 @@ data &outds;
if libref(lib) ne 0 then do;
msg=catx(' ','libref',lib,'is not assigned!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -2912,7 +2912,7 @@ data &outds;
if exist(cats(lib,'.',ds)) ne 1 then do;
msg=catx(' ','libds',lib,'.',ds,'does not exist!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -2921,7 +2921,7 @@ data &outds;
if is_fmt=0 then do;
msg=catx(' ','format',fmt,'on libds',lib,'.',ds,'.',var,'is not valid!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -2933,7 +2933,7 @@ data &outds;
if dsid=0 then do;
msg=catx(' ','libds',lib,'.',ds,' could not be opened!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -2941,7 +2941,7 @@ data &outds;
if varnum(dsid,var)<1 then do;
msg=catx(' ','Variable',lib,'.',ds,'.',var,' was not found!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
end;
@@ -4255,7 +4255,7 @@ drop table &ddlds,&cntlds;
rc2=filename(fref2,filepath2,'disk','recfm=n');
if fcopy(fref1,fref2) ne 0 then do;
msg=sysmsg();
putlog "%str(ERR)OR: Unable to copy " filepath " to " filepath2;
putlog 'ERR' +(-1) "OR: Unable to copy " filepath " to " filepath2;
putlog msg=;
end;
end;
@@ -13734,7 +13734,7 @@ alter table &libds modify &var char(&len);
retain &tempcol;
&tempcol=prxparse('/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}$/i');
if missing(&tempcol) then do;
putlog "%str(ERR)OR: Invalid expression for LIBDS";
putlog 'ERR' +(-1) "OR: Invalid expression for LIBDS";
stop;
end;
drop &tempcol;
@@ -13748,7 +13748,7 @@ alter table &libds modify &var char(&len);
retain &tempcol;
&tempcol=prxparse('/^[_a-z\$]\w{0,31}\.[0-9]*$/i');
if missing(&tempcol) then do;
putlog "%str(ERR)OR: Invalid expression for FORMAT";
putlog 'ERR' +(-1) "OR: Invalid expression for FORMAT";
stop;
end;
drop &tempcol;
@@ -15268,12 +15268,12 @@ data _null_;
* name must not be blank;
if ( folderPath = '' ) then do;
put "%str(ERR)OR: &sysmacroname PATH parameter value must be non-blank";
put 'ERR' +(-1) "OR: &sysmacroname PATH parameter value must be non-blank";
end;
* must have a starting slash ;
if ( substr(folderPath,1,1) ne '/' ) then do;
put "%str(ERR)OR: &sysmacroname PATH param value must have starting slash";
put 'ERR' +(-1) "OR: &sysmacroname PATH param value must have starting slash";
stop;
end;
@@ -15286,14 +15286,14 @@ data _null_;
* do not create a root (one level) folder ;
if countc(folderPath,'/')=1 then do;
put "%str(ERR)OR: &sysmacroname will not create a new ROOT folder";
put 'ERR' +(-1) "OR: &sysmacroname will not create a new ROOT folder";
stop;
end;
* check that root folder exists ;
root=cats('/',scan(folderpath,1,'/'),"(Folder)");
if metadata_pathobj('',root,"",objType,parentId)<1 then do;
put "%str(ERR)OR: " root " does not exist!";
put 'ERR' +(-1) "OR: " root " does not exist!";
stop;
end;
@@ -15358,7 +15358,7 @@ run;
putlog "SUCCCESS! &path created.";
end;
else do;
putlog "%str(ERR)OR: unsuccessful attempt to create &path";
putlog 'ERR' +(-1) "OR: unsuccessful attempt to create &path";
call symputx('syscc',8);
end;
run;
@@ -18737,7 +18737,7 @@ data &outds;
rc5=metadata_getattr(tsuri,"Name",servercontext);
end;
else do;
put "%str(ERR)OR: could not find " path;
put 'ERR' +(-1) "OR: could not find " path;
put (_all_)(=);
end;
&md.put (_all_)(=);
@@ -21845,9 +21845,11 @@ data _null_;
put ' ';
put '%mend mfs_httpheader; ';
/* WEBOUT END */
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO';
put ' ,maxobs=MAX';
put ');';
put ' %ms_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt,missing=&missing';
put ' ,showmeta=&showmeta';
put ' ,showmeta=&showmeta,maxobs=&maxobs';
put ' )';
put '%mend;';
run;
@@ -24491,9 +24493,11 @@ data _null_;
put '%global __program _program;';
put '%let _program=%sysfunc(coalescec(&__program,&_program));';
put ' ';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO';
put ' ,maxobs=MAX';
put ');';
put ' %mv_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt,missing=&missing';
put ' ,showmeta=&showmeta';
put ' ,showmeta=&showmeta,maxobs=&maxobs';
put ' )';
put '%mend;';
run;

View File

@@ -94,7 +94,7 @@ data &outds;
if libref(lib) ne 0 then do;
msg=catx(' ','libref',lib,'is not assigned!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -102,7 +102,7 @@ data &outds;
if exist(cats(lib,'.',ds)) ne 1 then do;
msg=catx(' ','libds',lib,'.',ds,'does not exist!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -111,7 +111,7 @@ data &outds;
if is_fmt=0 then do;
msg=catx(' ','format',fmt,'on libds',lib,'.',ds,'.',var,'is not valid!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -123,7 +123,7 @@ data &outds;
if dsid=0 then do;
msg=catx(' ','libds',lib,'.',ds,' could not be opened!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
return;
@@ -131,7 +131,7 @@ data &outds;
if varnum(dsid,var)<1 then do;
msg=catx(' ','Variable',lib,'.',ds,'.',var,' was not found!');
%if &errds=0 %then %do;
putlog "%str(ERR)OR: " msg;
putlog 'ERR' +(-1) "OR: " msg;
%end;
output;
end;

View File

@@ -69,7 +69,7 @@
rc2=filename(fref2,filepath2,'disk','recfm=n');
if fcopy(fref1,fref2) ne 0 then do;
msg=sysmsg();
putlog "%str(ERR)OR: Unable to copy " filepath " to " filepath2;
putlog 'ERR' +(-1) "OR: Unable to copy " filepath " to " filepath2;
putlog msg=;
end;
end;

View File

@@ -71,7 +71,7 @@
retain &tempcol;
&tempcol=prxparse('/^[_a-z]\w{0,7}\.[_a-z]\w{0,31}$/i');
if missing(&tempcol) then do;
putlog "%str(ERR)OR: Invalid expression for LIBDS";
putlog 'ERR' +(-1) "OR: Invalid expression for LIBDS";
stop;
end;
drop &tempcol;
@@ -85,7 +85,7 @@
retain &tempcol;
&tempcol=prxparse('/^[_a-z\$]\w{0,31}\.[0-9]*$/i');
if missing(&tempcol) then do;
putlog "%str(ERR)OR: Invalid expression for FORMAT";
putlog 'ERR' +(-1) "OR: Invalid expression for FORMAT";
stop;
end;
drop &tempcol;

View File

@@ -51,12 +51,12 @@ data _null_;
* name must not be blank;
if ( folderPath = '' ) then do;
put "%str(ERR)OR: &sysmacroname PATH parameter value must be non-blank";
put 'ERR' +(-1) "OR: &sysmacroname PATH parameter value must be non-blank";
end;
* must have a starting slash ;
if ( substr(folderPath,1,1) ne '/' ) then do;
put "%str(ERR)OR: &sysmacroname PATH param value must have starting slash";
put 'ERR' +(-1) "OR: &sysmacroname PATH param value must have starting slash";
stop;
end;
@@ -69,14 +69,14 @@ data _null_;
* do not create a root (one level) folder ;
if countc(folderPath,'/')=1 then do;
put "%str(ERR)OR: &sysmacroname will not create a new ROOT folder";
put 'ERR' +(-1) "OR: &sysmacroname will not create a new ROOT folder";
stop;
end;
* check that root folder exists ;
root=cats('/',scan(folderpath,1,'/'),"(Folder)");
if metadata_pathobj('',root,"",objType,parentId)<1 then do;
put "%str(ERR)OR: " root " does not exist!";
put 'ERR' +(-1) "OR: " root " does not exist!";
stop;
end;
@@ -141,7 +141,7 @@ run;
putlog "SUCCCESS! &path created.";
end;
else do;
putlog "%str(ERR)OR: unsuccessful attempt to create &path";
putlog 'ERR' +(-1) "OR: unsuccessful attempt to create &path";
call symputx('syscc',8);
end;
run;

View File

@@ -58,7 +58,7 @@ data &outds;
rc5=metadata_getattr(tsuri,"Name",servercontext);
end;
else do;
put "%str(ERR)OR: could not find " path;
put 'ERR' +(-1) "OR: could not find " path;
put (_all_)(=);
end;
&md.put (_all_)(=);

View File

@@ -652,9 +652,11 @@ data _null_;
put ' ';
put '%mend mfs_httpheader; ';
/* WEBOUT END */
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO';
put ' ,maxobs=MAX';
put ');';
put ' %ms_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt,missing=&missing';
put ' ,showmeta=&showmeta';
put ' ,showmeta=&showmeta,maxobs=&maxobs';
put ' )';
put '%mend;';
run;

View File

@@ -814,9 +814,11 @@ data _null_;
put '%global __program _program;';
put '%let _program=%sysfunc(coalescec(&__program,&_program));';
put ' ';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO);';
put '%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO';
put ' ,maxobs=MAX';
put ');';
put ' %mv_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt,missing=&missing';
put ' ,showmeta=&showmeta';
put ' ,showmeta=&showmeta,maxobs=&maxobs';
put ' )';
put '%mend;';
run;