Get a collection of job definitions

get/definitions
Internal-Use Only

Returns a list of job definitions.

Request Samples

1

Response Samples

1{
2 "links": [
3 {
4 "method": "GET",
5 "rel": "collection",
6 "href": "/jobDefinitions/definitions",
7 "uri": "/jobDefinitions/definitions",
8 "type": "application/vnd.sas.collection"
9 },
10 {
11 "method": "GET",
12 "rel": "self",
13 "href": "/jobDefinitions/definitions?start=0&limit=10",
14 "uri": "/jobDefinitions/definitions?start=0&limit=10",
15 "type": "application/vnd.sas.collection"
16 },
17 {
18 "method": "GET",
19 "rel": "next",
20 "href": "/jobDefinitions/definitions?start=10&limit=10",
21 "uri": "/jobDefinitions/definitions?start=10&limit=10",
22 "type": "application/vnd.sas.collection"
23 },
24 {
25 "method": "POST",
26 "rel": "createJobDefinition",
27 "href": "/jobDefinitions/definitions",
28 "uri": "/jobDefinitions/definitions",
29 "type": "application/vnd.sas.job.definition",
30 "responseType": "application/vnd.sas.job.definition"
31 }
32 ],
33 "name": "jobdefinitions",
34 "accept": "application/vnd.sas.job.definition",
35 "start": 0,
36 "items": [
37 {
38 "creationTimeStamp": "2021-11-08T19:25:29.590Z",
39 "modifiedTimeStamp": "2021-11-08T19:25:29.658Z",
40 "createdBy": "sas.modelRepository",
41 "modifiedBy": "sas.modelRepository",
42 "version": 2,
43 "id": "c2283c0e-c69c-48cb-b314-84207afe7cb0",
44 "name": "Default Model Manager Scoring Job Definition",
45 "type": "Compute",
46 "parameters": [
47 {
48 "version": 1,
49 "name": "_contextName",
50 "defaultValue": "SAS Model Manager compute context",
51 "type": "CHARACTER",
52 "label": "Context Name",
53 "required": false
54 },
55 {
56 "version": 1,
57 "name": "_omitJsonLog",
58 "defaultValue": "true",
59 "type": "BOOLEAN",
60 "required": false
61 }
62 ],
63 "code": "{mappedCode}",
64 "links": [
65 {
66 "method": "GET",
67 "rel": "self",
68 "href": "/jobDefinitions/definitions/c2283c0e-c69c-48cb-b314-84207afe7cb0",
69 "uri": "/jobDefinitions/definitions/c2283c0e-c69c-48cb-b314-84207afe7cb0",
70 "type": "application/vnd.sas.job.definition"
71 },
72 {
73 "method": "GET",
74 "rel": "alternate",
75 "href": "/jobDefinitions/definitions/c2283c0e-c69c-48cb-b314-84207afe7cb0",
76 "uri": "/jobDefinitions/definitions/c2283c0e-c69c-48cb-b314-84207afe7cb0",
77 "type": "application/vnd.sas.summary"
78 }
79 ],
80 "properties": [
81 {
82 "name": "type",
83 "value": "scoring"
84 },
85 {
86 "name": "objecttype",
87 "value": "sas.models.model"
88 }
89 ]
90 },
91 {
92 "creationTimeStamp": "2021-11-08T19:25:35.973Z",
93 "modifiedTimeStamp": "2021-11-08T19:25:35.976Z",
94 "createdBy": "sas.analyticsFlows",
95 "modifiedBy": "sas.analyticsFlows",
96 "version": 2,
97 "id": "801d5009-3b33-41c1-b7e4-b33f77248ede",
98 "name": "Analytics Flow Job Definition",
99 "type": "AnalyticsFlow",
100 "parameters": [
101 {
102 "version": 1,
103 "name": "flowId",
104 "type": "CHARACTER",
105 "label": "Flow ID",
106 "required": true
107 },
108 {
109 "version": 1,
110 "name": "toNodeUri",
111 "type": "CHARACTER",
112 "label": "ID of final node to run",
113 "required": false
114 },
115 {
116 "version": 1,
117 "name": "casServerId",
118 "defaultValue": "cas",
119 "type": "CHARACTER",
120 "label": "ID of CAS Server to use for Component execution",
121 "required": false
122 },
123 {
124 "version": 1,
125 "name": "casSessionName",
126 "defaultValue": "AdvancedAnalyticSession",
127 "type": "CHARACTER",
128 "label": "Name of CAS Session to use for Component execution",
129 "required": false
130 },
131 {
132 "version": 1,
133 "name": "contextName",
134 "type": "CHARACTER",
135 "label": "Name of Compute Context to use for Component execution",
136 "required": false
137 }
138 ],
139 "code": "",
140 "links": [
141 {
142 "method": "GET",
143 "rel": "self",
144 "href": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
145 "uri": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
146 "type": "application/vnd.sas.job.definition"
147 },
148 {
149 "method": "GET",
150 "rel": "alternate",
151 "href": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
152 "uri": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
153 "type": "application/vnd.sas.summary"
154 }
155 ],
156 "properties": []
157 },
158 {
159 "creationTimeStamp": "2021-11-08T19:25:41.775Z",
160 "modifiedTimeStamp": "2021-11-08T19:25:41.776Z",
161 "createdBy": "sas.audit",
162 "modifiedBy": "sas.audit",
163 "version": 2,
164 "id": "7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
165 "name": "CAS Audit table update",
166 "description": "After upload of new Audit data into a temporary CAS table, this job appends the new data to the existing Audit data",
167 "type": "casl",
168 "parameters": [
169 {
170 "version": 1,
171 "name": "%VAR-expireDate",
172 "type": "CHARACTER",
173 "required": true
174 },
175 {
176 "version": 1,
177 "name": "%VAR-tempTableName",
178 "type": "CHARACTER",
179 "required": true
180 },
181 {
182 "version": 1,
183 "name": "%VAR-targetCaslib",
184 "type": "CHARACTER",
185 "required": true
186 },
187 {
188 "version": 1,
189 "name": "serverId",
190 "defaultValue": "cas-shared-default",
191 "type": "CHARACTER",
192 "required": false
193 }
194 ],
195 "code": "whereStr=cat(\"'Time Stamp'n <= '\", expireDate, \"'\");\ndeleteRows / table={name='AUDIT' caslib=targetCaslib, where=whereStr};\nrun;\ncodeStr=cat(\"data AUDIT(caslib=\", targetCaslib, \" append=yes);set \", tempTableName, \"(caslib=\", targetCaslib, \");run;\");\ndatastep.runCode / code=codeStr;\nrun;\ntable.save status=sc / name='AUDIT' caslib=targetCaslib replace=true table={ name='AUDIT' caslib=targetCaslib };\nrun;\ntable.dropTable name='AUDIT' caslib=targetCaslib;\nrun;\ntable.dropTable name=tempTableName caslib=targetCaslib;\nrun;",
196 "links": [
197 {
198 "method": "GET",
199 "rel": "self",
200 "href": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
201 "uri": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
202 "type": "application/vnd.sas.job.definition"
203 },
204 {
205 "method": "GET",
206 "rel": "alternate",
207 "href": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
208 "uri": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
209 "type": "application/vnd.sas.summary"
210 }
211 ],
212 "properties": []
213 },
214 {
215 "creationTimeStamp": "2021-11-08T19:27:14.440Z",
216 "modifiedTimeStamp": "2021-11-08T19:27:14.442Z",
217 "createdBy": "sas.SASDataExplorer",
218 "modifiedBy": "sas.SASDataExplorer",
219 "version": 2,
220 "id": "3ec9e0c3-6ef8-42d0-b233-807005322050",
221 "name": "Copy CasTable",
222 "type": "casl",
223 "parameters": [
224 {
225 "version": 1,
226 "name": "sessionId",
227 "type": "CHARACTER",
228 "label": "CAS Session Id",
229 "required": false
230 },
231 {
232 "version": 1,
233 "name": "serverId",
234 "type": "CHARACTER",
235 "label": "CAS Server Id",
236 "required": true
237 },
238 {
239 "version": 1,
240 "name": "%VAR-sourceCasLib",
241 "type": "CHARACTER",
242 "label": "Source CAS Library",
243 "required": true
244 },
245 {
246 "version": 1,
247 "name": "%VAR-destinationCasLib",
248 "type": "CHARACTER",
249 "label": "Destination CAS Library",
250 "required": true
251 },
252 {
253 "version": 1,
254 "name": "%VAR-sourceTable",
255 "type": "CHARACTER",
256 "label": "Source Table Name",
257 "required": true
258 },
259 {
260 "version": 1,
261 "name": "%VAR-destinationTable",
262 "type": "CHARACTER",
263 "label": "Destination Table Name",
264 "required": true
265 },
266 {
267 "version": 1,
268 "name": "%VAR-destinationTableLabel",
269 "defaultValue": "",
270 "type": "CHARACTER",
271 "label": "Destination Table Label",
272 "required": false
273 },
274 {
275 "version": 1,
276 "name": "%VAR-replace",
277 "defaultValue": "1",
278 "type": "NUMERIC",
279 "label": "Replace destination table flag (true = replace)",
280 "required": true
281 },
282 {
283 "version": 1,
284 "name": "%VAR-promote",
285 "defaultValue": "1",
286 "type": "NUMERIC",
287 "label": "Scope in which to load table (true = global and false = session)",
288 "required": true
289 },
290 {
291 "version": 1,
292 "name": "%VAR-replication",
293 "defaultValue": "1",
294 "type": "NUMERIC",
295 "label": "Specifies the number of copies of the table to make for fault tolerance.",
296 "required": true
297 },
298 {
299 "version": 1,
300 "name": "%VAR-data_explorer_submission_id",
301 "type": "CHARACTER",
302 "label": "Unique identifier by which UI tracks this job",
303 "required": false
304 }
305 ],
306 "code": "session server;\n \n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(replace, destinationCasLib, destinationTable);\n \n/* Save CAS table to DESTINATION caslib backing store */\nsave status=rc result=r / caslib=destinationCasLib name=destinationTable\n table={caslib=sourceCasLib name=sourceTable} replace=replace;\ncheckStatus(rc, \"Error saving table\", 3);\n\n/* pull the path of the source that was saved - to be used in load below */\ndestinationPath=dictionary(r, \"name\");\n\n/* Unload session table from memory in destination caslib */\ndropTableIfExists(destinationCasLib, destinationTable);\n \n/* Unload global table if exists */\ndropTableIfExists(destinationCasLib, destinationTable);\n\n/* Load table into memory in destination caslib */\nloadTable status=rc result=r / caslib=destinationCasLib path=destinationPath\n casOut={caslib=destinationCasLib name=destinationTable label=destinationTableLabel}\n promote=promote;\ncheckStatus(rc, \"Error promoting table\", 4);\n \nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n \nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n \nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction checkReplace(replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists !=0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n exit 1;\n end;\n end;\nend func;\n\n",
307 "links": [
308 {
309 "method": "GET",
310 "rel": "self",
311 "href": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
312 "uri": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
313 "type": "application/vnd.sas.job.definition"
314 },
315 {
316 "method": "GET",
317 "rel": "alternate",
318 "href": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
319 "uri": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
320 "type": "application/vnd.sas.summary"
321 }
322 ],
323 "properties": [
324 {
325 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
326 "value": "true"
327 }
328 ]
329 },
330 {
331 "creationTimeStamp": "2021-11-08T19:25:46.589Z",
332 "modifiedTimeStamp": "2021-11-08T19:26:08.473Z",
333 "createdBy": "sas.analyticsPipelines",
334 "modifiedBy": "sas.analyticsFlows",
335 "version": 2,
336 "id": "aac6228d-bb53-41cd-be3f-857cf0e9c692",
337 "name": "Copy CasTable (v2)",
338 "type": "casl",
339 "parameters": [
340 {
341 "version": 1,
342 "name": "sessionId",
343 "type": "CHARACTER",
344 "label": "CAS Session Id",
345 "required": false
346 },
347 {
348 "version": 1,
349 "name": "serverId",
350 "type": "CHARACTER",
351 "label": "CAS Server Id",
352 "required": true
353 },
354 {
355 "version": 1,
356 "name": "%VAR-sourceCasLib",
357 "type": "CHARACTER",
358 "label": "Source CAS Library",
359 "required": true
360 },
361 {
362 "version": 1,
363 "name": "%VAR-destinationCasLib",
364 "type": "CHARACTER",
365 "label": "Destination CAS Library",
366 "required": true
367 },
368 {
369 "version": 1,
370 "name": "%VAR-sourceTable",
371 "type": "CHARACTER",
372 "label": "Source Table Name",
373 "required": true
374 },
375 {
376 "version": 1,
377 "name": "%VAR-destinationTable",
378 "type": "CHARACTER",
379 "label": "Destination Table Name",
380 "required": true
381 },
382 {
383 "version": 1,
384 "name": "%VAR-destinationTableLabel",
385 "defaultValue": "",
386 "type": "CHARACTER",
387 "label": "Destination Table Label",
388 "required": false
389 },
390 {
391 "version": 1,
392 "name": "%VAR-replace",
393 "defaultValue": "1",
394 "type": "NUMERIC",
395 "label": "Replace destination table flag (true = replace)",
396 "required": true
397 },
398 {
399 "version": 1,
400 "name": "%VAR-saveType",
401 "defaultValue": "sashdat",
402 "type": "CHARACTER",
403 "label": "The type of file to save to (file extension)",
404 "required": false
405 },
406 {
407 "version": 1,
408 "name": "%VAR-promote",
409 "defaultValue": "1",
410 "type": "NUMERIC",
411 "label": "Scope in which to load table (true = global and false = session)",
412 "required": true
413 },
414 {
415 "version": 1,
416 "name": "%VAR-replication",
417 "defaultValue": "1",
418 "type": "NUMERIC",
419 "label": "Specifies the number of copies of the table to make for fault tolerance.",
420 "required": true
421 },
422 {
423 "version": 1,
424 "name": "%VAR-data_explorer_submission_id",
425 "type": "CHARACTER",
426 "label": "Unique identifier by which UI tracks this job",
427 "required": false
428 }
429 ],
430 "code": "session server;\n\n/* Taken from https://gitlab.sas.com/dmv-gerrit/data-explorer-ui/-/blob/branch/src/main/resources/definitions/JobDefinition_CopyTable-v2.casl */\n \n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(replace, destinationCasLib, destinationTable);\n\n/* Save CAS table to DESTINATION caslib backing store */\n/* Save will automatically save as type represented by file ext */\nsaveName=destinationTable;\nif(saveType != \"\") then do;\n saveName=destinationTable || \".\" || saveType;\nend;\nsave status=rc result=r / caslib=destinationCasLib name=saveName\n table={caslib=sourceCasLib name=sourceTable} replace=replace viewAsTable=TRUE;\ncheckStatus(rc, \"Error saving table\", 3);\n\n/* pull the path of the source that was saved - to be used in load below */\ndestinationPath=dictionary(r, \"name\");\n\n/* Unload session table from memory in destination caslib */\ndropTableIfExists(destinationCasLib, destinationTable);\n\n/* Unload global table if exists */\ndropTableIfExists(destinationCasLib, destinationTable);\n\n/* Load table into memory in destination caslib */\nloadTable status=rc result=r / caslib=destinationCasLib path=destinationPath\n casOut={caslib=destinationCasLib name=destinationTable label=destinationTableLabel}\n promote=promote;\ncheckStatus(rc, \"Error promoting table\", 4);\n \nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n \nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n \nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction checkReplace(replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists !=0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n exit 1;\n end;\n end;\nend func;\n\n",
431 "links": [
432 {
433 "method": "GET",
434 "rel": "self",
435 "href": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
436 "uri": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
437 "type": "application/vnd.sas.job.definition"
438 },
439 {
440 "method": "GET",
441 "rel": "alternate",
442 "href": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
443 "uri": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
444 "type": "application/vnd.sas.summary"
445 }
446 ],
447 "properties": [
448 {
449 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
450 "value": "true"
451 }
452 ]
453 },
454 {
455 "creationTimeStamp": "2021-11-08T19:27:16.626Z",
456 "modifiedTimeStamp": "2021-11-08T19:27:16.629Z",
457 "createdBy": "sas.SASDataExplorer",
458 "modifiedBy": "sas.SASDataExplorer",
459 "version": 2,
460 "id": "faf6228d-bb53-41cd-be3f-857cf0e9c692",
461 "name": "Copy CasTable (v2)",
462 "type": "casl",
463 "parameters": [
464 {
465 "version": 1,
466 "name": "sessionId",
467 "type": "CHARACTER",
468 "label": "CAS Session Id",
469 "required": false
470 },
471 {
472 "version": 1,
473 "name": "serverId",
474 "type": "CHARACTER",
475 "label": "CAS Server Id",
476 "required": true
477 },
478 {
479 "version": 1,
480 "name": "%VAR-sourceCasLib",
481 "type": "CHARACTER",
482 "label": "Source CAS Library",
483 "required": true
484 },
485 {
486 "version": 1,
487 "name": "%VAR-destinationCasLib",
488 "type": "CHARACTER",
489 "label": "Destination CAS Library",
490 "required": true
491 },
492 {
493 "version": 1,
494 "name": "%VAR-sourceTable",
495 "type": "CHARACTER",
496 "label": "Source Table Name",
497 "required": true
498 },
499 {
500 "version": 1,
501 "name": "%VAR-destinationTable",
502 "type": "CHARACTER",
503 "label": "Destination Table Name",
504 "required": true
505 },
506 {
507 "version": 1,
508 "name": "%VAR-destinationTableLabel",
509 "defaultValue": "",
510 "type": "CHARACTER",
511 "label": "Destination Table Label",
512 "required": false
513 },
514 {
515 "version": 1,
516 "name": "%VAR-replace",
517 "defaultValue": "1",
518 "type": "NUMERIC",
519 "label": "Replace destination table flag (true = replace)",
520 "required": true
521 },
522 {
523 "version": 1,
524 "name": "%VAR-saveType",
525 "defaultValue": "",
526 "type": "CHARACTER",
527 "label": "The type of file to save to (file extension)",
528 "required": true
529 },
530 {
531 "version": 1,
532 "name": "%VAR-promote",
533 "defaultValue": "1",
534 "type": "NUMERIC",
535 "label": "Scope in which to load table (true = global and false = session)",
536 "required": true
537 },
538 {
539 "version": 1,
540 "name": "%VAR-replication",
541 "defaultValue": "1",
542 "type": "NUMERIC",
543 "label": "Specifies the number of copies of the table to make for fault tolerance.",
544 "required": true
545 },
546 {
547 "version": 1,
548 "name": "%VAR-data_explorer_submission_id",
549 "type": "CHARACTER",
550 "label": "Unique identifier by which UI tracks this job",
551 "required": false
552 }
553 ],
554 "code": "session server;\n \n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(replace, destinationCasLib, destinationTable);\n\n/* Save CAS table to DESTINATION caslib backing store */\n/* Save will automatically save as type represented by file ext */\nsaveName=destinationTable;\nif(saveType != \"\") then do;\n saveName=destinationTable || \".\" || saveType;\nend;\nsave status=rc result=r / caslib=destinationCasLib name=saveName\n table={caslib=sourceCasLib name=sourceTable} replace=replace;\ncheckStatus(rc, \"Error saving table\", 3);\n\n/* pull the path of the source that was saved - to be used in load below */\ndestinationPath=dictionary(r, \"name\");\n\n/* Unload session table from memory in destination caslib */\ndropTableIfExists(destinationCasLib, destinationTable);\n\n/* Unload global table if exists */\ndropTableIfExists(destinationCasLib, destinationTable);\n\n/* Load table into memory in destination caslib */\nloadTable status=rc result=r / caslib=destinationCasLib path=destinationPath\n casOut={caslib=destinationCasLib name=destinationTable label=destinationTableLabel}\n promote=promote;\ncheckStatus(rc, \"Error promoting table\", 4);\n \nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n \nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n \nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction checkReplace(replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists !=0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n exit 1;\n end;\n end;\nend func;\n\n",
555 "links": [
556 {
557 "method": "GET",
558 "rel": "self",
559 "href": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
560 "uri": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
561 "type": "application/vnd.sas.job.definition"
562 },
563 {
564 "method": "GET",
565 "rel": "alternate",
566 "href": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
567 "uri": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
568 "type": "application/vnd.sas.summary"
569 }
570 ],
571 "properties": [
572 {
573 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
574 "value": "true"
575 }
576 ]
577 },
578 {
579 "creationTimeStamp": "2021-11-08T19:27:24.858Z",
580 "modifiedTimeStamp": "2021-11-08T19:27:24.860Z",
581 "createdBy": "sas.SASDataExplorer",
582 "modifiedBy": "sas.SASDataExplorer",
583 "version": 2,
584 "id": "97639c7d-b715-48da-ac9f-c1aa42cce1f1",
585 "name": "Import Table - Images",
586 "type": "casl",
587 "parameters": [
588 {
589 "version": 1,
590 "name": "sessionId",
591 "type": "CHARACTER",
592 "label": "CAS Session Id (optional)",
593 "required": false
594 },
595 {
596 "version": 1,
597 "name": "serverId",
598 "type": "CHARACTER",
599 "label": "CAS Server Id",
600 "required": true
601 },
602 {
603 "version": 1,
604 "name": "%VAR-sourceCasLib",
605 "type": "CHARACTER",
606 "label": "CAS Library",
607 "required": true
608 },
609 {
610 "version": 1,
611 "name": "%VAR-destinationCasLib",
612 "type": "CHARACTER",
613 "label": "CAS Library",
614 "required": true
615 },
616 {
617 "version": 1,
618 "name": "%VAR-destinationTable",
619 "type": "CHARACTER",
620 "label": "Table name",
621 "required": true
622 },
623 {
624 "version": 1,
625 "name": "%VAR-replace",
626 "defaultValue": "1",
627 "type": "NUMERIC",
628 "label": "Replace table flag (true = replace)",
629 "required": true
630 },
631 {
632 "version": 1,
633 "name": "%VAR-promote",
634 "defaultValue": "1",
635 "type": "NUMERIC",
636 "label": "Scope in which to load table (1 = global and 0 = session)",
637 "required": true
638 },
639 {
640 "version": 1,
641 "name": "%VAR-replication",
642 "defaultValue": "1",
643 "type": "NUMERIC",
644 "label": "Specifies the number of copies of the table to make for fault tolerance.",
645 "required": true
646 },
647 {
648 "version": 1,
649 "name": "%VAR-persist",
650 "defaultValue": "1",
651 "type": "NUMERIC",
652 "label": "Persist destination table flag (true = save table to destination caslib backing store)",
653 "required": true
654 },
655 {
656 "version": 1,
657 "name": "%VAR-destinationTableLabel",
658 "defaultValue": "",
659 "type": "CHARACTER",
660 "label": "Destination Table Label",
661 "required": false
662 },
663 {
664 "version": 1,
665 "name": "%VAR-sourceTableSourceName",
666 "defaultValue": "",
667 "type": "CHARACTER",
668 "label": "Path of image(s) to load, leave blank to load all images",
669 "required": true
670 },
671 {
672 "version": 1,
673 "name": "%VAR-recurse",
674 "defaultValue": "0",
675 "type": "NUMERIC",
676 "label": "Flag to recurse subdirectories",
677 "required": true
678 },
679 {
680 "version": 1,
681 "name": "%VAR-decode",
682 "defaultValue": "0",
683 "type": "NUMERIC",
684 "label": "Flag to decompress image and add metadata",
685 "required": true
686 },
687 {
688 "version": 1,
689 "name": "%VAR-series",
690 "defaultValue": "0",
691 "type": "NUMERIC",
692 "label": "Flag to set if images are a series",
693 "required": true
694 },
695 {
696 "version": 1,
697 "name": "%VAR-dicom",
698 "defaultValue": "0",
699 "type": "NUMERIC",
700 "label": "Flag to set dicom option",
701 "required": true
702 },
703 {
704 "version": 1,
705 "name": "%VAR-reverse",
706 "defaultValue": "0",
707 "type": "NUMERIC",
708 "label": "Flag to set reverse option",
709 "required": true
710 },
711 {
712 "version": 1,
713 "name": "%VAR-pathIsList",
714 "defaultValue": "0",
715 "type": "NUMERIC",
716 "label": "Flag to set pathIsList option",
717 "required": true
718 },
719 {
720 "version": 1,
721 "name": "%VAR-labelLevels",
722 "defaultValue": "0",
723 "type": "NUMERIC",
724 "label": "Specifies the maximum number of directory levels to include in the label",
725 "required": true
726 },
727 {
728 "version": 1,
729 "name": "%VAR-saveType",
730 "defaultValue": "",
731 "type": "CHARACTER",
732 "label": "The type of file to save to (file extension)",
733 "required": true
734 },
735 {
736 "version": 1,
737 "name": "%VAR-addColumns",
738 "defaultValue": "{}",
739 "type": "TABLE",
740 "label": "Specifies the metadata columns to add to the image",
741 "required": true
742 },
743 {
744 "version": 1,
745 "name": "%VAR-advancedOptionsTable",
746 "defaultValue": "{}",
747 "type": "TABLE",
748 "label": "Load image advanced import options",
749 "required": false
750 },
751 {
752 "version": 1,
753 "name": "%VAR-data_explorer_submission_id",
754 "type": "CHARACTER",
755 "label": "Unique identifier by which UI tracks this job",
756 "required": false
757 }
758 ],
759 "code": "session server;\nloadactionset \"image\";\n\nloadParms={ caslib=sourceCasLib\n path=sourceTableSourceName\n decode=decode\n labelLevels=labelLevels\n pathIsList=pathIsList\n recurse=recurse\n casOut={ caslib=destinationCasLib\n name=destinationTable\n label=destinationTableLabel\n promote=false }\n};\n\nif (series = 1) then\n loadParms[\"series\"] = {\n dicom=dicom,\n reverse=reverse\n };\n\n/* Add columns if we have them */\nhasColumns=isNonEmptyList(addColumns);\nif (decode = 1 and hasColumns == true) then\n /* If decode = 1, the user can add metadata columns */\n loadParms[\"addColumns\"] = addColumns;\n\n/* Adds advanced option key/values to loadParameters */\n/* This allows advanced options to specify extra parameters or overwrite existing ones */\ndo k, v over advancedOptionsTable;\n loadParms[k] = v;\nend;\n\n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(replace, destinationCaslib, destinationTable);\n\n/* If not persisting, take promote status from job argument (false for initial load otherwise) */\nif(persist == false) then do;\n loadParms[\"casOut\"][\"promote\"] = promote;\n /* Unload session table from memory in destination caslib */\n dropTableIfExists(destinationCasLib, destinationTable);\n /* Unload global table from memory */\n dropTableIfExists(destinationCasLib, destinationTable);\nend;\nprint loadParms;\nimage.loadImages status=rc result=r / loadParms;\n\ncheckStatus(rc, \"Error loading images\", 4);\n\n/* If persisting, do save and then loadTable */\nif(persist == true) then do;\n /* Save CAS table to DESTINATION caslib backing store */\n /* Save will automatically save as type represented by file ext */\n saveName=destinationTable;\n if(saveType != \"\") then do;\n saveName=destinationTable || \".\" || saveType;\n end;\n save status=rc result=r / caslib=destinationCasLib\n name=saveName\n table={ caslib=destinationCasLib\n name=destinationTable }\n replace=replace;\n checkStatus(rc, \"Error saving images table\", 3);\n loadPath=dictionary(r, \"name\");\n loadCasLib=destinationCasLib;\n\n /* We should be ok dropping twice here, since we have already checked the replace flag above */\n\n /* Unload session table from memory in destination caslib */\n dropTableIfExists(destinationCasLib, destinationTable);\n /* Unload global table from memory */\n dropTableIfExists(destinationCasLib, destinationTable);\n\n /* Set up the parameters for the loadTable action below based on saved location above along with label and replication args*/\n loadParms={ caslib=loadCasLib\n path=loadPath\n casOut={ caslib=destinationCasLib\n name=destinationTable\n label=destinationTableLabel\n replication=replication }\n promote=promote };\n print loadParms;\n loadTable status=rc result=r / loadParms;\n checkStatus(rc, \"Error loading final table\", 4);\nend;\n\nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n\nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n\nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction checkReplace(replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists !=0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n exit 1;\n end;\n end;\nend func;\n\nfunction isNonEmptyList(listArg);\n if isList(listArg) then do;\n nElements = dim(listArg);\n end;\n else do;\n nElements = 0;\n end;\n if nElements > 0 then do;\n return true;\n end;\n return false;\nend;",
760 "links": [
761 {
762 "method": "GET",
763 "rel": "self",
764 "href": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
765 "uri": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
766 "type": "application/vnd.sas.job.definition"
767 },
768 {
769 "method": "GET",
770 "rel": "alternate",
771 "href": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
772 "uri": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
773 "type": "application/vnd.sas.summary"
774 }
775 ],
776 "properties": [
777 {
778 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
779 "value": "true"
780 }
781 ]
782 },
783 {
784 "creationTimeStamp": "2021-11-08T19:27:27.084Z",
785 "modifiedTimeStamp": "2021-11-08T19:27:27.086Z",
786 "createdBy": "sas.SASDataExplorer",
787 "modifiedBy": "sas.SASDataExplorer",
788 "version": 2,
789 "id": "afbed716-533f-48ec-a17b-44cc62735eb7",
790 "name": "Load Table",
791 "type": "casl",
792 "parameters": [
793 {
794 "version": 1,
795 "name": "sessionId",
796 "type": "CHARACTER",
797 "label": "CAS Session Id (optional)",
798 "required": false
799 },
800 {
801 "version": 1,
802 "name": "serverId",
803 "type": "CHARACTER",
804 "label": "CAS Server Id",
805 "required": true
806 },
807 {
808 "version": 1,
809 "name": "%VAR-sourceCasLib",
810 "type": "CHARACTER",
811 "label": "CAS Library",
812 "required": true
813 },
814 {
815 "version": 1,
816 "name": "%VAR-sourceTable",
817 "type": "CHARACTER",
818 "label": "Table name",
819 "required": true
820 },
821 {
822 "version": 1,
823 "name": "%VAR-sourceTableSourceName",
824 "type": "CHARACTER",
825 "label": "Source Table Source Name",
826 "required": true
827 },
828 {
829 "version": 1,
830 "name": "%VAR-replace",
831 "defaultValue": "1",
832 "type": "NUMERIC",
833 "label": "Replace table flag (true = replace)",
834 "required": true
835 },
836 {
837 "version": 1,
838 "name": "%VAR-promote",
839 "defaultValue": "1",
840 "type": "NUMERIC",
841 "label": "Scope in which to load table (1 = global and 0 = session)",
842 "required": true
843 },
844 {
845 "version": 1,
846 "name": "%VAR-data_explorer_submission_id",
847 "type": "CHARACTER",
848 "label": "Unique identifier by which UI tracks this job",
849 "required": false
850 }
851 ],
852 "code": "session server;\n\n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(replace, sourceCasLib, sourceTable);\n\n/* IF doing a Replace, unload table from memory in caslib - drop 1 (two drops in case both session and global exist) */\ndropTableIfExists(sourceCasLib, sourceTable);\n\n/* IF doing a Replace, unload table from memory in caslib - drop 2 */\ndropTableIfExists(sourceCasLib, sourceTable);\n\n/* IF promote set: Load table into memory in caslib as global table */\nloadTable status=rc result=r / caslib=sourceCasLib path=sourceTableSourceName\n casOut={caslib=sourceCasLib name=sourceTable} promote=promote;\ncheckStatus(rc, \"Error promoting table\", 4);\n\nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n\nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n\nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction checkReplace(replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists !=0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n exit 1;\n end;\n end;\nend func;\n",
853 "links": [
854 {
855 "method": "GET",
856 "rel": "self",
857 "href": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
858 "uri": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
859 "type": "application/vnd.sas.job.definition"
860 },
861 {
862 "method": "GET",
863 "rel": "alternate",
864 "href": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
865 "uri": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
866 "type": "application/vnd.sas.summary"
867 }
868 ],
869 "properties": [
870 {
871 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
872 "value": "true"
873 }
874 ]
875 },
876 {
877 "creationTimeStamp": "2021-11-08T19:29:15.330Z",
878 "modifiedTimeStamp": "2021-11-08T19:29:15.331Z",
879 "createdBy": "sas.SASDataExplorer",
880 "modifiedBy": "sas.SASDataExplorer",
881 "version": 2,
882 "id": "e8969cab-f037-43b4-aab3-abb206f7bdf8",
883 "name": "Import Table - Google Drive (v2)",
884 "type": "casl",
885 "parameters": [
886 {
887 "version": 1,
888 "name": "sessionId",
889 "type": "CHARACTER",
890 "label": "CAS Session Id",
891 "required": false
892 },
893 {
894 "version": 1,
895 "name": "serverId",
896 "type": "CHARACTER",
897 "label": "CAS Server Id",
898 "required": true
899 },
900 {
901 "version": 1,
902 "name": "%VAR-sourceCasLib",
903 "type": "CHARACTER",
904 "label": "Source CAS Library",
905 "required": true
906 },
907 {
908 "version": 1,
909 "name": "%VAR-destinationCasLib",
910 "type": "CHARACTER",
911 "label": "Destination CAS Library",
912 "required": true
913 },
914 {
915 "version": 1,
916 "name": "%VAR-sourceTableSourceName",
917 "type": "CHARACTER",
918 "label": "Source Table Name",
919 "required": true
920 },
921 {
922 "version": 1,
923 "name": "%VAR-sourceTable",
924 "type": "CHARACTER",
925 "label": "Source Table Name",
926 "required": true
927 },
928 {
929 "version": 1,
930 "name": "%VAR-destinationTable",
931 "type": "CHARACTER",
932 "label": "Destination Table Name",
933 "required": true
934 },
935 {
936 "version": 1,
937 "name": "%VAR-destinationTableLabel",
938 "defaultValue": "",
939 "type": "CHARACTER",
940 "label": "Destination Table Label",
941 "required": false
942 },
943 {
944 "version": 1,
945 "name": "%VAR-replace",
946 "defaultValue": "1",
947 "type": "NUMERIC",
948 "label": "Replace destination table flag (true = replace)",
949 "required": true
950 },
951 {
952 "version": 1,
953 "name": "%VAR-persist",
954 "defaultValue": "1",
955 "type": "NUMERIC",
956 "label": "Persist destination table flag (true = save table to destination caslib backing store)",
957 "required": true
958 },
959 {
960 "version": 1,
961 "name": "%VAR-replication",
962 "defaultValue": "1",
963 "type": "NUMERIC",
964 "label": "Specifies the number of copies of the table to make for fault tolerance.",
965 "required": true
966 },
967 {
968 "version": 1,
969 "name": "%VAR-promote",
970 "defaultValue": "1",
971 "type": "NUMERIC",
972 "label": "Scope in which to load table (1 = global and 0 = session)",
973 "required": true
974 },
975 {
976 "version": 1,
977 "name": "%VAR-description",
978 "defaultValue": "Temporary caslib for google drive import",
979 "type": "CHARACTER",
980 "label": "Temporary caslib for google drive import",
981 "required": false
982 },
983 {
984 "version": 1,
985 "name": "%VAR-scope",
986 "defaultValue": "session",
987 "type": "CHARACTER",
988 "label": "Scope for temporary caslib for google drive import",
989 "required": false
990 },
991 {
992 "version": 1,
993 "name": "%VAR-type",
994 "defaultValue": "google drive",
995 "type": "CHARACTER",
996 "label": "Type of caslib for import",
997 "required": false
998 },
999 {
1000 "version": 1,
1001 "name": "%VAR-path",
1002 "defaultValue": "",
1003 "type": "CHARACTER",
1004 "label": "Path for import",
1005 "required": false
1006 },
1007 {
1008 "version": 1,
1009 "name": "%VAR-dataSourceAttributesTable",
1010 "defaultValue": "{}",
1011 "type": "TABLE",
1012 "label": "Add caslib attributes",
1013 "required": true
1014 },
1015 {
1016 "version": 1,
1017 "name": "%VAR-dataSourceOptionsTable",
1018 "defaultValue": "{}",
1019 "type": "TABLE",
1020 "label": "Load table parameters",
1021 "required": true
1022 },
1023 {
1024 "version": 1,
1025 "name": "preferences",
1026 "defaultValue": "{}",
1027 "type": "TABLE",
1028 "label": "Import google drive preferences. Consumed by middle-tier after the job has completed successfully.",
1029 "required": false
1030 }
1031 ],
1032 "code": "session server;\n\n/* add more variables as required */\nscriptContext[\"adhocCaslib\"] = sourceCasLib;\nscriptContext[\"dropAdhocCaslib\"] = false;\n\n/* code assumes promote == true */\n\naddCasLibParams={\n description = description,\n name = sourceCasLib,\n dataSource = {\n srcType=dataSourceAttributesTable.srcType\n }\n};\n\naddCaslib status=rc result=r / addCasLibParams;\ncheckStatus(scriptContext, rc, \"Error creating session cas lib\", 1);\n\nscriptContext[\"dropAdhocCaslib\"] = true;\n\n/* Set up the parameters to load the table with */\nloadParms={\n caslib = sourceCasLib,\n path = sourceTableSourceName,\n casOut = { caslib = destinationCasLib,\n name = destinationTable,\n label = destinationTableLabel,\n replace = replace,\n replication = replication },\n dataSourceOptions = {\n ddsgoogledrive_apiToken = dataSourceOptionsTable.ddsgoogledrive_apiToken,\n ddsgoogledrive_filePath = dataSourceOptionsTable.ddsgoogledrive_filePath,\n ddsgoogledrive_fileId = dataSourceOptionsTable.ddsgoogledrive_fileId,\n ddsgoogledrive_fileName = dataSourceOptionsTable.ddsgoogledrive_fileName,\n ddsgoogledrive_mimeType = dataSourceOptionsTable.ddsgoogledrive_mimeType,\n ddsgoogledrive_importOptions = dataSourceOptionsTable.ddsgoogledrive_importOptions,\n ddsgoogledrive_httpProxyServer = dataSourceOptionsTable.ddsgoogledrive_httpProxyServer,\n ddsgoogledrive_httpProxyPort = dataSourceOptionsTable.ddsgoogledrive_httpProxyPort\n }\n};\n\n/* IF NOT doing a Replace, check if target table exists and fail if it does */\ncheckReplace(scriptContext, replace, destinationCasLib, destinationTable);\n\n/*\n call to setSessOpt required else one will get \"Base table or view not found ORA-00942: table or view does not exist error\"\n it appears google drive provider doesn't use casOut.caslib correctly\n*/\nsetSessOpt status=rc result=r / caslib=destinationCasLib;\n\nif persist == true then do;\n /*\n promote defaults to false when not specified\n setting explicitly in order to emphasize that 1st loadTable must be session scoped\n */\n loadParms[\"promote\"] = false;\n\n checkStatus(scriptContext, rc, \"Error setting default caslib to \" || destinationCasLib, 2);\n\n print \"Loading table with load parameters: \";\n print loadParms;\n loadTable status=rc result=r / loadParms;\n checkStatus(scriptContext, rc, \"Error loading initial session table\", 2);\n\n /* Save CAS table to DESTINATION caslib backing store */\n save status=rc result=r / caslib=destinationCasLib,\n name=destinationTable,\n table={ caslib=destinationCasLib\n name=destinationTable },\n replace=replace;\n checkStatus(scriptContext, rc, \"Error saving table\", 3);\n\n loadPath=dictionary(r, \"name\");\n loadCasLib=destinationCasLib;\n \n /* Set up the parameters for the loadTable action below based on saved location above along with label and replication args*/\n loadParms={caslib=loadCasLib\n path=loadPath\n casOut={ caslib=destinationCasLib\n name=destinationTable\n label=destinationTableLabel\n replication=replication }\n promote=promote};\nend;\nelse do;\n /* we are not saving, but we may be promoting, so add promote to the loadParms */\n loadParms[\"promote\"]=promote;\n loadParms[\"casOut\"][\"replace\"]=false;\nend;\n\n/* We should be ok dropping twice here, since we have already checked the replace flag above */\n\n/* Unload session table from memory in destination caslib */\ndropTableIfExists(scriptContext, destinationCasLib, destinationTable);\n/* Unload global table from memory */\ndropTableIfExists(scriptContext, destinationCasLib, destinationTable);\n\n/* Load table into memory in destination caslib as global table */\nprint loadParms;\nloadTable status=rc result=r / loadParms;\ncheckStatus(scriptContext, rc, \"Error loading final table\", 4);\n\ndropCasLib(scriptContext);\n\nfunction hasVarList(vars);\n if isList(vars) then do;\n nvars = dim(vars);\n end;\n else do;\n nvars = 0;\n end;\n if nVars>0 then do;\n return true;\n end;\n return false;\nend;\n\nfunction checkStatus(context, rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n dropCasLib(context);\n exit 1;\n end;\nend func;\n\nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n\nfunction dropTableIfExists(context, casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(context, rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;\n\nfunction dropCasLib(context);\n if context[\"dropAdhocCaslib\"] then do;\n context[\"dropAdhocCaslib\"] = false;\n dropCaslib status=rc result=r / caslib=context[\"adhocCaslib\"] quiet=false;\n if rc.statusCode != 0 then do;\n print \"Error dropping temp session cas lib: \" || casLib;\n end;\n end;\n\nend func;\n\nfunction checkReplace(context, replace, caslib, table);\n if replace == false then do;\n exists = doesTableExist(caslib, table);\n if (exists != 0) then do;\n print \"Table already exists and replace flag is set to false.\";\n print \"UserErrorCode: 1\";\n dropCasLib(context);\n exit 1;\n end;\n end;\nend func;",
1033 "links": [
1034 {
1035 "method": "GET",
1036 "rel": "self",
1037 "href": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1038 "uri": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1039 "type": "application/vnd.sas.job.definition"
1040 },
1041 {
1042 "method": "GET",
1043 "rel": "alternate",
1044 "href": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1045 "uri": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1046 "type": "application/vnd.sas.summary"
1047 }
1048 ],
1049 "properties": [
1050 {
1051 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
1052 "value": "true"
1053 }
1054 ]
1055 },
1056 {
1057 "creationTimeStamp": "2021-11-08T19:27:43.273Z",
1058 "modifiedTimeStamp": "2021-11-08T19:27:43.275Z",
1059 "createdBy": "sas.SASDataExplorer",
1060 "modifiedBy": "sas.SASDataExplorer",
1061 "version": 2,
1062 "id": "b582a48f-0f09-4652-8dec-a39f7f953e83",
1063 "name": "Unload Table",
1064 "type": "casl",
1065 "parameters": [
1066 {
1067 "version": 1,
1068 "name": "sessionId",
1069 "type": "CHARACTER",
1070 "label": "CAS Session Id (optional)",
1071 "required": false
1072 },
1073 {
1074 "version": 1,
1075 "name": "serverId",
1076 "type": "CHARACTER",
1077 "label": "CAS Server Id",
1078 "required": true
1079 },
1080 {
1081 "version": 1,
1082 "name": "%VAR-sourceCasLib",
1083 "type": "CHARACTER",
1084 "label": "CAS Library",
1085 "required": true
1086 },
1087 {
1088 "version": 1,
1089 "name": "%VAR-sourceTable",
1090 "type": "CHARACTER",
1091 "label": "Table Name",
1092 "required": true
1093 },
1094 {
1095 "version": 1,
1096 "name": "data_explorer_submission_id",
1097 "type": "CHARACTER",
1098 "label": "Unique identifier by which UI tracks this job",
1099 "required": false
1100 }
1101 ],
1102 "code": "/* IF doing a Replace, unload table from memory in caslib - drop 1 (two drops in case both session and global exist) */\ndropTableIfExists(sourceCasLib, sourceTable);\n\n/* IF doing a Replace, unload table from memory in caslib - drop 2 */\ndropTableIfExists(sourceCasLib, sourceTable);\n\nfunction checkStatus(rc, logMessage, errorCode);\n if rc.statusCode != 0 then do;\n print logMessage;\n print \"UserErrorCode: \"||errorCode;\n exit 1;\n end;\nend;\n\nfunction doesTableExist(casLib, casTable);\n tableExists result=r status=rc / caslib=casLib table=casTable;\n tableExists = dictionary(r, \"exists\");\n return tableExists;\nend func;\n\nfunction dropTableIfExists(casLib,casTable);\n tableExists = doesTableExist(casLib, casTable);\n if tableExists != 0 then do;\n print \"Dropping table: \"||casLib||\".\"||casTable;\n dropTable result=r status=rc/ caslib=casLib table=casTable quiet=0;\n checkStatus(rc, \"Error dropping table: \"||casLib||\".\"||casTable, 5);\n end;\nend func;",
1103 "links": [
1104 {
1105 "method": "GET",
1106 "rel": "self",
1107 "href": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1108 "uri": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1109 "type": "application/vnd.sas.job.definition"
1110 },
1111 {
1112 "method": "GET",
1113 "rel": "alternate",
1114 "href": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1115 "uri": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1116 "type": "application/vnd.sas.summary"
1117 }
1118 ],
1119 "properties": [
1120 {
1121 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
1122 "value": "true"
1123 }
1124 ]
1125 }
1126 ],
1127 "limit": 10,
1128 "version": 2
1129}

Query Parameters

NameTypeRequiredDescription
filter
string
false

Filters the results of the query.

limit
integer
false

The maximum number of job definitions to return. The default value is 10.

sortBy
string
false

Defines how the returned job definitions are sorted.

start
integer
false

The index of the first job definition to return. The default value is 0.

Responses

StatusMeaningDescription
200OKThe request succeeded.Schema
400Bad RequestThe request was invalid. An invalid filter or combination of request parameters was provided.Schema