From 0dd79cfb86ad78faa54febff9af1eae1c6d6de6f Mon Sep 17 00:00:00 2001
From: Caughlin Bohn <computerwhisperer21@gmail.com>
Date: Fri, 11 Dec 2020 15:07:09 -0600
Subject: [PATCH] Sas on clusters

---
 .../applications/app_specific/running_sas.md  | 145 ++++++++++++++++++
 1 file changed, 145 insertions(+)
 create mode 100644 content/applications/app_specific/running_sas.md

diff --git a/content/applications/app_specific/running_sas.md b/content/applications/app_specific/running_sas.md
new file mode 100644
index 00000000..2520b590
--- /dev/null
+++ b/content/applications/app_specific/running_sas.md
@@ -0,0 +1,145 @@
++++
+title = "Running SAS at HCC"
+description = "How to run SAS on HCC resources."
++++
+
+
+- [Running SAS through the command line](#connecting-to-jupyterhub)
+- [Running SAS on JupyterHub](#connecting-to-jupyterhub)
+- [Running SAS on Anvil](#connecting-to-jupyterhub)
+
+This quick start demonstrates how to implement a SAS program on
+HCC supercomputers through the command line and JupyterHub, and on HCC's Anvil platform. The sample code and submit scripts can be
+downloaded from [HCC's job-examples git repository](https://github.com/unlhcc/job-examples).
+
+## SAS on HCC Clusters
+SAS applications can be ran on HCC clusters similar to other jobs.
+[Connect to a HCC cluster]({{< relref "../../connecting/" >}}) and make a subdirectory 
+called `sas_demo` under your `$WORK` directory. 
+
+In the subdirectory `sas_demo`, save the sas code. Here we include a single demo
+programs, `t_test.sas`, to perform a t test analysis on a small data set. 
+
+{{%expand "t-test.sas" %}}
+{{< highlight sas >}}
+* load the dataset;
+data pulse;
+ input pre post;
+datalines;
+ 62 61
+ 63 62
+ 58 59
+ 64 61
+ 64 63
+ 61 58
+ 68 61
+ 66 64
+ 65 62
+ 67 68
+ 69 65
+ 61 67
+ 64 65
+ 61 63
+ 63 62
+;
+
+* it is always a good idea to print out the dataset;
+proc print;
+run;
+
+* perform the analysis using PROC TTEST;
+proc ttest;
+  paired pre*post; * tells sas to compute the test for the paired differences;
+run;
+{{< /highlight >}}
+{{% /expand %}}
+
+
+
+---
+
+#### Creating a Submit Script
+
+Create a submit script to request one core (default) and 10-min run time
+on the supercomputer. The name of the main program enters at the last
+line.
+
+{{% panel header="`sas.submit`"%}}
+{{< highlight bash >}}
+#!/bin/bash
+#SBATCH --nodes=1
+#SBATCH --ntasks-per-node=1
+#SBATCH --mem=1gb
+#SBATCH --time=00:10:00
+#SBATCH --job-name=sas_example
+#SBATCH --error=sas_example.%J.err
+#SBATCH --output=sas_example.%J.out
+
+module load sas/9.4
+
+sas t-test.sas
+{{< /highlight >}}
+{{% /panel %}}
+
+#### Submit the Job
+
+The job can be submitted through the command `sbatch`. The job status
+can be monitored by entering `squeue` with the `-u` option.
+
+{{< highlight bash >}}
+$ sbatch sas.submit
+$ squeue -u <username>
+{{< /highlight >}}
+
+Replace `<username>` with your HCC username.
+
+#### Sample Output
+
+The results of the t-test are computed and printed to the `.lst` file (see
+below). 
+{{%expand "t-test.lst" %}}
+{{< highlight batchfile>}}
+The SAS System                       
+
+                                                         Obs    pre    post
+
+                                                           1     62     61
+                                                           2     63     62
+                                                           3     58     59
+                                                           4     64     61
+                                                           5     64     63
+                                                           6     61     58
+                                                           7     68     61
+                                                           8     66     64
+                                                           9     65     62
+                                                          10     67     68
+                                                          11     69     65
+                                                          12     61     67
+                                                          13     64     65
+                                                          14     61     63
+                                                          15     63     62
+
+                                                           The SAS System                       
+
+                                                        The TTEST Procedure
+
+                                                      Difference:  pre - post
+
+                                    N        Mean     Std Dev     Std Err     Minimum     Maximum
+
+                                   15      1.0000      3.0237      0.7807     -6.0000      7.0000
+
+                                       Mean       95% CL Mean        Std Dev      95% CL Std Dev
+
+                                     1.0000     -0.6745   2.6745      3.0237      2.2137   4.7687
+
+                                                       DF    t Value    Pr > |t|
+
+                                                       14       1.28      0.2211
+{{< /highlight >}}
+{{% /expand %}}
+
+## SAS on JupyterHub
+
+
+## SAS on Anvil
\ No newline at end of file
-- 
GitLab