From 42bd1750bdd1467912de9647a0c99be3e2ce282a Mon Sep 17 00:00:00 2001 From: munja Date: Sun, 12 Dec 2021 22:57:25 +0000 Subject: [PATCH 1/3] feat: adding varinitchk=ERROR to mp_init. Closes #110. Also updated the comments / documentation --- base/mp_init.sas | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/base/mp_init.sas b/base/mp_init.sas index 5fbff21..09cae00 100644 --- a/base/mp_init.sas +++ b/base/mp_init.sas @@ -1,15 +1,25 @@ /** @file @brief Initialise session with useful settings and variables - @details Implements a set of recommended options for general SAS use. This - macro is NOT used elsewhere within the core library (other than in tests), - but it is used by the SASjs team when building web services for - SAS-Powered applications elsewhere. + @details Implements a "strict" set of SAS options for use in defensive + programming. Highly recommended, if you want your code to run on some + other machine. - If you have a good idea for an option, setting, or useful global variable - - feel free to [raise an issue](https://github.com/sasjs/core/issues/new)! + This macro is recommended to be compiled and invoked in the `initProgram` + for SASjs [Jobs](https://cli.sasjs.io/sasjsconfig.html#jobConfig_initProgram + ), [Services]( + https://cli.sasjs.io/sasjsconfig.html#serviceConfig_initProgram) and [Tests] + (https://cli.sasjs.io/sasjsconfig.html#testConfig_initProgram). - All global variables are prefixed with "SASJS_" (unless modfied with the + For non SASjs projects, you could invoke in the autoexec, or in your own + solution initialisation macro. + + + If you have a good idea for another useful option, setting, or global + variable - feel free to [raise an issue]( + https://github.com/sasjs/core/issues/new)! + + All global variables are prefixed with "SASJS" (unless modified with the prefix parameter). @param [in] prefix= (SASJS) The prefix to apply to the global macro variables @@ -39,15 +49,16 @@ autocorrect /* disallow mis-spelled procedure names */ compress=CHAR /* default is none so ensure we have something! */ datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */ - errorcheck=STRICT /* catch errors in libname/filename statements */ - fmterr /* ensure err when a format cannot be found */ - mergenoby=%str(ERR)OR /* Throw err when a merge has no BY variables */ - missing=. /* some sites change this which causes hard to detect errors */ + errorcheck=STRICT /* catch errs in libname/filename statements */ + fmterr /* ensure err when a format cannot be found */ + mergenoby=%str(ERR)OR /* throw err when a merge has no BY variables */ + missing=. /* changing this can cause hard to detect errs */ noquotelenmax /* avoid warnings for long strings */ noreplace /* avoid overwriting permanent datasets */ ps=max /* reduce log size slightly */ validmemname=COMPATIBLE /* avoid special characters etc in table names */ validvarname=V7 /* avoid special characters etc in variable names */ + varinitchk=%str(ERR)OR /* avoid data mistakes from variable name typos */ varlenchk=%str(ERR)OR /* fail hard if truncation (data loss) can result */ ; From 0885bad8596ab604a21f1554c00f29b5fb227c62 Mon Sep 17 00:00:00 2001 From: munja Date: Mon, 13 Dec 2021 01:07:54 +0000 Subject: [PATCH 2/3] fix: updating the tests following varinitchk=error enablement. Removing the word 'error' from documenttion. --- base/mf_existfeature.sas | 2 +- base/mf_getattrc.sas | 2 +- base/mf_getattrn.sas | 2 +- base/mf_mkdir.sas | 2 +- base/mf_nobs.sas | 2 +- base/mp_copyfolder.sas | 6 ++++-- base/mp_ds2fmtds.sas | 15 +++++++++++---- base/mp_ds2inserts.sas | 1 + base/mp_filtervalidate.sas | 4 ++-- base/mp_getconstraints.sas | 6 +++--- base/mp_getddl.sas | 2 +- base/mp_init.sas | 2 +- base/mp_jsonout.sas | 2 +- base/mp_lockanytable.sas | 2 +- tests/crossplatform/mp_ds2fmtds.test.sas | 4 +++- tests/viyaonly/mv_createwebservice.test.sas | 1 + viya/mv_getfoldermembers.sas | 1 + viya/mv_jobwaitfor.sas | 1 + 18 files changed, 36 insertions(+), 21 deletions(-) diff --git a/base/mf_existfeature.sas b/base/mf_existfeature.sas index 23bad62..ecca91a 100644 --- a/base/mf_existfeature.sas +++ b/base/mf_existfeature.sas @@ -5,7 +5,7 @@ Run without arguments to see a list of detectable features. Note - this list is based on known versions of SAS rather than actual feature detection, as that is tricky / impossible to do - without generating errors in most cases. + without generating errs in most cases. %put %mf_existfeature(PROCLUA); diff --git a/base/mf_getattrc.sas b/base/mf_getattrc.sas index b1c7cc1..4e0fd51 100644 --- a/base/mf_getattrc.sas +++ b/base/mf_getattrc.sas @@ -10,7 +10,7 @@ @param attr full list in [documentation]( https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000147794.htm) @return output returns result of the attrc value supplied, or -1 and log - message if error. + message if err. @version 9.2 @author Allan Bowe diff --git a/base/mf_getattrn.sas b/base/mf_getattrn.sas index f2ca561..fdb47a7 100755 --- a/base/mf_getattrn.sas +++ b/base/mf_getattrn.sas @@ -10,7 +10,7 @@ @param attr Common values are NLOBS and NVARS, full list in [documentation]( http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212040.htm) @return output returns result of the attrn value supplied, or -1 and log - message if error. + message if err. @version 9.2 @author Allan Bowe diff --git a/base/mf_mkdir.sas b/base/mf_mkdir.sas index 763271b..464b468 100755 --- a/base/mf_mkdir.sas +++ b/base/mf_mkdir.sas @@ -51,7 +51,7 @@ Usage: %end; /* - Now create the directory. Complain loudly of any errors. + Now create the directory. Complain loudly of any errs. */ %let dname = %sysfunc(dcreate(&child, &parent)); diff --git a/base/mf_nobs.sas b/base/mf_nobs.sas index c72660f..0bdc29b 100755 --- a/base/mf_nobs.sas +++ b/base/mf_nobs.sas @@ -12,7 +12,7 @@ @param libds library.dataset @return output returns result of the attrn value supplied, or log message - if error. + if err. @version 9.2 diff --git a/base/mp_copyfolder.sas b/base/mp_copyfolder.sas index 0800857..d52fa6b 100644 --- a/base/mp_copyfolder.sas +++ b/base/mp_copyfolder.sas @@ -55,6 +55,8 @@ /* create folders and copy content */ data _null_; set work.&tempds; + length msg $256; + call missing(msg); if _n_ = 1 then dpos+sum(length(directory),2); filepath2="&target/"!!substr(filepath,dpos); if file_or_folder='folder' then call execute('%mf_mkdir('!!filepath2!!')'); @@ -63,9 +65,9 @@ rc1=filename(fref1,filepath,'disk','recfm=n'); rc2=filename(fref2,filepath2,'disk','recfm=n'); if fcopy(fref1,fref2) ne 0 then do; - sysmsg=sysmsg(); + msg=sysmsg(); putlog "%str(ERR)OR: Unable to copy " filepath " to " filepath2; - putlog sysmg=; + putlog msg=; end; end; rc=filename(fref1); diff --git a/base/mp_ds2fmtds.sas b/base/mp_ds2fmtds.sas index 9b810a6..f5ad608 100644 --- a/base/mp_ds2fmtds.sas +++ b/base/mp_ds2fmtds.sas @@ -1,16 +1,22 @@ /** @file - @brief Converts every value in a dataset to it's formatted value + @brief Converts every value in a dataset to formatted value @details Converts every value to it's formatted value. All variables will - become character, and will be in the same order. + become character, and will be in the same order as the original dataset. + + Lengths will be adjusted according to the format lengths, where applicable. Usage: %mp_ds2fmtds(sashelp.cars,work.cars) + %mp_ds2fmtds(sashelp.vallopt,vw_vallopt) @param [in] libds The library.dataset to be converted @param [out] outds The dataset to create. +

SAS Macros

+ @li mf_existds.sas +

Related Macros

@li mp_jsonout.sas @@ -22,8 +28,9 @@ )/*/STORE SOURCE*/; /* validations */ -%if not %sysfunc(exist(&libds)) %then %do; - %put %str(WARN)ING: &libds does not exist; + +%if not %mf_existds(libds=&libds) %then %do; + %put %str(WARN)ING: &libds does not exist as either a VIEW or DATASET; %return; %end; %if %index(&libds,.)=0 %then %let libds=WORK.&libds; diff --git a/base/mp_ds2inserts.sas b/base/mp_ds2inserts.sas index 073d8b6..342ca95 100644 --- a/base/mp_ds2inserts.sas +++ b/base/mp_ds2inserts.sas @@ -116,6 +116,7 @@ data _null_; if _n_>&maxobs then stop; %end; length _____str $32767; + call missing(_____str); format _numeric_ best.; format _character_ ; %local i comma var vtype vfmt; diff --git a/base/mp_filtervalidate.sas b/base/mp_filtervalidate.sas index 7544291..3dd89a1 100644 --- a/base/mp_filtervalidate.sas +++ b/base/mp_filtervalidate.sas @@ -33,8 +33,8 @@ @param [in] targetds The target dataset against which to verify the query @param [out] abort= (YES) If YES will call mp_abort.sas on any exceptions @param [out] outds= (work.mp_filtervalidate) Output dataset containing the - error / warning message, if one exists. If this table contains any rows, - there are problems! + err / warning message, if one exists. If this table contains any rows, + there are problems!

SAS Macros

@li mf_getuniquefileref.sas diff --git a/base/mp_getconstraints.sas b/base/mp_getconstraints.sas index 57087b8..78dfcd3 100644 --- a/base/mp_getconstraints.sas +++ b/base/mp_getconstraints.sas @@ -48,17 +48,17 @@ %let vw=%mf_getuniquename(prefix=mp_getconstraints_vw_); data &vw /view=&vw; set sashelp.vcncolu; - where TABLE_CATALOG="&lib"; + where table_catalog="&lib"; /* use retain approach to reset the constraint order with each constraint */ length tmp $1000; retain tmp; drop tmp; - if tmp ne catx('|',libref,table_name,constraint_type,constraint_name) then do; + if tmp ne catx('|',table_catalog,table_name,constraint_name) then do; constraint_order=1; end; else constraint_order+1; - tmp=catx('|',libref, table_name, constraint_type,constraint_name); + tmp=catx('|',table_catalog, table_name,constraint_name); run; /* must use SQL as proc datasets does not support length changes */ diff --git a/base/mp_getddl.sas b/base/mp_getddl.sas index 5ce3277..b60f522 100644 --- a/base/mp_getddl.sas +++ b/base/mp_getddl.sas @@ -139,7 +139,7 @@ run; %let curds=%scan(&dsnlist,&x); data _null_; file &fref mod; - length nm lab $1024 typ $20; + length lab $1024 typ $20; set &colinfo (where=(upcase(memname)="&curds")) end=last; if _n_=1 then do; diff --git a/base/mp_init.sas b/base/mp_init.sas index 09cae00..65592dd 100644 --- a/base/mp_init.sas +++ b/base/mp_init.sas @@ -49,7 +49,7 @@ autocorrect /* disallow mis-spelled procedure names */ compress=CHAR /* default is none so ensure we have something! */ datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */ - errorcheck=STRICT /* catch errs in libname/filename statements */ + %str(err)orcheck=STRICT /* catch errs in libname/filename statements */ fmterr /* ensure err when a format cannot be found */ mergenoby=%str(ERR)OR /* throw err when a merge has no BY variables */ missing=. /* changing this can cause hard to detect errs */ diff --git a/base/mp_jsonout.sas b/base/mp_jsonout.sas index ca65ee8..226b536 100644 --- a/base/mp_jsonout.sas +++ b/base/mp_jsonout.sas @@ -63,7 +63,7 @@ %if &action=OPEN %then %do; options nobomfile; data _null_;file &jref encoding='utf-8'; - put '{"START_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '"'; + put '{"PROCESSED_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '"'; run; %end; %else %if (&action=ARR or &action=OBJ) %then %do; diff --git a/base/mp_lockanytable.sas b/base/mp_lockanytable.sas index e4dcab6..ea91ca7 100644 --- a/base/mp_lockanytable.sas +++ b/base/mp_lockanytable.sas @@ -239,7 +239,7 @@ run; %let abortme=1; %end; -/* catch errors - mp_abort must be called outside of a logic block */ +/* catch errs - mp_abort must be called outside of a logic block */ %mp_abort(iftrue=(&abortme=1), msg=%superq(msg), mac=&sysmacroname diff --git a/tests/crossplatform/mp_ds2fmtds.test.sas b/tests/crossplatform/mp_ds2fmtds.test.sas index 0d6de69..e352150 100644 --- a/tests/crossplatform/mp_ds2fmtds.test.sas +++ b/tests/crossplatform/mp_ds2fmtds.test.sas @@ -15,10 +15,12 @@ filename inc temp; data _null_; set work.test; file inc; - line=cats('%mp_ds2fmtds(sashelp.',memname,',',memname,')'); + libds=cats('sashelp.',memname); + if exist(libds) then line=cats('%mp_ds2fmtds(',libds,',',memname,')'); put line; run; +options obs=50; %inc inc; %mp_assert( diff --git a/tests/viyaonly/mv_createwebservice.test.sas b/tests/viyaonly/mv_createwebservice.test.sas index 25b7298..d23e1a6 100644 --- a/tests/viyaonly/mv_createwebservice.test.sas +++ b/tests/viyaonly/mv_createwebservice.test.sas @@ -33,6 +33,7 @@ run; %put TEST1: checking web service code; data work.test_results; length test_description $256 test_result $4 test_comments $256; + if _n_=1 then call missing (of _all_); infile compare end=eof; input; if eof then do; diff --git a/viya/mv_getfoldermembers.sas b/viya/mv_getfoldermembers.sas index df27ae1..65db7be 100644 --- a/viya/mv_getfoldermembers.sas +++ b/viya/mv_getfoldermembers.sas @@ -123,6 +123,7 @@ options noquotelenmax; libname &libref2 JSON fileref=&fname2; data &outds; length id $36 name $128 uri $64 type $32 description $256; + if _n_=1 then call missing (of _all_); set &libref2..items; run; filename &fname2 clear; diff --git a/viya/mv_jobwaitfor.sas b/viya/mv_jobwaitfor.sas index ff31f8b..b485365 100644 --- a/viya/mv_jobwaitfor.sas +++ b/viya/mv_jobwaitfor.sas @@ -168,6 +168,7 @@ run; data &outds; format _program uri $128. state $32. stateDetails $32. timestamp datetime19. jobparams $32767.; + call missing (of _all_); stop; run; From 0a29006914bc1051b4df5abeb9a62f2119f13bc7 Mon Sep 17 00:00:00 2001 From: munja Date: Mon, 13 Dec 2021 01:08:37 +0000 Subject: [PATCH 3/3] chore: running all.sas --- all.sas | 87 +++++++++++++++++++++++------------- meta/mm_createwebservice.sas | 2 +- viya/mv_createwebservice.sas | 2 +- 3 files changed, 57 insertions(+), 34 deletions(-) diff --git a/all.sas b/all.sas index b3eda7c..c6fbf44 100644 --- a/all.sas +++ b/all.sas @@ -79,7 +79,7 @@ options noquotelenmax; Run without arguments to see a list of detectable features. Note - this list is based on known versions of SAS rather than actual feature detection, as that is tricky / impossible to do - without generating errors in most cases. + without generating errs in most cases. %put %mf_existfeature(PROCLUA); @@ -362,7 +362,7 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex @param attr full list in [documentation]( https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000147794.htm) @return output returns result of the attrc value supplied, or -1 and log - message if error. + message if err. @version 9.2 @author Allan Bowe @@ -395,7 +395,7 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex @param attr Common values are NLOBS and NVARS, full list in [documentation]( http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212040.htm) @return output returns result of the attrn value supplied, or -1 and log - message if error. + message if err. @version 9.2 @author Allan Bowe @@ -1421,7 +1421,7 @@ Usage: %end; /* - Now create the directory. Complain loudly of any errors. + Now create the directory. Complain loudly of any errs. */ %let dname = %sysfunc(dcreate(&child, &parent)); @@ -1468,7 +1468,7 @@ Usage: @param libds library.dataset @return output returns result of the attrn value supplied, or log message - if error. + if err. @version 9.2 @@ -2791,6 +2791,8 @@ run; /* create folders and copy content */ data _null_; set work.&tempds; + length msg $256; + call missing(msg); if _n_ = 1 then dpos+sum(length(directory),2); filepath2="&target/"!!substr(filepath,dpos); if file_or_folder='folder' then call execute('%mf_mkdir('!!filepath2!!')'); @@ -2799,9 +2801,9 @@ run; rc1=filename(fref1,filepath,'disk','recfm=n'); rc2=filename(fref2,filepath2,'disk','recfm=n'); if fcopy(fref1,fref2) ne 0 then do; - sysmsg=sysmsg(); + msg=sysmsg(); putlog "%str(ERR)OR: Unable to copy " filepath " to " filepath2; - putlog sysmg=; + putlog msg=; end; end; rc=filename(fref1); @@ -3876,17 +3878,23 @@ run; %mend mp_ds2csv;/** @file - @brief Converts every value in a dataset to it's formatted value + @brief Converts every value in a dataset to formatted value @details Converts every value to it's formatted value. All variables will - become character, and will be in the same order. + become character, and will be in the same order as the original dataset. + + Lengths will be adjusted according to the format lengths, where applicable. Usage: %mp_ds2fmtds(sashelp.cars,work.cars) + %mp_ds2fmtds(sashelp.vallopt,vw_vallopt) @param [in] libds The library.dataset to be converted @param [out] outds The dataset to create. +

SAS Macros

+ @li mf_existds.sas +

Related Macros

@li mp_jsonout.sas @@ -3898,8 +3906,9 @@ run; )/*/STORE SOURCE*/; /* validations */ -%if not %sysfunc(exist(&libds)) %then %do; - %put %str(WARN)ING: &libds does not exist; + +%if not %mf_existds(libds=&libds) %then %do; + %put %str(WARN)ING: &libds does not exist as either a VIEW or DATASET; %return; %end; %if %index(&libds,.)=0 %then %let libds=WORK.&libds; @@ -4089,6 +4098,7 @@ data _null_; if _n_>&maxobs then stop; %end; length _____str $32767; + call missing(_____str); format _numeric_ best.; format _character_ ; %local i comma var vtype vfmt; @@ -4489,8 +4499,8 @@ filename &outref temp; @param [in] targetds The target dataset against which to verify the query @param [out] abort= (YES) If YES will call mp_abort.sas on any exceptions @param [out] outds= (work.mp_filtervalidate) Output dataset containing the - error / warning message, if one exists. If this table contains any rows, - there are problems! + err / warning message, if one exists. If this table contains any rows, + there are problems!

SAS Macros

@li mf_getuniquefileref.sas @@ -4674,17 +4684,17 @@ run; %let vw=%mf_getuniquename(prefix=mp_getconstraints_vw_); data &vw /view=&vw; set sashelp.vcncolu; - where TABLE_CATALOG="&lib"; + where table_catalog="&lib"; /* use retain approach to reset the constraint order with each constraint */ length tmp $1000; retain tmp; drop tmp; - if tmp ne catx('|',libref,table_name,constraint_type,constraint_name) then do; + if tmp ne catx('|',table_catalog,table_name,constraint_name) then do; constraint_order=1; end; else constraint_order+1; - tmp=catx('|',libref, table_name, constraint_type,constraint_name); + tmp=catx('|',table_catalog, table_name,constraint_name); run; /* must use SQL as proc datasets does not support length changes */ @@ -5194,7 +5204,7 @@ run; %let curds=%scan(&dsnlist,&x); data _null_; file &fref mod; - length nm lab $1024 typ $20; + length lab $1024 typ $20; set &colinfo (where=(upcase(memname)="&curds")) end=last; if _n_=1 then do; @@ -6333,15 +6343,25 @@ filename &tempref clear; %mend mp_include;/** @file @brief Initialise session with useful settings and variables - @details Implements a set of recommended options for general SAS use. This - macro is NOT used elsewhere within the core library (other than in tests), - but it is used by the SASjs team when building web services for - SAS-Powered applications elsewhere. + @details Implements a "strict" set of SAS options for use in defensive + programming. Highly recommended, if you want your code to run on some + other machine. - If you have a good idea for an option, setting, or useful global variable - - feel free to [raise an issue](https://github.com/sasjs/core/issues/new)! + This macro is recommended to be compiled and invoked in the `initProgram` + for SASjs [Jobs](https://cli.sasjs.io/sasjsconfig.html#jobConfig_initProgram + ), [Services]( + https://cli.sasjs.io/sasjsconfig.html#serviceConfig_initProgram) and [Tests] + (https://cli.sasjs.io/sasjsconfig.html#testConfig_initProgram). - All global variables are prefixed with "SASJS_" (unless modfied with the + For non SASjs projects, you could invoke in the autoexec, or in your own + solution initialisation macro. + + + If you have a good idea for another useful option, setting, or global + variable - feel free to [raise an issue]( + https://github.com/sasjs/core/issues/new)! + + All global variables are prefixed with "SASJS" (unless modified with the prefix parameter). @param [in] prefix= (SASJS) The prefix to apply to the global macro variables @@ -6371,15 +6391,16 @@ filename &tempref clear; autocorrect /* disallow mis-spelled procedure names */ compress=CHAR /* default is none so ensure we have something! */ datastmtchk=ALLKEYWORDS /* protection from overwriting input datasets */ - errorcheck=STRICT /* catch errors in libname/filename statements */ - fmterr /* ensure err when a format cannot be found */ - mergenoby=%str(ERR)OR /* Throw err when a merge has no BY variables */ - missing=. /* some sites change this which causes hard to detect errors */ + %str(err)orcheck=STRICT /* catch errs in libname/filename statements */ + fmterr /* ensure err when a format cannot be found */ + mergenoby=%str(ERR)OR /* throw err when a merge has no BY variables */ + missing=. /* changing this can cause hard to detect errs */ noquotelenmax /* avoid warnings for long strings */ noreplace /* avoid overwriting permanent datasets */ ps=max /* reduce log size slightly */ validmemname=COMPATIBLE /* avoid special characters etc in table names */ validvarname=V7 /* avoid special characters etc in variable names */ + varinitchk=%str(ERR)OR /* avoid data mistakes from variable name typos */ varlenchk=%str(ERR)OR /* fail hard if truncation (data loss) can result */ ; @@ -6448,7 +6469,7 @@ filename &tempref clear; %if &action=OPEN %then %do; options nobomfile; data _null_;file &jref encoding='utf-8'; - put '{"START_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '"'; + put '{"PROCESSED_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '"'; run; %end; %else %if (&action=ARR or &action=OBJ) %then %do; @@ -7010,7 +7031,7 @@ run; %let abortme=1; %end; -/* catch errors - mp_abort must be called outside of a logic block */ +/* catch errs - mp_abort must be called outside of a logic block */ %mp_abort(iftrue=(&abortme=1), msg=%superq(msg), mac=&sysmacroname @@ -11112,7 +11133,7 @@ data _null_; put '%if &action=OPEN %then %do; '; put ' options nobomfile; '; put ' data _null_;file &jref encoding=''utf-8''; '; - put ' put ''{"START_DTTM" : "'' "%sysfunc(datetime(),datetime20.3)" ''"''; '; + put ' put ''{"PROCESSED_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''"''; '; put ' run; '; put '%end; '; put '%else %if (&action=ARR or &action=OBJ) %then %do; '; @@ -16194,7 +16215,7 @@ data _null_; put '%if &action=OPEN %then %do; '; put ' options nobomfile; '; put ' data _null_;file &jref encoding=''utf-8''; '; - put ' put ''{"START_DTTM" : "'' "%sysfunc(datetime(),datetime20.3)" ''"''; '; + put ' put ''{"PROCESSED_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''"''; '; put ' run; '; put '%end; '; put '%else %if (&action=ARR or &action=OBJ) %then %do; '; @@ -17441,6 +17462,7 @@ options noquotelenmax; libname &libref2 JSON fileref=&fname2; data &outds; length id $36 name $128 uri $64 type $32 description $256; + if _n_=1 then call missing (of _all_); set &libref2..items; run; filename &fname2 clear; @@ -19525,6 +19547,7 @@ run; data &outds; format _program uri $128. state $32. stateDetails $32. timestamp datetime19. jobparams $32767.; + call missing (of _all_); stop; run; diff --git a/meta/mm_createwebservice.sas b/meta/mm_createwebservice.sas index 4aedae2..d7bbdd3 100644 --- a/meta/mm_createwebservice.sas +++ b/meta/mm_createwebservice.sas @@ -95,7 +95,7 @@ data _null_; put '%if &action=OPEN %then %do; '; put ' options nobomfile; '; put ' data _null_;file &jref encoding=''utf-8''; '; - put ' put ''{"START_DTTM" : "'' "%sysfunc(datetime(),datetime20.3)" ''"''; '; + put ' put ''{"PROCESSED_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''"''; '; put ' run; '; put '%end; '; put '%else %if (&action=ARR or &action=OBJ) %then %do; '; diff --git a/viya/mv_createwebservice.sas b/viya/mv_createwebservice.sas index ad44d77..6ba39c1 100644 --- a/viya/mv_createwebservice.sas +++ b/viya/mv_createwebservice.sas @@ -243,7 +243,7 @@ data _null_; put '%if &action=OPEN %then %do; '; put ' options nobomfile; '; put ' data _null_;file &jref encoding=''utf-8''; '; - put ' put ''{"START_DTTM" : "'' "%sysfunc(datetime(),datetime20.3)" ''"''; '; + put ' put ''{"PROCESSED_DTTM" : "'' "%sysfunc(datetime(),E8601DT26.6)" ''"''; '; put ' run; '; put '%end; '; put '%else %if (&action=ARR or &action=OBJ) %then %do; ';