The data used for regressions is based on the 'cars' table from the internal SASHELP library. This table is loaded into each remote session to a CAS table ('casuser.cars') before being used by the CAS regression actions.
1 Code Block
SAS/CONNECT
Explanation : This block establishes two distinct SAS/CONNECT sessions, 'session1' and 'session2'. Each 'signon' initiates a remote SAS process, allowing code execution in parallel or in a distributed manner. The 'sascmd' option specifies the command to execute to start the remote SAS process.
Explanation : This block asynchronously submits code to 'session1' (WAIT=NO). It configures CAS options for the remote session, establishes a connection to the specified CAS controller with an extended timeout, makes all caslibs available, and then uses a DATA STEP to load the 'cars' table from SASHELP into a new CAS table named 'cars' within the 'casuser' caslib. This table will be the source for CAS analyses.
Copied!
rsubmit session1 wait=no;
options casdatalimit=10G;
options compress=yes;
cas host="19w47mpp-2.gtp-americas.sashq-d.openstack.sas.com"
port=5570
sessopts=(TIMEOUT=99,DQLOCALE=ENUSA);
caslib _all_ assign;
data casuser.cars;
set sashelp.cars;
run;
1
rsubmit session1 wait=no;
2
options casdatalimit=10G;
3
options compress=yes;
4
5
cas host="19w47mpp-2.gtp-americas.sashq-d.openstack.sas.com"
6
port=5570
7
sessopts=(TIMEOUT=99,DQLOCALE=ENUSA);
8
9
caslib _all_ assign;
10
11
DATA casuser.cars;
12
SET sashelp.cars;
13
RUN;
3 Code Block
PROC CAS Data
Explanation : In 'session1', this block executes a 'simple.regression' action via PROC CAS. It specifies 'mpg_highway' as the target variable and 'weight' as the input variable, with an alpha significance level of 0.05 and a polynomial order of 3. The regression results are saved in a CAS table 'reg1', and specific variables from these results are retrieved for later analysis via the 'table.fetch' action.
Explanation : This block, asynchronously submitted to 'session2', is similar to the corresponding block in 'session1'. It configures CAS options, connects to the same CAS controller, makes caslibs available, and loads the 'cars' table from SASHELP to a CAS table 'casuser.cars'. This allows 'session2' to operate independently and in parallel for its own CAS analyses.
Copied!
rsubmit session2 wait=no;
options casdatalimit=10G;
options compress=yes;
cas host="19w47mpp-2.gtp-americas.sashq-d.openstack.sas.com"
port=5570
sessopts=(TIMEOUT=99,DQLOCALE=ENUSA);
caslib _all_ assign;
data casuser.cars;
set sashelp.cars;
run;
1
rsubmit session2 wait=no;
2
options casdatalimit=10G;
3
options compress=yes;
4
5
cas host="19w47mpp-2.gtp-americas.sashq-d.openstack.sas.com"
6
port=5570
7
sessopts=(TIMEOUT=99,DQLOCALE=ENUSA);
8
9
caslib _all_ assign;
10
11
DATA casuser.cars;
12
SET sashelp.cars;
13
RUN;
5 Code Block
PROC CAS Data
Explanation : In 'session2', this block also executes a 'simple.regression' action via PROC CAS on 'casuser.cars', but with different parameters: an alpha level of 0.15 and a polynomial order of 2. The results are saved in a CAS table 'reg2', and the same key variables are retrieved as in 'session1' to allow comparison or analysis of the different regression models.
Explanation : This final block manages the synchronization and closing of SAS/CONNECT sessions. The 'waitfor _all_ session1 session2;' statement blocks the main program's execution until both remote sessions have completed their tasks. 'rget' is then used to retrieve the logs and results (if any) from each session. Finally, 'signoff' disconnects and properly terminates the SAS/CONNECT sessions.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.