From 716ee6eba0a28f4f0a7a96b0719caf15da9b6e78 Mon Sep 17 00:00:00 2001 From: allan Date: Tue, 10 Feb 2026 16:34:09 +0000 Subject: [PATCH] fix: using fcopy instead of binary copy for file upload, for Viya 2026 compatibility --- sas/sasjs/services/admin/demodata.sas | 27 +++++++++++-------------- sas/sasjs/services/editors/loadfile.sas | 10 +++++++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/sas/sasjs/services/admin/demodata.sas b/sas/sasjs/services/admin/demodata.sas index 76184c5..b89b3ea 100644 --- a/sas/sasjs/services/admin/demodata.sas +++ b/sas/sasjs/services/admin/demodata.sas @@ -3,12 +3,19 @@ @brief Creates demo tables and associated config @details Can be removed in prod installs. - To activate this job, set dcdemoflag=1 + To activate this job, add the following to SETTINGS: + + %let demolib=PUBLIC; + libname &demolib "%sysfunc(pathname(&dc_libref))/&demolib"; + %let joblib=HOOKLIB; + libname &joblib "%sysfunc(pathname(&dc_libref))/&joblib"; + %let dcdemoflag=1; Note that this will: * REPLACE any tables named CARS_EXT or COUNTRIES in the PUBLIC library * REPLACE all DC config for libraries named PUBLIC * CREATE a folder called "demo" in the DC Apploc + * CREATE two BASE libraries (HOOKLIB & PUBLIC) in the DC (physical) folder

SAS Macros

@li mpeinit.sas @@ -29,20 +36,10 @@ **/ - - -%let dcdemoflag=1; -%let demolib=PUBLIC; - -options dlcreatedir; -%mpeinit() - -/* to enable - delete flag below and add libs to SETTINGS */ %let dcdemoflag=0; -libname &demolib "%sysfunc(pathname(&dc_libref))/&demolib"; - -%let joblib=HOOKLIB; -libname &joblib "%sysfunc(pathname(&dc_libref))/&joblib"; +options dlcreatedir; +%global joblib demolib; +%mpeinit() %mp_abort(iftrue= (&dcdemoflag ne 1) ,mac=&_program @@ -322,7 +319,7 @@ filename ft15f001 temp; parmcards4; proc sql; insert into XXXXXXXXXXX.JOBDATA values( - "&orig_libds (%mf_nobs(work.staging_ds) obs) staged %trim( + "&orig_libds staged %trim( )by %mf_getUser() at %sysfunc(datetime(),datetime19.)","&pgmloc"); ;;;; filename f2 temp; diff --git a/sas/sasjs/services/editors/loadfile.sas b/sas/sasjs/services/editors/loadfile.sas index 27df4eb..eb0ba30 100644 --- a/sas/sasjs/services/editors/loadfile.sas +++ b/sas/sasjs/services/editors/loadfile.sas @@ -286,7 +286,17 @@ options mprint; ) filename outref "&dir/BKP_&xlsname"; + +data _null_; + if "&xlsref" ne "0" then do; + rc=fcopy("&xlsref","outref"); + end; +run; + +/** + * if running 9.3 or older, delete step above and enable macro below %mp_binarycopy(iftrue=("&xlsref" ne "0"),inref=&xlsref,outref=outref) + */ %mp_abort(iftrue= (&syscc ne 0) ,mac=&sysmacroname