From 3bb83be0c5894793a240040f2f74978aa2cfbb70 Mon Sep 17 00:00:00 2001 From: Allan Date: Mon, 24 Jul 2023 16:59:29 +0100 Subject: [PATCH] fix: missing param in webout of SASjs Server and Viya --- all.sas | 40 +++++++++++++++++++--------------- base/mp_applyformats.sas | 10 ++++----- base/mp_copyfolder.sas | 2 +- base/mp_validatecol.sas | 4 ++-- meta/mm_createfolder.sas | 10 ++++----- meta/mm_getstpinfo.sas | 2 +- server/ms_createwebservice.sas | 6 +++-- viya/mv_createwebservice.sas | 6 +++-- 8 files changed, 44 insertions(+), 36 deletions(-) diff --git a/all.sas b/all.sas index 76b04a7..b298b91 100644 --- a/all.sas +++ b/all.sas @@ -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; diff --git a/base/mp_applyformats.sas b/base/mp_applyformats.sas index 06f4964..995908b 100644 --- a/base/mp_applyformats.sas +++ b/base/mp_applyformats.sas @@ -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; diff --git a/base/mp_copyfolder.sas b/base/mp_copyfolder.sas index 0199683..18ed1fd 100644 --- a/base/mp_copyfolder.sas +++ b/base/mp_copyfolder.sas @@ -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; diff --git a/base/mp_validatecol.sas b/base/mp_validatecol.sas index 9294813..a6e150c 100644 --- a/base/mp_validatecol.sas +++ b/base/mp_validatecol.sas @@ -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; diff --git a/meta/mm_createfolder.sas b/meta/mm_createfolder.sas index 5922d80..0b57c03 100644 --- a/meta/mm_createfolder.sas +++ b/meta/mm_createfolder.sas @@ -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; diff --git a/meta/mm_getstpinfo.sas b/meta/mm_getstpinfo.sas index d9b0f2d..02750be 100644 --- a/meta/mm_getstpinfo.sas +++ b/meta/mm_getstpinfo.sas @@ -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_)(=); diff --git a/server/ms_createwebservice.sas b/server/ms_createwebservice.sas index e8ab517..351f0d6 100644 --- a/server/ms_createwebservice.sas +++ b/server/ms_createwebservice.sas @@ -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; diff --git a/viya/mv_createwebservice.sas b/viya/mv_createwebservice.sas index e7dc86d..a970541 100644 --- a/viya/mv_createwebservice.sas +++ b/viya/mv_createwebservice.sas @@ -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;