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 "links": [
140 {
141 "method": "GET",
142 "rel": "self",
143 "href": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
144 "uri": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
145 "type": "application/vnd.sas.job.definition"
146 },
147 {
148 "method": "GET",
149 "rel": "alternate",
150 "href": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
151 "uri": "/jobDefinitions/definitions/801d5009-3b33-41c1-b7e4-b33f77248ede",
152 "type": "application/vnd.sas.summary"
153 }
154 ]
155 },
156 {
157 "creationTimeStamp": "2021-11-08T19:25:41.775Z",
158 "modifiedTimeStamp": "2021-11-08T19:25:41.776Z",
159 "createdBy": "sas.audit",
160 "modifiedBy": "sas.audit",
161 "version": 2,
162 "id": "7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
163 "name": "CAS Audit table update",
164 "description": "After upload of new Audit data into a temporary CAS table, this job appends the new data to the existing Audit data",
165 "type": "casl",
166 "parameters": [
167 {
168 "version": 1,
169 "name": "%VAR-expireDate",
170 "type": "CHARACTER",
171 "required": true
172 },
173 {
174 "version": 1,
175 "name": "%VAR-tempTableName",
176 "type": "CHARACTER",
177 "required": true
178 },
179 {
180 "version": 1,
181 "name": "%VAR-targetCaslib",
182 "type": "CHARACTER",
183 "required": true
184 },
185 {
186 "version": 1,
187 "name": "serverId",
188 "defaultValue": "cas-shared-default",
189 "type": "CHARACTER",
190 "required": false
191 }
192 ],
193 "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;",
194 "links": [
195 {
196 "method": "GET",
197 "rel": "self",
198 "href": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
199 "uri": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
200 "type": "application/vnd.sas.job.definition"
201 },
202 {
203 "method": "GET",
204 "rel": "alternate",
205 "href": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
206 "uri": "/jobDefinitions/definitions/7b5ef82d-19e3-46e1-ebeb-cf15b8675309",
207 "type": "application/vnd.sas.summary"
208 }
209 ]
210 },
211 {
212 "creationTimeStamp": "2021-11-08T19:27:14.440Z",
213 "modifiedTimeStamp": "2021-11-08T19:27:14.442Z",
214 "createdBy": "sas.SASDataExplorer",
215 "modifiedBy": "sas.SASDataExplorer",
216 "version": 2,
217 "id": "3ec9e0c3-6ef8-42d0-b233-807005322050",
218 "name": "Copy CasTable",
219 "type": "casl",
220 "parameters": [
221 {
222 "version": 1,
223 "name": "sessionId",
224 "type": "CHARACTER",
225 "label": "CAS Session Id",
226 "required": false
227 },
228 {
229 "version": 1,
230 "name": "serverId",
231 "type": "CHARACTER",
232 "label": "CAS Server Id",
233 "required": true
234 },
235 {
236 "version": 1,
237 "name": "%VAR-sourceCasLib",
238 "type": "CHARACTER",
239 "label": "Source CAS Library",
240 "required": true
241 },
242 {
243 "version": 1,
244 "name": "%VAR-destinationCasLib",
245 "type": "CHARACTER",
246 "label": "Destination CAS Library",
247 "required": true
248 },
249 {
250 "version": 1,
251 "name": "%VAR-sourceTable",
252 "type": "CHARACTER",
253 "label": "Source Table Name",
254 "required": true
255 },
256 {
257 "version": 1,
258 "name": "%VAR-destinationTable",
259 "type": "CHARACTER",
260 "label": "Destination Table Name",
261 "required": true
262 },
263 {
264 "version": 1,
265 "name": "%VAR-destinationTableLabel",
266 "defaultValue": "",
267 "type": "CHARACTER",
268 "label": "Destination Table Label",
269 "required": false
270 },
271 {
272 "version": 1,
273 "name": "%VAR-replace",
274 "defaultValue": "1",
275 "type": "NUMERIC",
276 "label": "Replace destination table flag (true = replace)",
277 "required": true
278 },
279 {
280 "version": 1,
281 "name": "%VAR-promote",
282 "defaultValue": "1",
283 "type": "NUMERIC",
284 "label": "Scope in which to load table (true = global and false = session)",
285 "required": true
286 },
287 {
288 "version": 1,
289 "name": "%VAR-replication",
290 "defaultValue": "1",
291 "type": "NUMERIC",
292 "label": "Specifies the number of copies of the table to make for fault tolerance.",
293 "required": true
294 },
295 {
296 "version": 1,
297 "name": "%VAR-data_explorer_submission_id",
298 "type": "CHARACTER",
299 "label": "Unique identifier by which UI tracks this job",
300 "required": false
301 }
302 ],
303 "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",
304 "links": [
305 {
306 "method": "GET",
307 "rel": "self",
308 "href": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
309 "uri": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
310 "type": "application/vnd.sas.job.definition"
311 },
312 {
313 "method": "GET",
314 "rel": "alternate",
315 "href": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
316 "uri": "/jobDefinitions/definitions/3ec9e0c3-6ef8-42d0-b233-807005322050",
317 "type": "application/vnd.sas.summary"
318 }
319 ],
320 "properties": [
321 {
322 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
323 "value": "true"
324 }
325 ]
326 },
327 {
328 "creationTimeStamp": "2021-11-08T19:25:46.589Z",
329 "modifiedTimeStamp": "2021-11-08T19:26:08.473Z",
330 "createdBy": "sas.analyticsPipelines",
331 "modifiedBy": "sas.analyticsFlows",
332 "version": 2,
333 "id": "aac6228d-bb53-41cd-be3f-857cf0e9c692",
334 "name": "Copy CasTable (v2)",
335 "type": "casl",
336 "parameters": [
337 {
338 "version": 1,
339 "name": "sessionId",
340 "type": "CHARACTER",
341 "label": "CAS Session Id",
342 "required": false
343 },
344 {
345 "version": 1,
346 "name": "serverId",
347 "type": "CHARACTER",
348 "label": "CAS Server Id",
349 "required": true
350 },
351 {
352 "version": 1,
353 "name": "%VAR-sourceCasLib",
354 "type": "CHARACTER",
355 "label": "Source CAS Library",
356 "required": true
357 },
358 {
359 "version": 1,
360 "name": "%VAR-destinationCasLib",
361 "type": "CHARACTER",
362 "label": "Destination CAS Library",
363 "required": true
364 },
365 {
366 "version": 1,
367 "name": "%VAR-sourceTable",
368 "type": "CHARACTER",
369 "label": "Source Table Name",
370 "required": true
371 },
372 {
373 "version": 1,
374 "name": "%VAR-destinationTable",
375 "type": "CHARACTER",
376 "label": "Destination Table Name",
377 "required": true
378 },
379 {
380 "version": 1,
381 "name": "%VAR-destinationTableLabel",
382 "defaultValue": "",
383 "type": "CHARACTER",
384 "label": "Destination Table Label",
385 "required": false
386 },
387 {
388 "version": 1,
389 "name": "%VAR-replace",
390 "defaultValue": "1",
391 "type": "NUMERIC",
392 "label": "Replace destination table flag (true = replace)",
393 "required": true
394 },
395 {
396 "version": 1,
397 "name": "%VAR-saveType",
398 "defaultValue": "sashdat",
399 "type": "CHARACTER",
400 "label": "The type of file to save to (file extension)",
401 "required": false
402 },
403 {
404 "version": 1,
405 "name": "%VAR-promote",
406 "defaultValue": "1",
407 "type": "NUMERIC",
408 "label": "Scope in which to load table (true = global and false = session)",
409 "required": true
410 },
411 {
412 "version": 1,
413 "name": "%VAR-replication",
414 "defaultValue": "1",
415 "type": "NUMERIC",
416 "label": "Specifies the number of copies of the table to make for fault tolerance.",
417 "required": true
418 },
419 {
420 "version": 1,
421 "name": "%VAR-data_explorer_submission_id",
422 "type": "CHARACTER",
423 "label": "Unique identifier by which UI tracks this job",
424 "required": false
425 }
426 ],
427 "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",
428 "links": [
429 {
430 "method": "GET",
431 "rel": "self",
432 "href": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
433 "uri": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
434 "type": "application/vnd.sas.job.definition"
435 },
436 {
437 "method": "GET",
438 "rel": "alternate",
439 "href": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
440 "uri": "/jobDefinitions/definitions/aac6228d-bb53-41cd-be3f-857cf0e9c692",
441 "type": "application/vnd.sas.summary"
442 }
443 ],
444 "properties": [
445 {
446 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
447 "value": "true"
448 }
449 ]
450 },
451 {
452 "creationTimeStamp": "2021-11-08T19:27:16.626Z",
453 "modifiedTimeStamp": "2021-11-08T19:27:16.629Z",
454 "createdBy": "sas.SASDataExplorer",
455 "modifiedBy": "sas.SASDataExplorer",
456 "version": 2,
457 "id": "faf6228d-bb53-41cd-be3f-857cf0e9c692",
458 "name": "Copy CasTable (v2)",
459 "type": "casl",
460 "parameters": [
461 {
462 "version": 1,
463 "name": "sessionId",
464 "type": "CHARACTER",
465 "label": "CAS Session Id",
466 "required": false
467 },
468 {
469 "version": 1,
470 "name": "serverId",
471 "type": "CHARACTER",
472 "label": "CAS Server Id",
473 "required": true
474 },
475 {
476 "version": 1,
477 "name": "%VAR-sourceCasLib",
478 "type": "CHARACTER",
479 "label": "Source CAS Library",
480 "required": true
481 },
482 {
483 "version": 1,
484 "name": "%VAR-destinationCasLib",
485 "type": "CHARACTER",
486 "label": "Destination CAS Library",
487 "required": true
488 },
489 {
490 "version": 1,
491 "name": "%VAR-sourceTable",
492 "type": "CHARACTER",
493 "label": "Source Table Name",
494 "required": true
495 },
496 {
497 "version": 1,
498 "name": "%VAR-destinationTable",
499 "type": "CHARACTER",
500 "label": "Destination Table Name",
501 "required": true
502 },
503 {
504 "version": 1,
505 "name": "%VAR-destinationTableLabel",
506 "defaultValue": "",
507 "type": "CHARACTER",
508 "label": "Destination Table Label",
509 "required": false
510 },
511 {
512 "version": 1,
513 "name": "%VAR-replace",
514 "defaultValue": "1",
515 "type": "NUMERIC",
516 "label": "Replace destination table flag (true = replace)",
517 "required": true
518 },
519 {
520 "version": 1,
521 "name": "%VAR-saveType",
522 "defaultValue": "",
523 "type": "CHARACTER",
524 "label": "The type of file to save to (file extension)",
525 "required": true
526 },
527 {
528 "version": 1,
529 "name": "%VAR-promote",
530 "defaultValue": "1",
531 "type": "NUMERIC",
532 "label": "Scope in which to load table (true = global and false = session)",
533 "required": true
534 },
535 {
536 "version": 1,
537 "name": "%VAR-replication",
538 "defaultValue": "1",
539 "type": "NUMERIC",
540 "label": "Specifies the number of copies of the table to make for fault tolerance.",
541 "required": true
542 },
543 {
544 "version": 1,
545 "name": "%VAR-data_explorer_submission_id",
546 "type": "CHARACTER",
547 "label": "Unique identifier by which UI tracks this job",
548 "required": false
549 }
550 ],
551 "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",
552 "links": [
553 {
554 "method": "GET",
555 "rel": "self",
556 "href": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
557 "uri": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
558 "type": "application/vnd.sas.job.definition"
559 },
560 {
561 "method": "GET",
562 "rel": "alternate",
563 "href": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
564 "uri": "/jobDefinitions/definitions/faf6228d-bb53-41cd-be3f-857cf0e9c692",
565 "type": "application/vnd.sas.summary"
566 }
567 ],
568 "properties": [
569 {
570 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
571 "value": "true"
572 }
573 ]
574 },
575 {
576 "creationTimeStamp": "2021-11-08T19:27:24.858Z",
577 "modifiedTimeStamp": "2021-11-08T19:27:24.860Z",
578 "createdBy": "sas.SASDataExplorer",
579 "modifiedBy": "sas.SASDataExplorer",
580 "version": 2,
581 "id": "97639c7d-b715-48da-ac9f-c1aa42cce1f1",
582 "name": "Import Table - Images",
583 "type": "casl",
584 "parameters": [
585 {
586 "version": 1,
587 "name": "sessionId",
588 "type": "CHARACTER",
589 "label": "CAS Session Id (optional)",
590 "required": false
591 },
592 {
593 "version": 1,
594 "name": "serverId",
595 "type": "CHARACTER",
596 "label": "CAS Server Id",
597 "required": true
598 },
599 {
600 "version": 1,
601 "name": "%VAR-sourceCasLib",
602 "type": "CHARACTER",
603 "label": "CAS Library",
604 "required": true
605 },
606 {
607 "version": 1,
608 "name": "%VAR-destinationCasLib",
609 "type": "CHARACTER",
610 "label": "CAS Library",
611 "required": true
612 },
613 {
614 "version": 1,
615 "name": "%VAR-destinationTable",
616 "type": "CHARACTER",
617 "label": "Table name",
618 "required": true
619 },
620 {
621 "version": 1,
622 "name": "%VAR-replace",
623 "defaultValue": "1",
624 "type": "NUMERIC",
625 "label": "Replace table flag (true = replace)",
626 "required": true
627 },
628 {
629 "version": 1,
630 "name": "%VAR-promote",
631 "defaultValue": "1",
632 "type": "NUMERIC",
633 "label": "Scope in which to load table (1 = global and 0 = session)",
634 "required": true
635 },
636 {
637 "version": 1,
638 "name": "%VAR-replication",
639 "defaultValue": "1",
640 "type": "NUMERIC",
641 "label": "Specifies the number of copies of the table to make for fault tolerance.",
642 "required": true
643 },
644 {
645 "version": 1,
646 "name": "%VAR-persist",
647 "defaultValue": "1",
648 "type": "NUMERIC",
649 "label": "Persist destination table flag (true = save table to destination caslib backing store)",
650 "required": true
651 },
652 {
653 "version": 1,
654 "name": "%VAR-destinationTableLabel",
655 "defaultValue": "",
656 "type": "CHARACTER",
657 "label": "Destination Table Label",
658 "required": false
659 },
660 {
661 "version": 1,
662 "name": "%VAR-sourceTableSourceName",
663 "defaultValue": "",
664 "type": "CHARACTER",
665 "label": "Path of image(s) to load, leave blank to load all images",
666 "required": true
667 },
668 {
669 "version": 1,
670 "name": "%VAR-recurse",
671 "defaultValue": "0",
672 "type": "NUMERIC",
673 "label": "Flag to recurse subdirectories",
674 "required": true
675 },
676 {
677 "version": 1,
678 "name": "%VAR-decode",
679 "defaultValue": "0",
680 "type": "NUMERIC",
681 "label": "Flag to decompress image and add metadata",
682 "required": true
683 },
684 {
685 "version": 1,
686 "name": "%VAR-series",
687 "defaultValue": "0",
688 "type": "NUMERIC",
689 "label": "Flag to set if images are a series",
690 "required": true
691 },
692 {
693 "version": 1,
694 "name": "%VAR-dicom",
695 "defaultValue": "0",
696 "type": "NUMERIC",
697 "label": "Flag to set dicom option",
698 "required": true
699 },
700 {
701 "version": 1,
702 "name": "%VAR-reverse",
703 "defaultValue": "0",
704 "type": "NUMERIC",
705 "label": "Flag to set reverse option",
706 "required": true
707 },
708 {
709 "version": 1,
710 "name": "%VAR-pathIsList",
711 "defaultValue": "0",
712 "type": "NUMERIC",
713 "label": "Flag to set pathIsList option",
714 "required": true
715 },
716 {
717 "version": 1,
718 "name": "%VAR-labelLevels",
719 "defaultValue": "0",
720 "type": "NUMERIC",
721 "label": "Specifies the maximum number of directory levels to include in the label",
722 "required": true
723 },
724 {
725 "version": 1,
726 "name": "%VAR-saveType",
727 "defaultValue": "",
728 "type": "CHARACTER",
729 "label": "The type of file to save to (file extension)",
730 "required": true
731 },
732 {
733 "version": 1,
734 "name": "%VAR-addColumns",
735 "defaultValue": "{}",
736 "type": "TABLE",
737 "label": "Specifies the metadata columns to add to the image",
738 "required": true
739 },
740 {
741 "version": 1,
742 "name": "%VAR-advancedOptionsTable",
743 "defaultValue": "{}",
744 "type": "TABLE",
745 "label": "Load image advanced import options",
746 "required": false
747 },
748 {
749 "version": 1,
750 "name": "%VAR-data_explorer_submission_id",
751 "type": "CHARACTER",
752 "label": "Unique identifier by which UI tracks this job",
753 "required": false
754 }
755 ],
756 "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;",
757 "links": [
758 {
759 "method": "GET",
760 "rel": "self",
761 "href": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
762 "uri": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
763 "type": "application/vnd.sas.job.definition"
764 },
765 {
766 "method": "GET",
767 "rel": "alternate",
768 "href": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
769 "uri": "/jobDefinitions/definitions/97639c7d-b715-48da-ac9f-c1aa42cce1f1",
770 "type": "application/vnd.sas.summary"
771 }
772 ],
773 "properties": [
774 {
775 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
776 "value": "true"
777 }
778 ]
779 },
780 {
781 "creationTimeStamp": "2021-11-08T19:27:27.084Z",
782 "modifiedTimeStamp": "2021-11-08T19:27:27.086Z",
783 "createdBy": "sas.SASDataExplorer",
784 "modifiedBy": "sas.SASDataExplorer",
785 "version": 2,
786 "id": "afbed716-533f-48ec-a17b-44cc62735eb7",
787 "name": "Load Table",
788 "type": "casl",
789 "parameters": [
790 {
791 "version": 1,
792 "name": "sessionId",
793 "type": "CHARACTER",
794 "label": "CAS Session Id (optional)",
795 "required": false
796 },
797 {
798 "version": 1,
799 "name": "serverId",
800 "type": "CHARACTER",
801 "label": "CAS Server Id",
802 "required": true
803 },
804 {
805 "version": 1,
806 "name": "%VAR-sourceCasLib",
807 "type": "CHARACTER",
808 "label": "CAS Library",
809 "required": true
810 },
811 {
812 "version": 1,
813 "name": "%VAR-sourceTable",
814 "type": "CHARACTER",
815 "label": "Table name",
816 "required": true
817 },
818 {
819 "version": 1,
820 "name": "%VAR-sourceTableSourceName",
821 "type": "CHARACTER",
822 "label": "Source Table Source Name",
823 "required": true
824 },
825 {
826 "version": 1,
827 "name": "%VAR-replace",
828 "defaultValue": "1",
829 "type": "NUMERIC",
830 "label": "Replace table flag (true = replace)",
831 "required": true
832 },
833 {
834 "version": 1,
835 "name": "%VAR-promote",
836 "defaultValue": "1",
837 "type": "NUMERIC",
838 "label": "Scope in which to load table (1 = global and 0 = session)",
839 "required": true
840 },
841 {
842 "version": 1,
843 "name": "%VAR-data_explorer_submission_id",
844 "type": "CHARACTER",
845 "label": "Unique identifier by which UI tracks this job",
846 "required": false
847 }
848 ],
849 "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",
850 "links": [
851 {
852 "method": "GET",
853 "rel": "self",
854 "href": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
855 "uri": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
856 "type": "application/vnd.sas.job.definition"
857 },
858 {
859 "method": "GET",
860 "rel": "alternate",
861 "href": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
862 "uri": "/jobDefinitions/definitions/afbed716-533f-48ec-a17b-44cc62735eb7",
863 "type": "application/vnd.sas.summary"
864 }
865 ],
866 "properties": [
867 {
868 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
869 "value": "true"
870 }
871 ]
872 },
873 {
874 "creationTimeStamp": "2021-11-08T19:29:15.330Z",
875 "modifiedTimeStamp": "2021-11-08T19:29:15.331Z",
876 "createdBy": "sas.SASDataExplorer",
877 "modifiedBy": "sas.SASDataExplorer",
878 "version": 2,
879 "id": "e8969cab-f037-43b4-aab3-abb206f7bdf8",
880 "name": "Import Table - Google Drive (v2)",
881 "type": "casl",
882 "parameters": [
883 {
884 "version": 1,
885 "name": "sessionId",
886 "type": "CHARACTER",
887 "label": "CAS Session Id",
888 "required": false
889 },
890 {
891 "version": 1,
892 "name": "serverId",
893 "type": "CHARACTER",
894 "label": "CAS Server Id",
895 "required": true
896 },
897 {
898 "version": 1,
899 "name": "%VAR-sourceCasLib",
900 "type": "CHARACTER",
901 "label": "Source CAS Library",
902 "required": true
903 },
904 {
905 "version": 1,
906 "name": "%VAR-destinationCasLib",
907 "type": "CHARACTER",
908 "label": "Destination CAS Library",
909 "required": true
910 },
911 {
912 "version": 1,
913 "name": "%VAR-sourceTableSourceName",
914 "type": "CHARACTER",
915 "label": "Source Table Name",
916 "required": true
917 },
918 {
919 "version": 1,
920 "name": "%VAR-sourceTable",
921 "type": "CHARACTER",
922 "label": "Source Table Name",
923 "required": true
924 },
925 {
926 "version": 1,
927 "name": "%VAR-destinationTable",
928 "type": "CHARACTER",
929 "label": "Destination Table Name",
930 "required": true
931 },
932 {
933 "version": 1,
934 "name": "%VAR-destinationTableLabel",
935 "defaultValue": "",
936 "type": "CHARACTER",
937 "label": "Destination Table Label",
938 "required": false
939 },
940 {
941 "version": 1,
942 "name": "%VAR-replace",
943 "defaultValue": "1",
944 "type": "NUMERIC",
945 "label": "Replace destination table flag (true = replace)",
946 "required": true
947 },
948 {
949 "version": 1,
950 "name": "%VAR-persist",
951 "defaultValue": "1",
952 "type": "NUMERIC",
953 "label": "Persist destination table flag (true = save table to destination caslib backing store)",
954 "required": true
955 },
956 {
957 "version": 1,
958 "name": "%VAR-replication",
959 "defaultValue": "1",
960 "type": "NUMERIC",
961 "label": "Specifies the number of copies of the table to make for fault tolerance.",
962 "required": true
963 },
964 {
965 "version": 1,
966 "name": "%VAR-promote",
967 "defaultValue": "1",
968 "type": "NUMERIC",
969 "label": "Scope in which to load table (1 = global and 0 = session)",
970 "required": true
971 },
972 {
973 "version": 1,
974 "name": "%VAR-description",
975 "defaultValue": "Temporary caslib for google drive import",
976 "type": "CHARACTER",
977 "label": "Temporary caslib for google drive import",
978 "required": false
979 },
980 {
981 "version": 1,
982 "name": "%VAR-scope",
983 "defaultValue": "session",
984 "type": "CHARACTER",
985 "label": "Scope for temporary caslib for google drive import",
986 "required": false
987 },
988 {
989 "version": 1,
990 "name": "%VAR-type",
991 "defaultValue": "google drive",
992 "type": "CHARACTER",
993 "label": "Type of caslib for import",
994 "required": false
995 },
996 {
997 "version": 1,
998 "name": "%VAR-path",
999 "defaultValue": "",
1000 "type": "CHARACTER",
1001 "label": "Path for import",
1002 "required": false
1003 },
1004 {
1005 "version": 1,
1006 "name": "%VAR-dataSourceAttributesTable",
1007 "defaultValue": "{}",
1008 "type": "TABLE",
1009 "label": "Add caslib attributes",
1010 "required": true
1011 },
1012 {
1013 "version": 1,
1014 "name": "%VAR-dataSourceOptionsTable",
1015 "defaultValue": "{}",
1016 "type": "TABLE",
1017 "label": "Load table parameters",
1018 "required": true
1019 },
1020 {
1021 "version": 1,
1022 "name": "preferences",
1023 "defaultValue": "{}",
1024 "type": "TABLE",
1025 "label": "Import google drive preferences. Consumed by middle-tier after the job has completed successfully.",
1026 "required": false
1027 }
1028 ],
1029 "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;",
1030 "links": [
1031 {
1032 "method": "GET",
1033 "rel": "self",
1034 "href": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1035 "uri": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1036 "type": "application/vnd.sas.job.definition"
1037 },
1038 {
1039 "method": "GET",
1040 "rel": "alternate",
1041 "href": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1042 "uri": "/jobDefinitions/definitions/e8969cab-f037-43b4-aab3-abb206f7bdf8",
1043 "type": "application/vnd.sas.summary"
1044 }
1045 ],
1046 "properties": [
1047 {
1048 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
1049 "value": "true"
1050 }
1051 ]
1052 },
1053 {
1054 "creationTimeStamp": "2021-11-08T19:27:43.273Z",
1055 "modifiedTimeStamp": "2021-11-08T19:27:43.275Z",
1056 "createdBy": "sas.SASDataExplorer",
1057 "modifiedBy": "sas.SASDataExplorer",
1058 "version": 2,
1059 "id": "b582a48f-0f09-4652-8dec-a39f7f953e83",
1060 "name": "Unload Table",
1061 "type": "casl",
1062 "parameters": [
1063 {
1064 "version": 1,
1065 "name": "sessionId",
1066 "type": "CHARACTER",
1067 "label": "CAS Session Id (optional)",
1068 "required": false
1069 },
1070 {
1071 "version": 1,
1072 "name": "serverId",
1073 "type": "CHARACTER",
1074 "label": "CAS Server Id",
1075 "required": true
1076 },
1077 {
1078 "version": 1,
1079 "name": "%VAR-sourceCasLib",
1080 "type": "CHARACTER",
1081 "label": "CAS Library",
1082 "required": true
1083 },
1084 {
1085 "version": 1,
1086 "name": "%VAR-sourceTable",
1087 "type": "CHARACTER",
1088 "label": "Table Name",
1089 "required": true
1090 },
1091 {
1092 "version": 1,
1093 "name": "data_explorer_submission_id",
1094 "type": "CHARACTER",
1095 "label": "Unique identifier by which UI tracks this job",
1096 "required": false
1097 }
1098 ],
1099 "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;",
1100 "links": [
1101 {
1102 "method": "GET",
1103 "rel": "self",
1104 "href": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1105 "uri": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1106 "type": "application/vnd.sas.job.definition"
1107 },
1108 {
1109 "method": "GET",
1110 "rel": "alternate",
1111 "href": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1112 "uri": "/jobDefinitions/definitions/b582a48f-0f09-4652-8dec-a39f7f953e83",
1113 "type": "application/vnd.sas.summary"
1114 }
1115 ],
1116 "properties": [
1117 {
1118 "name": "REST_EXECUTION_PROVIDER_ASSUME_URIS_ENCODED",
1119 "value": "true"
1120 }
1121 ]
1122 }
1123 ],
1124 "limit": 10,
1125 "version": 2
1126}

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