@sassoftware/viya-serverjs 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +4 -4
- package/.env.proxy +4 -3
- package/.env.server +5 -4
- package/Dockerfile +3 -3
- package/cli.js +2 -2
- package/lib/handlers/proxyMapUri.js +4 -30
- package/lib/handlers/setCookies.js +7 -6
- package/lib/plugins/appCookie.js +3 -3
- package/lib/plugins/setDefaultRoutes.js +78 -53
- package/lib/plugins/setupAuth.js +2 -1
- package/package.json +1 -1
- package/public/index.html +8 -2
- package/public/indexProxy.html +1 -0
- package/server.js +5 -116
- package/src/handlers/proxyMapUri.js +2 -30
- package/src/handlers/setCookies.js +3 -1
- package/src/iService.js +1 -0
- package/src/plugins/appCookie.js +3 -3
- package/src/plugins/setDefaultRoutes.js +7 -14
- package/src/plugins/setupAuth.js +3 -1
- package/{packages/examples/app/certs/tls.sh → tls/viyatls.sh} +0 -2
- package/packages/core/config.js +0 -86
- package/packages/core/handlers/appCallback.js +0 -40
- package/packages/core/handlers/codeAuth.js +0 -31
- package/packages/core/handlers/decodeJwt.js +0 -11
- package/packages/core/handlers/favicon.js +0 -24
- package/packages/core/handlers/getApp.js +0 -41
- package/packages/core/handlers/getApp2.js +0 -26
- package/packages/core/handlers/getUser.js +0 -20
- package/packages/core/handlers/index.js +0 -36
- package/packages/core/handlers/keepAlive.js +0 -54
- package/packages/core/handlers/keepAlive2.js +0 -13
- package/packages/core/handlers/logon.js +0 -24
- package/packages/core/handlers/logout.js +0 -43
- package/packages/core/handlers/proxyMapUri.js +0 -53
- package/packages/core/handlers/proxyOnResponse.js +0 -12
- package/packages/core/handlers/reactDev.js +0 -30
- package/packages/core/handlers/setCookies.js +0 -78
- package/packages/core/iService.js +0 -369
- package/packages/core/index.js +0 -249
- package/packages/core/parseDocker.js +0 -33
- package/packages/core/plugins/SASauth.js +0 -79
- package/packages/core/plugins/appCookie.js +0 -49
- package/packages/core/plugins/setContext.js +0 -34
- package/packages/core/plugins/setDefaultRoutes.js +0 -262
- package/packages/core/plugins/setupAuth.js +0 -48
- package/packages/core/plugins/setupUserRoutes.js +0 -48
- package/packages/core/plugins/token.js +0 -10
- package/packages/core/schemes/SASTokenScheme.js +0 -43
- package/packages/core/visionIndex.html +0 -24
- package/packages/examples/apitest/.env +0 -11
- package/packages/examples/apitest/.eslintrc.json +0 -42
- package/packages/examples/apitest/Dockerfile +0 -41
- package/packages/examples/apitest/api.js +0 -88
- package/packages/examples/apitest/appenv.js +0 -6
- package/packages/examples/apitest/docker-compose.yml +0 -10
- package/packages/examples/apitest/package.json +0 -19
- package/packages/examples/apitest/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/apitest/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/apitest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apitest/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/apitest/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/apitest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apitest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apitest/public/data/cars.csv +0 -429
- package/packages/examples/apitest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apitest/public/data/cmdList.txt +0 -15
- package/packages/examples/apitest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apitest/public/data/iris.csv +0 -151
- package/packages/examples/apitest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apitest/public/favicon.ico +0 -0
- package/packages/examples/apitest/public/index.html +0 -316
- package/packages/examples/apitest/public/index2.html +0 -102
- package/packages/examples/apitest/public/logon.html +0 -42
- package/packages/examples/apitest/public/myapp/secondary.html +0 -1
- package/packages/examples/apitest/public/myapp/test.js +0 -2
- package/packages/examples/apitest/public/onlogoff.html +0 -53
- package/packages/examples/apitest/start.sh +0 -15
- package/packages/examples/app/.env +0 -32
- package/packages/examples/app/.envProxy +0 -19
- package/packages/examples/app/.envimpl +0 -12
- package/packages/examples/app/.eslintrc.json +0 -42
- package/packages/examples/app/Dockerfile +0 -42
- package/packages/examples/app/appenv.js +0 -6
- package/packages/examples/app/certs/ca.crt +0 -19
- package/packages/examples/app/certs/tls.crt +0 -25
- package/packages/examples/app/certs/tls.key +0 -28
- package/packages/examples/app/docker-compose.yml +0 -12
- package/packages/examples/app/index.js +0 -15
- package/packages/examples/app/package.json +0 -20
- package/packages/examples/app/public/casread.html +0 -324
- package/packages/examples/app/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/app/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/app/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/app/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/app/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/app/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/app/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/app/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/app/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/app/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/app/public/data/cars.csv +0 -429
- package/packages/examples/app/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/app/public/data/cmdList.txt +0 -15
- package/packages/examples/app/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/app/public/data/iris.csv +0 -151
- package/packages/examples/app/public/data/model1.sas7bdat +0 -0
- package/packages/examples/app/public/favicon.ico +0 -0
- package/packages/examples/app/public/index.html +0 -332
- package/packages/examples/app/public/indexProxy.html +0 -346
- package/packages/examples/app/public/indextest.html +0 -316
- package/packages/examples/app/public/logon.html +0 -44
- package/packages/examples/app/public/micburger.html +0 -345
- package/packages/examples/app/public/micburger.txt.html +0 -311
- package/packages/examples/app/public/myapp/secondary.html +0 -1
- package/packages/examples/app/public/myapp/test.js +0 -2
- package/packages/examples/app/public/sara.txt +0 -345
- package/packages/examples/app/public/testva2.html +0 -311
- package/packages/examples/app/startup.sh +0 -15
- package/packages/examples/appdocker/.env +0 -21
- package/packages/examples/appdocker/.envProxy +0 -22
- package/packages/examples/appdocker/.envimpl +0 -12
- package/packages/examples/appdocker/.eslintrc.json +0 -42
- package/packages/examples/appdocker/Dockerfile +0 -43
- package/packages/examples/appdocker/appenv.js +0 -6
- package/packages/examples/appdocker/certs/ca.crt +0 -19
- package/packages/examples/appdocker/certs/tls.crt +0 -25
- package/packages/examples/appdocker/certs/tls.key +0 -28
- package/packages/examples/appdocker/certs/tls.sh +0 -5
- package/packages/examples/appdocker/docker-compose.yml +0 -12
- package/packages/examples/appdocker/index.js +0 -15
- package/packages/examples/appdocker/package.json +0 -20
- package/packages/examples/appdocker/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/appdocker/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/appdocker/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/appdocker/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/appdocker/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/appdocker/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/appdocker/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/appdocker/public/data/cars.csv +0 -429
- package/packages/examples/appdocker/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/appdocker/public/data/cmdList.txt +0 -15
- package/packages/examples/appdocker/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/appdocker/public/data/iris.csv +0 -151
- package/packages/examples/appdocker/public/data/model1.sas7bdat +0 -0
- package/packages/examples/appdocker/public/favicon.ico +0 -0
- package/packages/examples/appdocker/public/index.html +0 -346
- package/packages/examples/appdocker/public/indexProxy.html +0 -346
- package/packages/examples/appdocker/public/indextest.html +0 -316
- package/packages/examples/appdocker/public/logon.html +0 -44
- package/packages/examples/appdocker/public/myapp/secondary.html +0 -1
- package/packages/examples/appdocker/public/myapp/test.js +0 -2
- package/packages/examples/appdocker/startup.sh +0 -15
- package/packages/examples/apptest/.env +0 -28
- package/packages/examples/apptest/.envProxy +0 -22
- package/packages/examples/apptest/.envimpl +0 -12
- package/packages/examples/apptest/.eslintrc.json +0 -42
- package/packages/examples/apptest/Dockerfile +0 -44
- package/packages/examples/apptest/appDir/app1/design.html +0 -350
- package/packages/examples/apptest/appDir/app1/index.html +0 -353
- package/packages/examples/apptest/appDir/index.html +0 -350
- package/packages/examples/apptest/appenv.js +0 -6
- package/packages/examples/apptest/docker-compose.yml +0 -12
- package/packages/examples/apptest/index.js +0 -444
- package/packages/examples/apptest/package.json +0 -24
- package/packages/examples/apptest/public/casread2.html +0 -321
- package/packages/examples/apptest/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/apptest/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/apptest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptest/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/apptest/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/apptest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apptest/public/data/cars.csv +0 -429
- package/packages/examples/apptest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apptest/public/data/cmdList.txt +0 -15
- package/packages/examples/apptest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apptest/public/data/iris.csv +0 -151
- package/packages/examples/apptest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apptest/public/design.html +0 -349
- package/packages/examples/apptest/public/favicon.ico +0 -0
- package/packages/examples/apptest/public/help.html +0 -1
- package/packages/examples/apptest/public/index.html +0 -353
- package/packages/examples/apptest/public/index2.html +0 -353
- package/packages/examples/apptest/public/indexProxy.html +0 -346
- package/packages/examples/apptest/public/indextest.html +0 -316
- package/packages/examples/apptest/public/logon.html +0 -44
- package/packages/examples/apptest/public/myapp/q.html +0 -349
- package/packages/examples/apptest/public/myapp/secondary.html +0 -1
- package/packages/examples/apptest/public/myapp/test.js +0 -2
- package/packages/examples/apptest/public/push1.html +0 -187
- package/packages/examples/apptest/startup.sh +0 -15
- package/packages/examples/apptesti/.env +0 -13
- package/packages/examples/apptesti/.eslintrc.json +0 -42
- package/packages/examples/apptesti/Dockerfile +0 -42
- package/packages/examples/apptesti/appenv.js +0 -6
- package/packages/examples/apptesti/certs/ca.crt +0 -19
- package/packages/examples/apptesti/certs/tls.crt +0 -25
- package/packages/examples/apptesti/certs/tls.key +0 -28
- package/packages/examples/apptesti/certs/tls.sh +0 -5
- package/packages/examples/apptesti/docker-compose.yml +0 -12
- package/packages/examples/apptesti/index.js +0 -7
- package/packages/examples/apptesti/package.json +0 -20
- package/packages/examples/apptesti/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/apptesti/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/apptesti/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptesti/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/apptesti/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/apptesti/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptesti/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apptesti/public/data/cars.csv +0 -429
- package/packages/examples/apptesti/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apptesti/public/data/cmdList.txt +0 -15
- package/packages/examples/apptesti/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apptesti/public/data/iris.csv +0 -151
- package/packages/examples/apptesti/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apptesti/public/favicon.ico +0 -0
- package/packages/examples/apptesti/public/index.html +0 -346
- package/packages/examples/apptesti/public/indexProxy.html +0 -346
- package/packages/examples/apptesti/public/indextest.html +0 -316
- package/packages/examples/apptesti/public/logon.html +0 -44
- package/packages/examples/apptesti/public/main.html +0 -346
- package/packages/examples/apptesti/public/myapp/secondary.html +0 -1
- package/packages/examples/apptesti/public/myapp/test.js +0 -2
- package/packages/examples/apptesti/startup.sh +0 -15
- package/packages/examples/basic/.env +0 -10
- package/packages/examples/basic/.eslintrc.json +0 -42
- package/packages/examples/basic/Dockerfile +0 -41
- package/packages/examples/basic/api.js +0 -88
- package/packages/examples/basic/appenv.js +0 -6
- package/packages/examples/basic/docker-compose.yml +0 -10
- package/packages/examples/basic/package.json +0 -19
- package/packages/examples/basic/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/basic/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/basic/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/basic/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/basic/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/basic/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/basic/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/basic/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/basic/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/basic/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/basic/public/data/cars.csv +0 -429
- package/packages/examples/basic/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/basic/public/data/cmdList.txt +0 -15
- package/packages/examples/basic/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/basic/public/data/iris.csv +0 -151
- package/packages/examples/basic/public/data/model1.sas7bdat +0 -0
- package/packages/examples/basic/public/favicon.ico +0 -0
- package/packages/examples/basic/public/index.html +0 -29
- package/packages/examples/basic/public/index2.html +0 -102
- package/packages/examples/basic/public/logon.html +0 -42
- package/packages/examples/basic/public/myapp/secondary.html +0 -1
- package/packages/examples/basic/public/myapp/test.js +0 -2
- package/packages/examples/basic/public/onlogoff.html +0 -53
- package/packages/examples/basic/start.sh +0 -15
- package/packages/examples/proxytest/.env +0 -23
- package/packages/examples/proxytest/.envimpl +0 -11
- package/packages/examples/proxytest/.eslintrc.json +0 -42
- package/packages/examples/proxytest/Dockerfile +0 -42
- package/packages/examples/proxytest/appenv.js +0 -6
- package/packages/examples/proxytest/docker-compose.yml +0 -12
- package/packages/examples/proxytest/index.js +0 -57
- package/packages/examples/proxytest/package.json +0 -18
- package/packages/examples/proxytest/public/data/Cluster_SDOH1.sas +0 -182
- package/packages/examples/proxytest/public/data/Cluster_SDOH6.sas +0 -180
- package/packages/examples/proxytest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/proxytest/public/data/NeuralNetwork_High_med.sas +0 -2409
- package/packages/examples/proxytest/public/data/NeuralNetwork_high_med1.sas +0 -2409
- package/packages/examples/proxytest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/proxytest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/proxytest/public/data/cars.csv +0 -429
- package/packages/examples/proxytest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/proxytest/public/data/cmdList.txt +0 -15
- package/packages/examples/proxytest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/proxytest/public/data/iris.csv +0 -151
- package/packages/examples/proxytest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/proxytest/public/favicon.ico +0 -0
- package/packages/examples/proxytest/public/index.html +0 -357
- package/packages/examples/proxytest/public/index.js +0 -57
- package/packages/examples/proxytest/public/indextest.html +0 -316
- package/packages/examples/proxytest/public/logon.html +0 -44
- package/packages/examples/proxytest/public/main.html +0 -357
- package/packages/examples/proxytest/public/myapp/secondary.html +0 -1
- package/packages/examples/proxytest/public/myapp/test.js +0 -2
- package/packages/examples/proxytest/public/restaf.js +0 -2461
- package/packages/examples/proxytest/public/restaf.min.js +0 -11
- package/packages/examples/proxytest/public/sas/iris.txt +0 -10
- package/packages/examples/proxytest/startup.sh +0 -15
- package/public/casread2.html +0 -321
- package/public/design.html +0 -350
- package/public/display.html +0 -354
- package/public/index2.html +0 -353
- package/public/indextest.html +0 -316
- package/public/logon.html +0 -44
- package/public/myapp/q.html +0 -349
- package/public/myapp/secondary.html +0 -1
- package/public/myapp/test.js +0 -2
- package/public/push1.html +0 -187
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<!--
|
|
3
|
-
~ /* ------------------------------------------------------------------------------------
|
|
4
|
-
~ * Copyright (c) SAS Institute Inc.
|
|
5
|
-
~ * Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
~ * you may not use this file except in compliance with the License.
|
|
7
|
-
~ * You may obtain a copy of the License at
|
|
8
|
-
~ *
|
|
9
|
-
~ * http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
~ *
|
|
11
|
-
~ * Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
~ * distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
~ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
~ * See the License for the specific language governing permissions and
|
|
15
|
-
~ * limitations under the License.
|
|
16
|
-
~ ----------------------------------------------------------------------------------------*/
|
|
17
|
-
~
|
|
18
|
-
-->
|
|
19
|
-
|
|
20
|
-
<html lang="en">
|
|
21
|
-
<head>
|
|
22
|
-
<meta charset="UTF-8" />
|
|
23
|
-
<title>CAS Read Example</title>
|
|
24
|
-
|
|
25
|
-
<script
|
|
26
|
-
crossorigin
|
|
27
|
-
src="https://unpkg.com/react@16/umd/react.production.min.js"
|
|
28
|
-
></script>
|
|
29
|
-
<script
|
|
30
|
-
crossorigin
|
|
31
|
-
src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"
|
|
32
|
-
></script>
|
|
33
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
|
|
34
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
|
|
35
|
-
<script src="https://unpkg.com/@sassoftware/restaf@5.2.4/dist/restaf.js"></script>
|
|
36
|
-
<script src="https://unpkg.com/@sassoftware/restaflib@5.2.4/dist/restaflib.js"></script>
|
|
37
|
-
|
|
38
|
-
<style>
|
|
39
|
-
.container {
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-direction: column;
|
|
42
|
-
flex-wrap: nowrap;
|
|
43
|
-
min-height: 800px;
|
|
44
|
-
}
|
|
45
|
-
.elabel {
|
|
46
|
-
display: inline-block;
|
|
47
|
-
|
|
48
|
-
clear: left;
|
|
49
|
-
width: 250px;
|
|
50
|
-
text-align: right;
|
|
51
|
-
}
|
|
52
|
-
.einput {
|
|
53
|
-
display: inline-block;
|
|
54
|
-
}
|
|
55
|
-
.div1 {
|
|
56
|
-
border: 1px solid black;
|
|
57
|
-
background: lightskyblue;
|
|
58
|
-
}
|
|
59
|
-
.div2 {
|
|
60
|
-
border: 1px solid black;
|
|
61
|
-
background: lightskyblue;
|
|
62
|
-
height: 200px;
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
|
-
|
|
66
|
-
<script>
|
|
67
|
-
debugger;
|
|
68
|
-
let LOGONPAYLOAD = {
|
|
69
|
-
host: "https://viya.kumar-zv1-azure-nginx-84560a6e.unx.sas.com",
|
|
70
|
-
authType: "server",
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
let store = restaf.initStore({ casProxy: true });
|
|
74
|
-
console.log(store.config);
|
|
75
|
-
|
|
76
|
-
let session = null;
|
|
77
|
-
let servers = null;
|
|
78
|
-
let services = null;
|
|
79
|
-
let files = null;
|
|
80
|
-
let reports = null;
|
|
81
|
-
let compute = null;
|
|
82
|
-
|
|
83
|
-
function setup() {
|
|
84
|
-
debugger;
|
|
85
|
-
document.getElementById("output").innerHTML = "...initializing";
|
|
86
|
-
|
|
87
|
-
initSession()
|
|
88
|
-
.then((r) => {
|
|
89
|
-
document.getElementById("output").innerHTML = "ready";
|
|
90
|
-
//keepAlive();
|
|
91
|
-
})
|
|
92
|
-
.catch((e) => {
|
|
93
|
-
console.log(e);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async function initSession() {
|
|
98
|
-
debugger;
|
|
99
|
-
let msg = await store.logon(LOGONPAYLOAD);
|
|
100
|
-
debugger;
|
|
101
|
-
console.log(msg);
|
|
102
|
-
console.log(store.connection());
|
|
103
|
-
console.log(LOGONPAYLOAD);
|
|
104
|
-
|
|
105
|
-
return "done";
|
|
106
|
-
}
|
|
107
|
-
function runit(type) {
|
|
108
|
-
document.getElementById("output").innerHTML = "...running";
|
|
109
|
-
let testcase;
|
|
110
|
-
switch (type) {
|
|
111
|
-
case "files": {
|
|
112
|
-
testcase = SASfileService;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case "compute": {
|
|
116
|
-
testcase = dsCompute;
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
case "cas": {
|
|
120
|
-
testcase = runCas;
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
case "timedout": {
|
|
124
|
-
testcase = timedout;
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
case "redir": {
|
|
128
|
-
testcase = noaction;
|
|
129
|
-
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case "spre": {
|
|
133
|
-
testcase = spre;
|
|
134
|
-
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
default: {
|
|
138
|
-
testcase = SASfileService;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
testcase(store)
|
|
144
|
-
.then((r) => {
|
|
145
|
-
document.getElementById("output").innerHTML = JSON.stringify(
|
|
146
|
-
r,
|
|
147
|
-
null,
|
|
148
|
-
4
|
|
149
|
-
);
|
|
150
|
-
})
|
|
151
|
-
.catch((err) => {
|
|
152
|
-
document.getElementById("output").innerHTML = JSON.stringify(
|
|
153
|
-
err,
|
|
154
|
-
null,
|
|
155
|
-
4
|
|
156
|
-
);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
async function noaction() {
|
|
160
|
-
r = { msg: "redirects completed" };
|
|
161
|
-
return r;
|
|
162
|
-
}
|
|
163
|
-
async function spre(store) {
|
|
164
|
-
let p = {
|
|
165
|
-
method: "GET",
|
|
166
|
-
url: "http://localhost:3000/api/test",
|
|
167
|
-
withCredentials: true,
|
|
168
|
-
};
|
|
169
|
-
let r = await store.request(p);
|
|
170
|
-
return r.data;
|
|
171
|
-
}
|
|
172
|
-
async function timedout(store) {
|
|
173
|
-
console.log("timed out at", Date());
|
|
174
|
-
let params = `scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=0,height=0,left=-1000,top=-1000`;
|
|
175
|
-
window.open(
|
|
176
|
-
`${LOGONPAYLOAD.host}/SASLogon/timedout`,
|
|
177
|
-
"Timed Out",
|
|
178
|
-
params
|
|
179
|
-
);
|
|
180
|
-
return true;
|
|
181
|
-
}
|
|
182
|
-
async function runCas(store) {
|
|
183
|
-
let { casManagement } = await store.addServices("casManagement");
|
|
184
|
-
let servers = await store.apiCall(casManagement.links("servers"));
|
|
185
|
-
let serverName = servers.itemsList(0);
|
|
186
|
-
let session = await store.apiCall(
|
|
187
|
-
servers.itemsCmd(serverName, "createSession")
|
|
188
|
-
);
|
|
189
|
-
let payload = {
|
|
190
|
-
action: "builtins.echo",
|
|
191
|
-
data: { code: { x: 1 } },
|
|
192
|
-
};
|
|
193
|
-
console.log(JSON.stringify(session.links("execute"), null, 4));
|
|
194
|
-
let r = await store.runAction(session, payload);
|
|
195
|
-
console.log("echo completed");
|
|
196
|
-
debugger;
|
|
197
|
-
payload = {
|
|
198
|
-
start: 1,
|
|
199
|
-
limit: 20,
|
|
200
|
-
format: true,
|
|
201
|
-
where: ' ',
|
|
202
|
-
table: { caslib: "Samples", name: "COSTCHANGE" }
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
let actionPayload = {
|
|
206
|
-
action: "table.fetch",
|
|
207
|
-
data: { table: { caslib: "Samples", name: "COSTCHANGE" } },
|
|
208
|
-
};
|
|
209
|
-
debugger;
|
|
210
|
-
/*
|
|
211
|
-
let actionResult = await store.runAction(session, actionPayload);
|
|
212
|
-
console.log("------------------ results from fetch");
|
|
213
|
-
|
|
214
|
-
console.log(JSON.stringify(actionResult.items("tables"), null, 4));
|
|
215
|
-
console.log(JSON.stringify(actionResult.items("tableNames"), null, 4));
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
let r2 = await restaflib.casFetchData(store, session, payload);
|
|
219
|
-
return r2;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
async function SASfileService(store) {
|
|
223
|
-
debugger;
|
|
224
|
-
try {
|
|
225
|
-
debugger;
|
|
226
|
-
let { files } = await store.addServices("files");
|
|
227
|
-
debugger;
|
|
228
|
-
console.log(JSON.stringify(files.links(), null, 4));
|
|
229
|
-
console.log("items - should be an array of files(empty array is ok)");
|
|
230
|
-
console.log(files.items().toJS());
|
|
231
|
-
let payload = {
|
|
232
|
-
data: { x: 1, y: "This was saved earlier in the step" },
|
|
233
|
-
headers: { "content-type": "application/json" },
|
|
234
|
-
};
|
|
235
|
-
let createCmd = files.links("create");
|
|
236
|
-
let newFile = await store.apiCall(createCmd, payload);
|
|
237
|
-
|
|
238
|
-
let content = await store.apiCall(newFile.links("content"));
|
|
239
|
-
} catch (err) {
|
|
240
|
-
console.log(err);
|
|
241
|
-
debugger;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return content.items();
|
|
245
|
-
}
|
|
246
|
-
async function dsCompute(store) {
|
|
247
|
-
let log = null;
|
|
248
|
-
debugger;
|
|
249
|
-
let { compute } = await store.addServices("compute");
|
|
250
|
-
let servers = await store.apiCall(compute.links("servers"));
|
|
251
|
-
|
|
252
|
-
let contexts = await store.apiCall(compute.links("contexts"));
|
|
253
|
-
|
|
254
|
-
// lookup the name of the first context and then use it to get the associated createSession restafLink
|
|
255
|
-
let createSession = contexts.itemsCmd(
|
|
256
|
-
contexts.itemsList(0),
|
|
257
|
-
"createSession"
|
|
258
|
-
);
|
|
259
|
-
let session = await store.apiCall(createSession);
|
|
260
|
-
|
|
261
|
-
// Now run a simple data step in that session
|
|
262
|
-
let payload = {
|
|
263
|
-
data: {
|
|
264
|
-
code: [`data _null_; do i = 1 to 100; x=1; end; run; `],
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// Now execute the data step and wait for completion
|
|
269
|
-
let job = await store.apiCall(session.links("execute"), payload);
|
|
270
|
-
let status = await store.jobState(job, null, 5, 2);
|
|
271
|
-
|
|
272
|
-
if (status.data === "running") {
|
|
273
|
-
throw `ERROR: Job did not complete in allotted time`;
|
|
274
|
-
} else {
|
|
275
|
-
switch (status.data) {
|
|
276
|
-
case "warning":
|
|
277
|
-
console.log(`Warning: check your log for warnings`);
|
|
278
|
-
break;
|
|
279
|
-
case "error":
|
|
280
|
-
throw `Please correct errors and rerun program`;
|
|
281
|
-
default:
|
|
282
|
-
log = await store.apiCall(status.job.links("log"));
|
|
283
|
-
break;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
return log === null ? status : log.items();
|
|
287
|
-
}
|
|
288
|
-
</script>
|
|
289
|
-
</head>
|
|
290
|
-
<body onload="setup()">
|
|
291
|
-
<h1 id="head">Hi</h1>
|
|
292
|
-
<div>
|
|
293
|
-
<button onclick="runit('redir')">Press to do some redirs</button>
|
|
294
|
-
<button onclick="runit('files')">
|
|
295
|
-
Press to make a call to file service
|
|
296
|
-
</button>
|
|
297
|
-
<br />
|
|
298
|
-
<br />
|
|
299
|
-
<button onclick="runit('compute')">
|
|
300
|
-
Press to make a call compute service
|
|
301
|
-
</button>
|
|
302
|
-
<br />
|
|
303
|
-
<br />
|
|
304
|
-
<button onclick="runit('cas')">Press to make a call to cas echo</button>
|
|
305
|
-
<br />
|
|
306
|
-
<br />
|
|
307
|
-
<button onclick="runit('spre')">REST call</button>
|
|
308
|
-
<br />
|
|
309
|
-
<br />
|
|
310
|
-
<input id="filename" />
|
|
311
|
-
<button onclick="runit('timedout')">Press to test timedout</button>
|
|
312
|
-
<br />
|
|
313
|
-
<br />
|
|
314
|
-
<button onclick="logoff()">logoff</button>
|
|
315
|
-
<br />
|
|
316
|
-
</div>
|
|
317
|
-
<div>
|
|
318
|
-
<pre id="output"></pre>
|
|
319
|
-
</div>
|
|
320
|
-
</body>
|
|
321
|
-
</html>
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/*--------------------------------------------------
|
|
2
|
-
The options statement below should be placed
|
|
3
|
-
before the data step when submitting this code.
|
|
4
|
-
--------------------------------------------------*/
|
|
5
|
-
/*options VALIDMEMNAME=EXTEND VALIDVARNAME=ANY;*/
|
|
6
|
-
/*------------------------------------------
|
|
7
|
-
Generated SAS Scoring Code
|
|
8
|
-
Date : 02Jul2019:21:19:56
|
|
9
|
-
Locale : en_US
|
|
10
|
-
Model Type : Cluster
|
|
11
|
-
Interval variable: SDOH_PMU(SDOH1 Physically Mentally Unhealthy)
|
|
12
|
-
Interval variable: SDOH_Per_Adults_Bachelors(SDOH2 Education)
|
|
13
|
-
Interval variable: SDOH_Unemployment_Rate(SDOH4 Unemployment Rate)
|
|
14
|
-
Interval variable: SDOH_Median_Household_Income(SDOH3 Median Household Income)
|
|
15
|
-
------------------------------------------*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
length _WARN_ $4;
|
|
19
|
-
label _WARN_ = 'Warnings';
|
|
20
|
-
label _CLUSTER_ID_ = 'Cluster ID';
|
|
21
|
-
label _DISTANCE_ = 'Distance to Centroid';
|
|
22
|
-
|
|
23
|
-
_i_ = 0;
|
|
24
|
-
_j_ = 0;
|
|
25
|
-
_k_ = 0;
|
|
26
|
-
_l_ = 0;
|
|
27
|
-
_dist_ = 0;
|
|
28
|
-
_minDist_ = 0;
|
|
29
|
-
_found_ = 0;
|
|
30
|
-
_unknown_ = 0;
|
|
31
|
-
_unknownflag_ = 0;
|
|
32
|
-
_intMindist2cntr_ = 0;
|
|
33
|
-
_missingflag4Int_ = 0;
|
|
34
|
-
_numberOfIntVars_ = 4;
|
|
35
|
-
_minDistInt_ = 0;
|
|
36
|
-
label _STANDARDIZED_DISTANCE_ = 'Standardized Distance to Centroid';
|
|
37
|
-
|
|
38
|
-
drop _i_;
|
|
39
|
-
drop _j_;
|
|
40
|
-
drop _k_;
|
|
41
|
-
drop _l_;
|
|
42
|
-
drop _dist_;
|
|
43
|
-
drop _minDist_;
|
|
44
|
-
drop _minDistInt_;
|
|
45
|
-
drop _unknown_;
|
|
46
|
-
drop _unknownflag_;
|
|
47
|
-
drop _found_;
|
|
48
|
-
drop _intMindist2cntr_;
|
|
49
|
-
drop _missingflag4Int_;
|
|
50
|
-
drop _numberOfIntVars_;
|
|
51
|
-
drop _minDistInt_;
|
|
52
|
-
|
|
53
|
-
array _intVals_67{4} _temporary_;
|
|
54
|
-
array _intStdVals_67{4} _temporary_;
|
|
55
|
-
array _intVars_67[4] _temporary_;
|
|
56
|
-
_intVars_67[1] =
|
|
57
|
-
SDOH_PMU;
|
|
58
|
-
_intVars_67[2] =
|
|
59
|
-
SDOH_Per_Adults_Bachelors;
|
|
60
|
-
_intVars_67[3] =
|
|
61
|
-
SDOH_Unemployment_Rate;
|
|
62
|
-
_intVars_67[4] =
|
|
63
|
-
SDOH_Median_Household_Income;
|
|
64
|
-
array _cntrcoordsInt_67{4,4} _temporary_ (
|
|
65
|
-
5.6752109618776
|
|
66
|
-
34.574068577069
|
|
67
|
-
5.5249572649573
|
|
68
|
-
65162.262238794
|
|
69
|
-
6.1728412355737
|
|
70
|
-
28.076500921419
|
|
71
|
-
8.4815044247788
|
|
72
|
-
50250.811599193
|
|
73
|
-
5.5563377592335
|
|
74
|
-
27.69585347275
|
|
75
|
-
3.586724137931
|
|
76
|
-
55456.199169472
|
|
77
|
-
7.1425816544567
|
|
78
|
-
23.193113163492
|
|
79
|
-
5.9483653846154
|
|
80
|
-
45013.481439879
|
|
81
|
-
);
|
|
82
|
-
array _stdcntrcoordsInt_67 {4,4} _temporary_ (
|
|
83
|
-
-0.545947986801
|
|
84
|
-
1.2465170251288
|
|
85
|
-
-0.140043320021
|
|
86
|
-
1.2424484776721
|
|
87
|
-
0.080847377302
|
|
88
|
-
-0.09555849286
|
|
89
|
-
1.0754374093924
|
|
90
|
-
-0.456774851619
|
|
91
|
-
-0.695675960102
|
|
92
|
-
-0.17418139437
|
|
93
|
-
-0.936879929639
|
|
94
|
-
0.1364012391051
|
|
95
|
-
1.3022939633885
|
|
96
|
-
-1.104224427884
|
|
97
|
-
0.0340260867236
|
|
98
|
-
-1.053590936451
|
|
99
|
-
);
|
|
100
|
-
array _stdscaleInt_67 {4} _temporary_ (
|
|
101
|
-
0.7939278147152
|
|
102
|
-
4.8414322208822
|
|
103
|
-
2.4324097357342
|
|
104
|
-
8775.4507500947
|
|
105
|
-
);
|
|
106
|
-
array _stdcenterInt_67 {4} _temporary_ (
|
|
107
|
-
6.1086542539869
|
|
108
|
-
28.539140887732
|
|
109
|
-
5.8656
|
|
110
|
-
54259.216813453
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
*************** check missing interval value ******************;
|
|
114
|
-
_missingflag4Int_ = 0;
|
|
115
|
-
do _i_ = 1 to _numberOfIntVars_ until(_missingflag4Int_);
|
|
116
|
-
if missing( _intVars_67[_i_] ) then
|
|
117
|
-
_missingflag4Int_ = 1;
|
|
118
|
-
end;
|
|
119
|
-
|
|
120
|
-
if (_missingflag4Int_ = 1) then
|
|
121
|
-
substr(_WARN_, 1, 1) = 'M';
|
|
122
|
-
********** prepare interval variable values *********;
|
|
123
|
-
do _i_ = 1 to _numberOfIntVars_;
|
|
124
|
-
if missing (_intVars_67[_i_] ) then do;
|
|
125
|
-
_intVals_67[_i_] = .;
|
|
126
|
-
_intStdVals_67[_i_] = .;
|
|
127
|
-
end; else do;
|
|
128
|
-
if missing (_stdscaleInt_67[_i_] ) then do;
|
|
129
|
-
_intStdVals_67[_i_] = ( _intVars_67[_i_] - _stdcenterInt_67[_i_]);
|
|
130
|
-
end; else do;
|
|
131
|
-
_intStdVals_67[_i_] = ( _intVars_67[_i_] - _stdcenterInt_67[_i_])
|
|
132
|
-
/ _stdscaleInt_67[_i_];
|
|
133
|
-
end;
|
|
134
|
-
_intVals_67[_i_] = _intVars_67[_i_];
|
|
135
|
-
end;
|
|
136
|
-
end;
|
|
137
|
-
****************** find the closest cluster ******************;
|
|
138
|
-
if _missingflag4Int_ > 0 then
|
|
139
|
-
do;
|
|
140
|
-
_CLUSTER_ID_ = .;
|
|
141
|
-
_DISTANCE_ = .;
|
|
142
|
-
_minDistInt_ = .;
|
|
143
|
-
_STANDARDIZED_DISTANCE_ = .;
|
|
144
|
-
end;
|
|
145
|
-
else
|
|
146
|
-
do;
|
|
147
|
-
_CLUSTER_ID_ = .;
|
|
148
|
-
_minDist_ = 8.988465674E307;
|
|
149
|
-
do _i_=1 to 4;
|
|
150
|
-
_intMindist2cntr_ = 0;
|
|
151
|
-
do _j_=1 to 4;
|
|
152
|
-
_dist_ = _intStdVals_67{_j_} - _stdcntrcoordsInt_67{_i_,_j_};
|
|
153
|
-
_dist_ = _dist_ ** 2;
|
|
154
|
-
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
155
|
-
end;
|
|
156
|
-
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
157
|
-
if( _minDist_ > _intMindist2cntr_) then do;
|
|
158
|
-
_CLUSTER_ID_ = _i_;
|
|
159
|
-
_minDist_ = _intMindist2cntr_;
|
|
160
|
-
end;
|
|
161
|
-
_STANDARDIZED_DISTANCE_ = _minDist_;
|
|
162
|
-
end;
|
|
163
|
-
_DISTANCE_ = 8.988465674E307;
|
|
164
|
-
_i_ = _CLUSTER_ID_;
|
|
165
|
-
_intMindist2cntr_ = 0;
|
|
166
|
-
do _j_=1 to 4;
|
|
167
|
-
_dist_ = _intVals_67{_j_} - _cntrcoordsInt_67{_i_,_j_};
|
|
168
|
-
_dist_ = _dist_ ** 2;
|
|
169
|
-
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
170
|
-
end;
|
|
171
|
-
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
172
|
-
_DISTANCE_ = _intMindist2cntr_;
|
|
173
|
-
end;
|
|
174
|
-
|
|
175
|
-
if (MISSING('_CLUSTER_ID_'n))then _CLUSTER_ID_ = -1; /*------------------------------------------*/
|
|
176
|
-
drop '_CLUSTER_ID_'n '_DISTANCE_'n '_WARN_'n '_STANDARDIZED_DISTANCE_'n;
|
|
177
|
-
'_CLUSTER_ID__67'n='_CLUSTER_ID_'n;
|
|
178
|
-
'_DISTANCE__67'n='_DISTANCE_'n;
|
|
179
|
-
'_WARN__67'n='_WARN_'n;
|
|
180
|
-
'_STANDARDIZED_DISTANCE__67'n='_STANDARDIZED_DISTANCE_'n;
|
|
181
|
-
/*------------------------------------------*/
|
|
182
|
-
run;
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
/*--------------------------------------------------
|
|
2
|
-
The options statement below should be placed
|
|
3
|
-
before the data step when submitting this code.
|
|
4
|
-
--------------------------------------------------*/
|
|
5
|
-
/*options VALIDMEMNAME=EXTEND VALIDVARNAME=ANY;*/
|
|
6
|
-
/*------------------------------------------
|
|
7
|
-
Generated SAS Scoring Code
|
|
8
|
-
Date : 30Jul2019:20:16:16
|
|
9
|
-
Locale : en_US
|
|
10
|
-
Model Type : Cluster
|
|
11
|
-
Interval variable: SDOH_Physically_Unhealthy_Days_(SDOH6 Physically Unhealthy Days)
|
|
12
|
-
Interval variable: SDOH_Per_Adults_Bachelors(SDOH2 Education1)
|
|
13
|
-
Interval variable: SDOH_Unemployment_Rate(SDOH3 Unemployment Rate)
|
|
14
|
-
Interval variable: SDOH_Median_Household_Income(SDOH4 Median Household Income)
|
|
15
|
-
------------------------------------------*/
|
|
16
|
-
|
|
17
|
-
length _WARN_ $4;
|
|
18
|
-
label _WARN_ = 'Warnings';
|
|
19
|
-
label _CLUSTER_ID_ = 'Cluster ID';
|
|
20
|
-
label _DISTANCE_ = 'Distance to Centroid';
|
|
21
|
-
|
|
22
|
-
_i_ = 0;
|
|
23
|
-
_j_ = 0;
|
|
24
|
-
_k_ = 0;
|
|
25
|
-
_l_ = 0;
|
|
26
|
-
_dist_ = 0;
|
|
27
|
-
_minDist_ = 0;
|
|
28
|
-
_found_ = 0;
|
|
29
|
-
_unknown_ = 0;
|
|
30
|
-
_unknownflag_ = 0;
|
|
31
|
-
_intMindist2cntr_ = 0;
|
|
32
|
-
_missingflag4Int_ = 0;
|
|
33
|
-
_numberOfIntVars_ = 4;
|
|
34
|
-
_minDistInt_ = 0;
|
|
35
|
-
label _STANDARDIZED_DISTANCE_ = 'Standardized Distance to Centroid';
|
|
36
|
-
|
|
37
|
-
drop _i_;
|
|
38
|
-
drop _j_;
|
|
39
|
-
drop _k_;
|
|
40
|
-
drop _l_;
|
|
41
|
-
drop _dist_;
|
|
42
|
-
drop _minDist_;
|
|
43
|
-
drop _minDistInt_;
|
|
44
|
-
drop _unknown_;
|
|
45
|
-
drop _unknownflag_;
|
|
46
|
-
drop _found_;
|
|
47
|
-
drop _intMindist2cntr_;
|
|
48
|
-
drop _missingflag4Int_;
|
|
49
|
-
drop _numberOfIntVars_;
|
|
50
|
-
drop _minDistInt_;
|
|
51
|
-
|
|
52
|
-
array _intVals_439{4} _temporary_;
|
|
53
|
-
array _intStdVals_439{4} _temporary_;
|
|
54
|
-
array _intVars_439[4] _temporary_;
|
|
55
|
-
_intVars_439[1] =
|
|
56
|
-
SDOH_Physically_Unhealthy_Days_;
|
|
57
|
-
_intVars_439[2] =
|
|
58
|
-
SDOH_Per_Adults_Bachelors;
|
|
59
|
-
_intVars_439[3] =
|
|
60
|
-
SDOH_Unemployment_Rate;
|
|
61
|
-
_intVars_439[4] =
|
|
62
|
-
SDOH_Median_Household_Income;
|
|
63
|
-
array _cntrcoordsInt_439{4,4} _temporary_ (
|
|
64
|
-
3.0267344264664
|
|
65
|
-
40.73654855643
|
|
66
|
-
4.5016404199475
|
|
67
|
-
73253.345144357
|
|
68
|
-
3.1748155867421
|
|
69
|
-
23.482869339272
|
|
70
|
-
4.4175018559762
|
|
71
|
-
52859.890126206
|
|
72
|
-
5.0717963953358
|
|
73
|
-
13.894727354664
|
|
74
|
-
9.3289319513294
|
|
75
|
-
35934.982875169
|
|
76
|
-
4.17723170653
|
|
77
|
-
17.079836808704
|
|
78
|
-
6.0463463281958
|
|
79
|
-
42933.089573889
|
|
80
|
-
);
|
|
81
|
-
array _stdcntrcoordsInt_439 {4,4} _temporary_ (
|
|
82
|
-
-0.819627593948
|
|
83
|
-
2.1063188660484
|
|
84
|
-
-0.557938370531
|
|
85
|
-
1.9606280602175
|
|
86
|
-
-0.667309695546
|
|
87
|
-
0.2473923533712
|
|
88
|
-
-0.59384668401
|
|
89
|
-
0.3473109632455
|
|
90
|
-
1.2839454778829
|
|
91
|
-
-0.785642463039
|
|
92
|
-
1.5022334387125
|
|
93
|
-
-0.991610872631
|
|
94
|
-
0.363786470954
|
|
95
|
-
-0.442475980379
|
|
96
|
-
0.1013049225367
|
|
97
|
-
-0.437993784529
|
|
98
|
-
);
|
|
99
|
-
array _stdscaleInt_439 {4} _temporary_ (
|
|
100
|
-
0.9721848963817
|
|
101
|
-
9.2815283979727
|
|
102
|
-
2.3431499789112
|
|
103
|
-
12640.698506466
|
|
104
|
-
);
|
|
105
|
-
array _stdcenterInt_439 {4} _temporary_ (
|
|
106
|
-
3.8235639939605
|
|
107
|
-
21.186690186017
|
|
108
|
-
5.8089737010904
|
|
109
|
-
48469.63695183
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
*************** check missing interval value ******************;
|
|
113
|
-
_missingflag4Int_ = 0;
|
|
114
|
-
do _i_ = 1 to _numberOfIntVars_ until(_missingflag4Int_);
|
|
115
|
-
if missing( _intVars_439[_i_] ) then
|
|
116
|
-
_missingflag4Int_ = 1;
|
|
117
|
-
end;
|
|
118
|
-
|
|
119
|
-
if (_missingflag4Int_ = 1) then
|
|
120
|
-
substr(_WARN_, 1, 1) = 'M';
|
|
121
|
-
********** prepare interval variable values *********;
|
|
122
|
-
do _i_ = 1 to _numberOfIntVars_;
|
|
123
|
-
if missing (_intVars_439[_i_] ) then do;
|
|
124
|
-
_intVals_439[_i_] = .;
|
|
125
|
-
_intStdVals_439[_i_] = .;
|
|
126
|
-
end; else do;
|
|
127
|
-
if missing (_stdscaleInt_439[_i_] ) then do;
|
|
128
|
-
_intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_]);
|
|
129
|
-
end; else do;
|
|
130
|
-
_intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_])
|
|
131
|
-
/ _stdscaleInt_439[_i_];
|
|
132
|
-
end;
|
|
133
|
-
_intVals_439[_i_] = _intVars_439[_i_];
|
|
134
|
-
end;
|
|
135
|
-
end;
|
|
136
|
-
****************** find the closest cluster ******************;
|
|
137
|
-
if _missingflag4Int_ > 0 then
|
|
138
|
-
do;
|
|
139
|
-
_CLUSTER_ID_ = .;
|
|
140
|
-
_DISTANCE_ = .;
|
|
141
|
-
_minDistInt_ = .;
|
|
142
|
-
_STANDARDIZED_DISTANCE_ = .;
|
|
143
|
-
end;
|
|
144
|
-
else
|
|
145
|
-
do;
|
|
146
|
-
_CLUSTER_ID_ = .;
|
|
147
|
-
_minDist_ = 8.988465674E307;
|
|
148
|
-
do _i_=1 to 4;
|
|
149
|
-
_intMindist2cntr_ = 0;
|
|
150
|
-
do _j_=1 to 4;
|
|
151
|
-
_dist_ = _intStdVals_439{_j_} - _stdcntrcoordsInt_439{_i_,_j_};
|
|
152
|
-
_dist_ = _dist_ ** 2;
|
|
153
|
-
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
154
|
-
end;
|
|
155
|
-
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
156
|
-
if( _minDist_ > _intMindist2cntr_) then do;
|
|
157
|
-
_CLUSTER_ID_ = _i_;
|
|
158
|
-
_minDist_ = _intMindist2cntr_;
|
|
159
|
-
end;
|
|
160
|
-
_STANDARDIZED_DISTANCE_ = _minDist_;
|
|
161
|
-
end;
|
|
162
|
-
_DISTANCE_ = 8.988465674E307;
|
|
163
|
-
_i_ = _CLUSTER_ID_;
|
|
164
|
-
_intMindist2cntr_ = 0;
|
|
165
|
-
do _j_=1 to 4;
|
|
166
|
-
_dist_ = _intVals_439{_j_} - _cntrcoordsInt_439{_i_,_j_};
|
|
167
|
-
_dist_ = _dist_ ** 2;
|
|
168
|
-
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
169
|
-
end;
|
|
170
|
-
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
171
|
-
_DISTANCE_ = _intMindist2cntr_;
|
|
172
|
-
end;
|
|
173
|
-
|
|
174
|
-
if (MISSING('_CLUSTER_ID_'n))then _CLUSTER_ID_ = -1; /*------------------------------------------*/
|
|
175
|
-
drop '_CLUSTER_ID_'n '_DISTANCE_'n '_WARN_'n '_STANDARDIZED_DISTANCE_'n;
|
|
176
|
-
'_CLUSTER_ID__439'n='_CLUSTER_ID_'n;
|
|
177
|
-
'_DISTANCE__439'n='_DISTANCE_'n;
|
|
178
|
-
'_WARN__439'n='_WARN_'n;
|
|
179
|
-
'_STANDARDIZED_DISTANCE__439'n='_STANDARDIZED_DISTANCE_'n;
|
|
180
|
-
/*------------------------------------------*/
|
|
Binary file
|