@sasjs/core 4.18.10 → 4.18.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,7 @@
48
48
 
49
49
  @version 9.2
50
50
  @author Allan Bowe
51
+ @cond
51
52
  **/
52
53
 
53
54
  %macro mp_ds2cards(base_ds=, tgt_ds=
@@ -219,7 +220,8 @@ data _null_;
219
220
  put ' @file';
220
221
  put " @brief Datalines for %upcase(%scan(&base_ds,2)) dataset";
221
222
  put " @details Generated by %nrstr(%%)mp_ds2cards()";
222
- put " Available on github.com/sasjs/core";
223
+ put " Source: https://github.com/sasjs/core";
224
+ put ' @cond ';
223
225
  put '**/';
224
226
  put "data &tgt_ds &indexes;";
225
227
  put "attrib ";
@@ -264,6 +266,7 @@ data _null_;
264
266
  if __lastobs then do;
265
267
  put ';;;;';
266
268
  put 'run;';
269
+ put '/** @endcond **/';
267
270
  stop;
268
271
  end;
269
272
  run;
@@ -283,4 +286,5 @@ quit;
283
286
  %put NOTE-;%put NOTE-;
284
287
  %put NOTE- %sysfunc(dequote(&cards_file.));
285
288
  %put NOTE-;%put NOTE-;
286
- %mend mp_ds2cards;
289
+ %mend mp_ds2cards;
290
+ /** @endcond **/
package/base/mp_getpk.sas CHANGED
@@ -55,7 +55,8 @@
55
55
  )/*/STORE SOURCE*/;
56
56
 
57
57
 
58
- %local engine schema ds1 ds2 ds3 dsn tabs1 tabs2 sum pk4sure pkdefault finalpks;
58
+ %local engine schema ds1 ds2 ds3 dsn tabs1 tabs2 sum pk4sure pkdefault finalpks
59
+ pkfromindex;
59
60
 
60
61
  %let lib=%upcase(&lib);
61
62
  %let ds=%upcase(&ds);
@@ -70,6 +71,7 @@
70
71
  %let sum=%mf_getuniquename(prefix=getpk_sum);
71
72
  %let pk4sure=%mf_getuniquename(prefix=getpk_pk4sure);
72
73
  %let pkdefault=%mf_getuniquename(prefix=getpk_pkdefault);
74
+ %let pkfromindex=%mf_getuniquename(prefix=getpk_pkfromindex);
73
75
  %let finalpks=%mf_getuniquename(prefix=getpk_finalpks);
74
76
 
75
77
  %local dbg;
@@ -180,9 +182,23 @@ create table &ds1 as
180
182
  and a.constraint_name=b.constraint_name
181
183
  order by 1,2,3,4;
182
184
 
185
+ /* extract cols from the relevant unique INDEXES */
186
+ create table &pkfromindex as
187
+ select libname as libref
188
+ ,memname as table_name
189
+ ,indxname as constraint_name
190
+ ,indxpos as constraint_order
191
+ ,name
192
+ from dictionary.indexes
193
+ where nomiss='yes' and unique='yes' and upcase(libname)="&lib"
194
+ %if &ds ne 0 %then %do;
195
+ and upcase(memname)="&ds"
196
+ %end;
197
+ order by 1,2,3,4;
198
+
183
199
  /* create one table */
184
200
  data &finalpks;
185
- set &pkdefault &pk4sure ;
201
+ set &pkdefault &pk4sure &pkfromindex;
186
202
  pk_ind=1;
187
203
  /* if there are multiple unique constraints, take the first */
188
204
  by libref table_name constraint_name;
@@ -256,4 +272,4 @@ create table &outds as
256
272
  iftrue=(&mdebug=0)
257
273
  )
258
274
 
259
- %mend mp_getpk;
275
+ %mend mp_getpk;
@@ -105,12 +105,20 @@ run;
105
105
  %end;
106
106
  %end;
107
107
  %else %if &contentype=HTML %then %do;
108
- %if &platform=SASVIYA %then %do;
108
+ %if (&platform=SASMETA and &streamweb=1) %then %do;
109
+ data _null_;
110
+ rc=stpsrv_header('Content-type','text/html');
111
+ rc=stpsrv_header('Content-disposition',"attachment; filename=&outname");
112
+ run;
113
+ %end;
114
+ %else %if &platform=SASVIYA %then %do;
109
115
  filename &outref filesrvc parenturi="&SYS_JES_JOB_URI" name="_webout.json"
110
- contenttype="text/html";
116
+ contenttype="text/html"
117
+ contentdisp="attachment; filename=&outname";
111
118
  %end;
112
119
  %else %if &platform=SASJS %then %do;
113
120
  %mfs_httpheader(Content-type,text/html)
121
+ %mfs_httpheader(Content-disposition,%str(attachment; filename=&outname))
114
122
  %end;
115
123
  %end;
116
124
  %else %if &contentype=TEXT %then %do;
package/package.json CHANGED
@@ -36,5 +36,5 @@
36
36
  "@sasjs/cli": "3.6.0",
37
37
  "@sasjs/core": "4.4.7"
38
38
  },
39
- "version": "4.18.10"
39
+ "version": "4.18.13"
40
40
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  @file
3
- @brief Send data to/from @sasjs/server
3
+ @brief Send data to/from sasjs/server
4
4
  @details This macro should be added to the start of each web service,
5
5
  **immediately** followed by a call to:
6
6