mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 14:34:35 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09136cfdbb | ||
|
|
0ca16f3d04 | ||
|
|
1e72f13f2d |
6
all.sas
6
all.sas
@@ -10144,7 +10144,7 @@ run;
|
||||
prop='Connection.DBMS.Property.SERVER.Name.xmlKey.txt';
|
||||
rc=metadata_getprop(uri,prop,server,"");
|
||||
end;
|
||||
if server^='' then server='server='!!server;
|
||||
if server^='' then server='server='!!quote(cats(server));
|
||||
call symputx('server',server,'l');
|
||||
|
||||
/* get SCHEMA value */
|
||||
@@ -10290,11 +10290,11 @@ run;
|
||||
run;
|
||||
|
||||
%put NOTE: Executing the following:/; %put NOTE-;
|
||||
%put NOTE- libname &libref TERADATA server=&path schema=&schema ;
|
||||
%put NOTE- libname &libref TERADATA server="&path" schema=&schema ;
|
||||
%put NOTe- authdomain=&authdomain;
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref TERADATA server=&path schema=&schema authdomain=&authdomain;
|
||||
libname &libref TERADATA server="&path" schema=&schema authdomain=&authdomain;
|
||||
%end;
|
||||
%else %if &engine= %then %do;
|
||||
%put NOTE: Libref &libref is not registered in metadata;
|
||||
|
||||
@@ -62,13 +62,13 @@
|
||||
%put output location=&jref;
|
||||
%if &action=OPEN %then %do;
|
||||
options nobomfile;
|
||||
data _null_;file &jref encoding='utf-8';
|
||||
data _null_;file &jref encoding='utf-8' termstr=lf;
|
||||
put '{"PROCESSED_DTTM" : "' "%sysfunc(datetime(),E8601DT26.6)" '"';
|
||||
run;
|
||||
%end;
|
||||
%else %if (&action=ARR or &action=OBJ) %then %do;
|
||||
options validvarname=upcase;
|
||||
data _null_;file &jref mod encoding='utf-8';
|
||||
data _null_;file &jref mod encoding='utf-8' termstr=lf;
|
||||
put ", ""%lowcase(%sysfunc(coalescec(&dslabel,&ds)))"":";
|
||||
|
||||
%if &engine=PROCJSON %then %do;
|
||||
@@ -147,7 +147,7 @@
|
||||
run;
|
||||
%let ds=&fmtds;
|
||||
%end; /* &fmt=Y */
|
||||
data _null_;file &jref mod encoding='utf-8';
|
||||
data _null_;file &jref mod encoding='utf-8' termstr=lf;
|
||||
put "["; call symputx('cols',0,'l');
|
||||
proc sort
|
||||
data=sashelp.vcolumn(where=(libname='WORK' & memname="%upcase(&ds)"))
|
||||
@@ -192,7 +192,7 @@
|
||||
/* write to temp loc to avoid _webout truncation
|
||||
- https://support.sas.com/kb/49/325.html */
|
||||
filename _sjs temp lrecl=131068 encoding='utf-8';
|
||||
data _null_; file _sjs lrecl=131068 encoding='utf-8' mod;
|
||||
data _null_; file _sjs lrecl=131068 encoding='utf-8' mod termstr=lf;
|
||||
set &tempds;
|
||||
if _n_>1 then put "," @; put
|
||||
%if &action=ARR %then "[" ; %else "{" ;
|
||||
@@ -219,14 +219,14 @@
|
||||
rc = fclose(fileid);
|
||||
run;
|
||||
filename _sjs clear;
|
||||
data _null_; file &jref mod encoding='utf-8';
|
||||
data _null_; file &jref mod encoding='utf-8' termstr=lf;
|
||||
put "]";
|
||||
run;
|
||||
%end;
|
||||
%end;
|
||||
|
||||
%else %if &action=CLOSE %then %do;
|
||||
data _null_;file &jref encoding='utf-8' mod;
|
||||
data _null_;file &jref encoding='utf-8' mod termstr=lf;
|
||||
put "}";
|
||||
run;
|
||||
%end;
|
||||
|
||||
@@ -295,7 +295,7 @@ run;
|
||||
prop='Connection.DBMS.Property.SERVER.Name.xmlKey.txt';
|
||||
rc=metadata_getprop(uri,prop,server,"");
|
||||
end;
|
||||
if server^='' then server='server='!!server;
|
||||
if server^='' then server='server='!!quote(cats(server));
|
||||
call symputx('server',server,'l');
|
||||
|
||||
/* get SCHEMA value */
|
||||
@@ -441,11 +441,11 @@ run;
|
||||
run;
|
||||
|
||||
%put NOTE: Executing the following:/; %put NOTE-;
|
||||
%put NOTE- libname &libref TERADATA server=&path schema=&schema ;
|
||||
%put NOTE- libname &libref TERADATA server="&path" schema=&schema ;
|
||||
%put NOTe- authdomain=&authdomain;
|
||||
%put NOTE-;
|
||||
|
||||
libname &libref TERADATA server=&path schema=&schema authdomain=&authdomain;
|
||||
libname &libref TERADATA server="&path" schema=&schema authdomain=&authdomain;
|
||||
%end;
|
||||
%else %if &engine= %then %do;
|
||||
%put NOTE: Libref &libref is not registered in metadata;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
OPTIONS NOBOMFILE;
|
||||
|
||||
/* setup json */
|
||||
data _null_;file &fref encoding='utf-8';
|
||||
data _null_;file &fref encoding='utf-8' termstr=lf;
|
||||
%if %str(&_debug) ge 131 %then %do;
|
||||
put '>>weboutBEGIN<<';
|
||||
%end;
|
||||
@@ -108,14 +108,14 @@
|
||||
i+1;
|
||||
call symputx('wt'!!left(i),name,'l');
|
||||
call symputx('wtcnt',i,'l');
|
||||
data _null_; file &fref mod encoding='utf-8';
|
||||
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
||||
put ",""WORK"":{";
|
||||
%do i=1 %to &wtcnt;
|
||||
%let wt=&&wt&i;
|
||||
proc contents noprint data=&wt
|
||||
out=_data_ (keep=name type length format:);
|
||||
run;%let tempds=%scan(&syslast,2,.);
|
||||
data _null_; file &fref mod encoding='utf-8';
|
||||
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
||||
dsid=open("WORK.&wt",'is');
|
||||
nlobs=attrn(dsid,'NLOBS');
|
||||
nvars=attrn(dsid,'NVARS');
|
||||
@@ -126,15 +126,15 @@
|
||||
put ',"nvars":' nvars;
|
||||
%mp_jsonout(OBJ,&tempds,jref=&fref,dslabel=colattrs,engine=DATASTEP)
|
||||
%mp_jsonout(OBJ,&wt,jref=&fref,dslabel=first10rows,engine=DATASTEP)
|
||||
data _null_; file &fref mod encoding='utf-8';
|
||||
data _null_; file &fref mod encoding='utf-8' termstr=lf;
|
||||
put "}";
|
||||
%end;
|
||||
data _null_; file &fref mod encoding='utf-8';
|
||||
data _null_; file &fref mod encoding='utf-8' termstr=lf termstr=lf;
|
||||
put "}";
|
||||
run;
|
||||
%end;
|
||||
/* close off json */
|
||||
data _null_;file &fref mod encoding='utf-8';
|
||||
data _null_;file &fref mod encoding='utf-8' termstr=lf;
|
||||
_PROGRAM=quote(trim(resolve(symget('_PROGRAM'))));
|
||||
put ",""SYSUSERID"" : ""&sysuserid"" ";
|
||||
put ",""MF_GETUSER"" : ""%mf_getuser()"" ";
|
||||
@@ -147,7 +147,9 @@
|
||||
put ",""SYSHOSTNAME"" : ""&syshostname"" ";
|
||||
put ",""SYSPROCESSID"" : ""&SYSPROCESSID"" ";
|
||||
put ",""SYSPROCESSMODE"" : ""&SYSPROCESSMODE"" ";
|
||||
put ",""SYSPROCESSNAME"" : ""&SYSPROCESSNAME"" ";
|
||||
length SYSPROCESSNAME $512;
|
||||
SYSPROCESSNAME=quote(urlencode(cats(SYSPROCESSNAME)));
|
||||
put ",""SYSPROCESSNAME"" : " SYSPROCESSNAME;
|
||||
put ",""SYSJOBID"" : ""&sysjobid"" ";
|
||||
put ",""SYSSCPL"" : ""&sysscpl"" ";
|
||||
put ",""SYSSITE"" : ""&syssite"" ";
|
||||
@@ -156,7 +158,8 @@
|
||||
put ',"SYSVLONG" : ' sysvlong;
|
||||
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
||||
put ',"END_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '" ';
|
||||
autoexec=quote(trim(getoption('autoexec')));
|
||||
length autoexec $512;
|
||||
autoexec=quote(urlencode(trim(getoption('autoexec'))));
|
||||
put ',"AUTOEXEC" : ' autoexec;
|
||||
memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)";
|
||||
memsize=quote(cats(memsize));
|
||||
|
||||
Reference in New Issue
Block a user