From 416922de21edd08151dcf41a720c58ff4359efc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Thu, 4 Dec 2025 16:59:42 +0000 Subject: [PATCH 01/34] initial commit of proc_r embedded lang test --- server/test/embedded_lang/embedded_lang.test.ts | 16 ++++++++++++++++ server/testFixture/embedded_lang/proc_rlang.sas | 8 ++++++++ 2 files changed, 24 insertions(+) create mode 100644 server/testFixture/embedded_lang/proc_rlang.sas diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index b8c1b3ed7..9fcf14873 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -64,4 +64,20 @@ describe("Test code zone for embedded language", () => { assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); }); + + it("proc rlang", () => { + const doc = openDoc("server/testFixture/embedded_lang/proc_r.sas"); + const languageServer = new LanguageServiceProvider(doc); + const codeZoneManager = languageServer.getCodeZoneManager(); + + const zoneList = []; + for (let i = 0; i < doc.lineCount; i++) { + zoneList.push(codeZoneManager.getCurrentZone(i, 1)); + } + + assert.equal(zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT); + assert.equal(zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); + }); }); diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas new file mode 100644 index 000000000..29462e8b2 --- /dev/null +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -0,0 +1,8 @@ +proc rlang; + submit; + for (x in 1:6) { + print(x) + } + print("first statement after for loop") + endsubmit; +run; From 74a5d313b26664676679882063e72355c1b71bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:50:13 +0000 Subject: [PATCH 02/34] adding R language options to client and notebook --- client/package-lock.json | 3 +++ .../src/components/ContentNavigator/convert.ts | 4 +++- client/src/components/notebook/Controller.ts | 2 +- .../src/components/notebook/exporters/toHTML.ts | 2 ++ .../src/components/notebook/exporters/toSAS.ts | 8 ++++++++ client/src/components/utils/SASCodeDocument.ts | 12 ++++++++++++ package-lock.json | 17 +++++++++++++++-- package.json | 3 ++- 8 files changed, 46 insertions(+), 5 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 8dc506818..60a83aeb9 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -47,6 +47,7 @@ "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -865,6 +866,7 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -874,6 +876,7 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", "license": "MIT", + "peer": true, "dependencies": { "scheduler": "^0.27.0" }, diff --git a/client/src/components/ContentNavigator/convert.ts b/client/src/components/ContentNavigator/convert.ts index 4a8783e2a..80a03568e 100644 --- a/client/src/components/ContentNavigator/convert.ts +++ b/client/src/components/ContentNavigator/convert.ts @@ -20,12 +20,14 @@ const stepRef: Record = { sas: "a7190700-f59c-4a94-afe2-214ce639fcde", sql: "a7190700-f59c-4a94-afe2-214ce639fcde", python: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", + rlang: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", }; const stepTitle: Record = { sas: l10n.t("SAS Program"), sql: l10n.t("SQL Program"), python: l10n.t("Python Program"), + rlang: l10n.t("R Program"), }; const NODE_SPACING = 150; @@ -305,7 +307,7 @@ function generateCodeListFromSASNotebook(content: string): Entry[] { let code = cell.value; if (code !== "") { const language = cell.language; - if (["python", "sas", "sql"].includes(language)) { + if (["python", "sas", "sql", "rlang"].includes(language)) { if (language === "sql") { code = `PROC SQL; ${code}; diff --git a/client/src/components/notebook/Controller.ts b/client/src/components/notebook/Controller.ts index c23bab5b7..01c1cfa1d 100644 --- a/client/src/components/notebook/Controller.ts +++ b/client/src/components/notebook/Controller.ts @@ -11,7 +11,7 @@ export class NotebookController { readonly controllerId = "sas-notebook-controller-id"; readonly notebookType = "sas-notebook"; readonly label = "SAS Notebook"; - readonly supportedLanguages = ["sas", "sql", "python"]; + readonly supportedLanguages = ["sas", "sql", "python", "rlang"]; private readonly _controller: vscode.NotebookController; private _executionOrder = 0; diff --git a/client/src/components/notebook/exporters/toHTML.ts b/client/src/components/notebook/exporters/toHTML.ts index c8c910eae..beb79a704 100644 --- a/client/src/components/notebook/exporters/toHTML.ts +++ b/client/src/components/notebook/exporters/toHTML.ts @@ -17,6 +17,7 @@ import { import { readFileSync } from "fs"; import hljs from "highlight.js/lib/core"; import python from "highlight.js/lib/languages/python"; +import r from "highlight.js/lib/languages/r"; import sql from "highlight.js/lib/languages/sql"; import { marked } from "marked"; import path from "path"; @@ -27,6 +28,7 @@ import { includeLogInNotebookExport } from "../../utils/settings"; const templatesDir = path.resolve(__dirname, "../notebook/exporters/templates"); hljs.registerLanguage("python", python); +hljs.registerLanguage("rlang", r); hljs.registerLanguage("sql", sql); export const exportToHTML = async ( diff --git a/client/src/components/notebook/exporters/toSAS.ts b/client/src/components/notebook/exporters/toSAS.ts index 9bd136054..3543a2b07 100644 --- a/client/src/components/notebook/exporters/toSAS.ts +++ b/client/src/components/notebook/exporters/toSAS.ts @@ -15,6 +15,8 @@ const exportCell = (cell: NotebookCell) => { return text; case "python": return wrapPython(text); + case "rlang": + return wrapRlang(text); case "sql": return wrapSQL(text); case "markdown": @@ -36,3 +38,9 @@ submit; ${code} endsubmit; run;`; + +const wrapRlang = (code: string) => `proc rlang; +submit; +${code} +endsubmit; +run;`; diff --git a/client/src/components/utils/SASCodeDocument.ts b/client/src/components/utils/SASCodeDocument.ts index 4ab4b054d..fba1e54a0 100644 --- a/client/src/components/utils/SASCodeDocument.ts +++ b/client/src/components/utils/SASCodeDocument.ts @@ -180,6 +180,14 @@ endsubmit; run;`; } + private wrapRlang(code: string) { + return `proc rlang; +submit; +${code} +endsubmit; +run;`; + } + private insertLogStartIndicator(code: string): string { // add a comment line at the top of code, // this comment line will be used as indicator to the beginning of log related with this code @@ -198,6 +206,10 @@ ${code}`; wrapped = this.wrapPython(wrapped); } + if (this.parameters.languageId === "rlang") { + wrapped = this.wrapRlang(wrapped); + } + wrapped = this.wrapCodeWithSASProgramFileName(wrapped); wrapped = this.wrapCodeWithPreambleAndPostamble(wrapped); diff --git a/package-lock.json b/package-lock.json index 95217ee7c..2d726c809 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sas-lsp", - "version": "1.17.0", + "version": "1.18.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sas-lsp", - "version": "1.17.0", + "version": "1.18.0", "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { @@ -200,6 +200,7 @@ "integrity": "sha512-2BCOP7TN8M+gVDj7/ht3hsaO/B/n5oDbiAyyvnRlNOs+u1o+JWNYTQrmpuNp1/Wq2gcFrI01JAW+paEKDMx/CA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.27.1", "@babel/generator": "^7.28.3", @@ -1557,6 +1558,7 @@ "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -1633,6 +1635,7 @@ "integrity": "sha512-jCzKdm/QK0Kg4V4IK/oMlRZlY+QOcdjv89U2NgKHZk1CYTj82/RVSx1mV/0gqCVMJ/DA+Zf/S4NBWNF8GQ+eqQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.48.0", "@typescript-eslint/types": "8.48.0", @@ -2157,6 +2160,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -2519,6 +2523,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.9", "caniuse-lite": "^1.0.30001746", @@ -3410,6 +3415,7 @@ "integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -5731,6 +5737,7 @@ "integrity": "sha512-QgODejq9K3OzoBbuyobZlUhznP5SKwPqp+6Q6xw6o8gnhr4O85L2U915iM2IDcfF2NPXVaM9zlo9tdwipnYwzg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -6075,6 +6082,7 @@ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -6618,6 +6626,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -6942,6 +6951,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz", "integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -7052,6 +7062,7 @@ "integrity": "sha512-HU1JOuV1OavsZ+mfigY0j8d1TgQgbZ6M+J75zDkpEAwYeXjWSqrGJtgnPblJjd/mAyTNQ7ygw0MiKOn6etz8yw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.8", @@ -7100,6 +7111,7 @@ "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-6.0.1.tgz", "integrity": "sha512-MfwFQ6SfwinsUVi0rNJm7rHZ31GyTcpVE5pgVA3hwFRb7COD4TzjUUwhGWKfO50+xdc2MQPuEBBJoqIMGt3JDw==", "dev": true, + "peer": true, "dependencies": { "@discoveryjs/json-ext": "^0.6.1", "@webpack-cli/configtest": "^3.0.1", @@ -7428,6 +7440,7 @@ "integrity": "sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==", "dev": true, "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } diff --git a/package.json b/package.json index e0af38778..7146789fc 100644 --- a/package.json +++ b/package.json @@ -1296,7 +1296,8 @@ "embeddedLanguages": { "source.python": "python", "source.lua": "lua", - "source.sql": "sql" + "source.sql": "sql", + "source.r": "r" } } ], From 0231587713a8e85e4aaad921cf10d8e03862835d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:50:36 +0000 Subject: [PATCH 03/34] adding some R Code test fixtures --- client/testFixture/sasnb_export.sas | 17 +++++++++++++++++ client/testFixture/sasnb_export.sasnb | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/client/testFixture/sasnb_export.sas b/client/testFixture/sasnb_export.sas index 088afec00..6b436bff7 100644 --- a/client/testFixture/sasnb_export.sas +++ b/client/testFixture/sasnb_export.sas @@ -19,6 +19,23 @@ print("Result: ", a*10 + b) endsubmit; run; +/* +## R Code + +This is some R code +*/ + +/* +This is a separate note in **Markdown** format. +*/ + +proc rlang; +submit; +die <- 1:6 +paste("Die Maths: ", die[3]*4 + die[6]) +endsubmit; +run; + /* ## SAS Code */ diff --git a/client/testFixture/sasnb_export.sasnb b/client/testFixture/sasnb_export.sasnb index 7ed0c4ad8..f1167285b 100644 --- a/client/testFixture/sasnb_export.sasnb +++ b/client/testFixture/sasnb_export.sasnb @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file From 8f22394ddfabdb218ea92b54a7a36b329a2f7e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:53:55 +0000 Subject: [PATCH 04/34] fixing rlang testfixture file name --- server/test/embedded_lang/embedded_lang.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index 9fcf14873..ce3613d74 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -66,7 +66,7 @@ describe("Test code zone for embedded language", () => { }); it("proc rlang", () => { - const doc = openDoc("server/testFixture/embedded_lang/proc_r.sas"); + const doc = openDoc("server/testFixture/embedded_lang/proc_rlang.sas"); const languageServer = new LanguageServiceProvider(doc); const codeZoneManager = languageServer.getCodeZoneManager(); From 97489e5ed4f029bfdc4fc023db9a73fb963865d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:58:24 +0000 Subject: [PATCH 05/34] adding a print statement to debug rlang zonelist --- server/test/embedded_lang/embedded_lang.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index ce3613d74..c54dafe54 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -75,6 +75,8 @@ describe("Test code zone for embedded language", () => { zoneList.push(codeZoneManager.getCurrentZone(i, 1)); } + console.log(zoneList); + assert.equal(zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT); assert.equal(zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); From 696bddd480c33105d4cfe873d0530cfd913f1902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:13:35 +0000 Subject: [PATCH 06/34] updating debug function for zone_type assertions --- server/src/sas/CodeZoneManager.ts | 21 ++++++++------- .../test/embedded_lang/embedded_lang.test.ts | 27 ++++++++++++++----- .../testFixture/embedded_lang/proc_rlang.sas | 4 +-- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/server/src/sas/CodeZoneManager.ts b/server/src/sas/CodeZoneManager.ts index 08ed4f0e5..cce17a0e8 100644 --- a/server/src/sas/CodeZoneManager.ts +++ b/server/src/sas/CodeZoneManager.ts @@ -2027,16 +2027,17 @@ export class CodeZoneManager { const zone = this._zone(stack, context); return zone.type; } - //only for debug - //function _getZoneName(zone) { - // for(var attr in ZONE_TYPE) { - // if (ZONE_TYPE.hasOwnProperty(attr)) { - // if (ZONE_TYPE[attr] === zone) { - // return attr; - // } - // } - // } - //} + + // Helper function for debugging zone types + static getZoneTypeName(zone: number): string { + for (const [attr, value] of Object.entries(CodeZoneManager.ZONE_TYPE)) { + if (value === zone) { + return attr; + } + } + return `UNKNOWN(${zone})`; + } + private _datasetOptions(context: Context) { let token1 = this._getNextEx(context), equal, diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index c54dafe54..e2b5cd24a 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -74,12 +74,25 @@ describe("Test code zone for embedded language", () => { for (let i = 0; i < doc.lineCount; i++) { zoneList.push(codeZoneManager.getCurrentZone(i, 1)); } - - console.log(zoneList); - - assert.equal(zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT); - assert.equal(zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); - assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); - assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); + assert.equal( + zoneList[1], + CodeZoneManager.ZONE_TYPE.PROC_STMT, + `Expected PROC_STMT at line 2 but got ${CodeZoneManager.getZoneTypeName(zoneList[1])} (${zoneList[1]})`, + ); + assert.equal( + zoneList[2], + CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, + `Expected EMBEDDED_LANG at line 3 but got ${CodeZoneManager.getZoneTypeName(zoneList[2])} (${zoneList[2]})`, + ); + assert.equal( + zoneList[4], + CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, + `Expected EMBEDDED_LANG at line 5 but got ${CodeZoneManager.getZoneTypeName(zoneList[4])} (${zoneList[4]})`, + ); + assert.equal( + zoneList[6], + CodeZoneManager.ZONE_TYPE.PROC_STMT, + `Expected PROC_STMT at line 7 but got ${CodeZoneManager.getZoneTypeName(zoneList[6])} (${zoneList[6]})`, + ); }); }); diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas index 29462e8b2..9fc829579 100644 --- a/server/testFixture/embedded_lang/proc_rlang.sas +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -1,8 +1,8 @@ proc rlang; - submit; +submit; for (x in 1:6) { print(x) } print("first statement after for loop") - endsubmit; +endsubmit; run; From a05b28f43855ee5d8fbd2a10274c5cf440964936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:16:52 +0000 Subject: [PATCH 07/34] =?UTF-8?q?DCO=20Remediation=20Commit=20for=20Elijah?= =?UTF-8?q?=20C=C3=BAchulainn=20Reid=20<56865341+Wizzzzzzard@users.noreply?= =?UTF-8?q?.github.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 416922de21edd08151dcf41a720c58ff4359efc5 I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 74a5d313b26664676679882063e72355c1b71bab I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 0231587713a8e85e4aaad921cf10d8e03862835d I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 8f22394ddfabdb218ea92b54a7a36b329a2f7e27 I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 97489e5ed4f029bfdc4fc023db9a73fb963865d0 I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 696bddd480c33105d4cfe873d0530cfd913f1902 Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/testFixture/embedded_lang/proc_rlang.sas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas index 9fc829579..29462e8b2 100644 --- a/server/testFixture/embedded_lang/proc_rlang.sas +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -1,8 +1,8 @@ proc rlang; -submit; + submit; for (x in 1:6) { print(x) } print("first statement after for loop") -endsubmit; + endsubmit; run; From 29dfd9a9c82a7183cad4da47c8194cb2b127b308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:51:03 +0000 Subject: [PATCH 08/34] Updating Lexer to correctly parse PROC RLANG code --- server/src/sas/Lexer.ts | 72 +++++++++++++++++++ .../test/embedded_lang/embedded_lang.test.ts | 8 +-- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/server/src/sas/Lexer.ts b/server/src/sas/Lexer.ts index a3f7ed182..c0797c991 100644 --- a/server/src/sas/Lexer.ts +++ b/server/src/sas/Lexer.ts @@ -86,6 +86,9 @@ enum EmbeddedLangState { PROC_LUA_DEF, PROC_LUA_SUBMIT_OR_INTERACTIVE, PROC_LUA_CODE, + PROC_RLANG_DEF, + PROC_RLANG_SUBMIT_OR_INTERACTIVE, + PROC_RLANG_CODE, } export class Lexer { start = { line: 0, column: 0 }; @@ -290,6 +293,8 @@ export class Lexer { ) { if (token.type === "text" && token.text === "PYTHON") { this.context.embeddedLangState = EmbeddedLangState.PROC_PYTHON_DEF; + } else if (token.type === "text" && token.text === "RLANG") { + this.context.embeddedLangState = EmbeddedLangState.PROC_RLANG_DEF; } else if (token.type === "text" && token.text === "LUA") { this.context.embeddedLangState = EmbeddedLangState.PROC_LUA_DEF; } @@ -324,6 +329,20 @@ export class Lexer { } break SWITCH; } + case EmbeddedLangState.PROC_RLANG_DEF: { + token = this._readToken(); + if (!token) { + break SWITCH; + } + if ( + token.type === "text" && + ["SUBMIT", "INTERACTIVE", "I"].includes(token.text) + ) { + this.context.embeddedLangState = + EmbeddedLangState.PROC_RLANG_SUBMIT_OR_INTERACTIVE; + } + break SWITCH; + } case EmbeddedLangState.PROC_PYTHON_SUBMIT_OR_INTERACTIVE: { token = this._readToken(); if (!token) { @@ -386,6 +405,59 @@ export class Lexer { token = this._foundEmbeddedCodeToken(this.curr); break SWITCH; } + case EmbeddedLangState.PROC_RLANG_SUBMIT_OR_INTERACTIVE: { + token = this._readToken(); + if (!token) { + break SWITCH; + } + if (token.type === "sep" && token.text === ";") { + this.context.embeddedLangState = EmbeddedLangState.PROC_RLANG_CODE; + } + break SWITCH; + } + case EmbeddedLangState.PROC_RLANG_CODE: { + // R doesn't have multi-line string delimiters like Python's triple quotes + for ( + let line = this.curr.line; + line < this.model.getLineCount(); + line++ + ) { + const lineContent = this._readEmbeddedCodeLine(this.curr, line); + let pos = 0; + let match; + do { + if (match) { + pos += match.index + match[0].length; + } + const stringReg = /("[^"]*?("|$))|('[^']*?('|$))/; + const commentReg = /#.*$/; + const secReg = + /(\b((endsubmit|endinteractive)(\s+|\/\*.*?\*\/)*;|(data|proc|%macro)\b[^'";]*;))/; + match = new RegExp( + `${stringReg.source}|${commentReg.source}|${secReg.source}`, + "m", + ).exec(lineContent.substring(pos)); + if (match) { + const matchedText = match[0]; + if ( + matchedText.startsWith("'") || + matchedText.startsWith('"') || + matchedText.startsWith("#") + ) { + // do nothing to skip string and single line comment + } else { + token = this._foundEmbeddedCodeToken(this.curr, { + line: line, + column: pos + match.index, + }); + break SWITCH; + } + } + } while (match); + } + token = this._foundEmbeddedCodeToken(this.curr); + break SWITCH; + } case EmbeddedLangState.PROC_LUA_SUBMIT_OR_INTERACTIVE: { token = this._readToken(); if (!token) { diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index e2b5cd24a..77a6abddb 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -77,22 +77,22 @@ describe("Test code zone for embedded language", () => { assert.equal( zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT, - `Expected PROC_STMT at line 2 but got ${CodeZoneManager.getZoneTypeName(zoneList[1])} (${zoneList[1]})`, + `Expected PROC_STMT at line 2 but got ${CodeZoneManager.getZoneTypeName(zoneList[1])} (Code: ${zoneList[1]})`, ); assert.equal( zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, - `Expected EMBEDDED_LANG at line 3 but got ${CodeZoneManager.getZoneTypeName(zoneList[2])} (${zoneList[2]})`, + `Expected EMBEDDED_LANG at line 3 but got ${CodeZoneManager.getZoneTypeName(zoneList[2])} (Code: ${zoneList[2]})`, ); assert.equal( zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, - `Expected EMBEDDED_LANG at line 5 but got ${CodeZoneManager.getZoneTypeName(zoneList[4])} (${zoneList[4]})`, + `Expected EMBEDDED_LANG at line 5 but got ${CodeZoneManager.getZoneTypeName(zoneList[4])} (Code: ${zoneList[4]})`, ); assert.equal( zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT, - `Expected PROC_STMT at line 7 but got ${CodeZoneManager.getZoneTypeName(zoneList[6])} (${zoneList[6]})`, + `Expected PROC_STMT at line 7 but got ${CodeZoneManager.getZoneTypeName(zoneList[6])} (Code: ${zoneList[6]})`, ); }); }); From 0e2b746c28a677f3c5c977e34e9b6619e50bb5c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:53:57 +0000 Subject: [PATCH 09/34] Adding PROC_RLANG to CodeZoneManager --- server/src/sas/CodeZoneManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/sas/CodeZoneManager.ts b/server/src/sas/CodeZoneManager.ts index cce17a0e8..6ba023c89 100644 --- a/server/src/sas/CodeZoneManager.ts +++ b/server/src/sas/CodeZoneManager.ts @@ -1132,7 +1132,7 @@ export class CodeZoneManager { this._getFullStmtName(context, this._procName, stmt); const zone = this._stmtEx(context, stmt); type = zone.type; - if (["PYTHON", "LUA"].includes(this._procName)) { + if (["PYTHON", "LUA", "RLANG"].includes(this._procName)) { if (!this._embeddedCodeStarted) { if (["SUBMIT", "INTERACTIVE", "I"].includes(stmt.text)) { this._embeddedCodeStarted = true; From 398c156d899f863a4255ba66bbc1e215fa3ba27e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:54:07 +0000 Subject: [PATCH 10/34] Adding R as an option to the parser for formatting --- server/src/sas/formatter/parser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/sas/formatter/parser.ts b/server/src/sas/formatter/parser.ts index 07f4e6cba..6a2d35059 100644 --- a/server/src/sas/formatter/parser.ts +++ b/server/src/sas/formatter/parser.ts @@ -124,7 +124,7 @@ const preserveProcs = ( token: Token, model: Model, ) => { - // should not format python/lua, treat it as raw data + // should not format python/R/lua, treat it as raw data const lastStatement = region.children.length >= 2 && region.children[region.children.length - 1].children; @@ -135,7 +135,7 @@ const preserveProcs = ( region.children[0].children.length > 0 && lastStatement.length > 1 && "text" in region.children[0].children[1] && - /^(python|lua)$/i.test(region.children[0].children[1].text) && + /^(python|lua|rlang)$/i.test(region.children[0].children[1].text) && "text" in lastStatement[0] && /^(submit|interactive|i)$/i.test(lastStatement[0].text) ) { @@ -286,7 +286,7 @@ export const getParser = const node = tokens[i]; let parent = parents.length ? parents[parents.length - 1] : root; - //#region --- Preserve Python/Lua + //#region --- Preserve Python/R/Lua if (region && region.block) { preserveProc = preserveProcs(preserveProc, region, node, model); if (preserveProc === 0 && i === tokens.length - 1) { From ca52898965489f15594d3e2f45c46e19f214ad21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 12:56:44 +0000 Subject: [PATCH 11/34] =?UTF-8?q?DCO=20Remediation=20Commit=20for=20Elijah?= =?UTF-8?q?=20C=C3=BAchulainn=20Reid=20<56865341+Wizzzzzzard@users.noreply?= =?UTF-8?q?.github.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 29dfd9a9c82a7183cad4da47c8194cb2b127b308 I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 0e2b746c28a677f3c5c977e34e9b6619e50bb5c8 I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 398c156d899f863a4255ba66bbc1e215fa3ba27e Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/src/sas/LexerEx.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/sas/LexerEx.ts b/server/src/sas/LexerEx.ts index 8ca905437..848e766fe 100644 --- a/server/src/sas/LexerEx.ts +++ b/server/src/sas/LexerEx.ts @@ -3101,7 +3101,11 @@ export class LexerEx { this.setKeyword_(token, true); generalProcStmt = false; } - } else if (procName === "LUA" || procName === "PYTHON") { + } else if ( + procName === "LUA" || + procName === "PYTHON" || + procName === "RLANG" + ) { if (["SUBMIT", "INTERACTIVE", "I"].includes(word)) { const next = this.prefetch_({ pos: 1 }); if (next && next.text === ";" && next.type === "sep") { From 454a6abc0f0315e2148e6b844e65eec0b31e5726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:22:10 +0000 Subject: [PATCH 12/34] test with simpler rlang script --- server/testFixture/embedded_lang/proc_rlang.sas | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas index 29462e8b2..9b9318eca 100644 --- a/server/testFixture/embedded_lang/proc_rlang.sas +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -1,8 +1,6 @@ proc rlang; - submit; - for (x in 1:6) { - print(x) - } - print("first statement after for loop") - endsubmit; +submit; + x <- c(1, 2, 3) + print(x) +endsubmit; run; From 5e4da150377e10c622633f5025899c5b94724ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:28:23 +0000 Subject: [PATCH 13/34] resetting to more complex Rlang file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/testFixture/embedded_lang/proc_rlang.sas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas index 9b9318eca..ea6bd9ec0 100644 --- a/server/testFixture/embedded_lang/proc_rlang.sas +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -1,6 +1,8 @@ proc rlang; -submit; - x <- c(1, 2, 3) - print(x) -endsubmit; + submit; + for (x in 1:6) { + print(x) + } + print("first statement after for loop"); + endsubmit; run; From a3be20b26470024842c20b5eda05ebd5ba1d4ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:36:02 +0000 Subject: [PATCH 14/34] fixing file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/testFixture/embedded_lang/proc_rlang.sas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/testFixture/embedded_lang/proc_rlang.sas b/server/testFixture/embedded_lang/proc_rlang.sas index ea6bd9ec0..da286d1e4 100644 --- a/server/testFixture/embedded_lang/proc_rlang.sas +++ b/server/testFixture/embedded_lang/proc_rlang.sas @@ -1,8 +1,8 @@ proc rlang; - submit; +submit; for (x in 1:6) { print(x) } - print("first statement after for loop"); - endsubmit; -run; + print("first statement after for loop") +endsubmit; +run; \ No newline at end of file From 412995f6155258c6464997b32dfa948aa7bcf394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:42:33 +0000 Subject: [PATCH 15/34] adding more rlang tests to match pre-existing lua and python ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- .../components/util/SASCodeDocument.test.ts | 34 +++++++++++++++++++ client/testFixture/formatter/expected.sas | 21 ++++++++++++ client/testFixture/formatter/unformatted.sas | 20 +++++++++++ 3 files changed, 75 insertions(+) diff --git a/client/test/components/util/SASCodeDocument.test.ts b/client/test/components/util/SASCodeDocument.test.ts index e4cef507e..27017870c 100644 --- a/client/test/components/util/SASCodeDocument.test.ts +++ b/client/test/components/util/SASCodeDocument.test.ts @@ -38,6 +38,40 @@ run; assert.equal(sasCodeDoc.getWrappedCode(), expected); }); + it("wrap rlang code", () => { + const parameters: SASCodeDocumentParameters = { + languageId: "rlang", + code: `for (x in 1:6) { + print(x) +} +print("test")`, + selectedCode: "", + htmlStyle: "Illuminate", + outputHtml: true, + uuid: "519058ad-d33b-4b5c-9d23-4cc8d6ffb163", + checkKeyword: async () => false, + }; + + const sasCodeDoc = new SASCodeDocument(parameters); + + const expected = `/** LOG_START_INDICATOR **/ +title;footnote;ods _all_ close; +ods graphics on; +ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inline') body="519058ad-d33b-4b5c-9d23-4cc8d6ffb163.htm"; +proc rlang; +submit; +for (x in 1:6) { + print(x) +} +print("test") +endsubmit; +run; +;*';*";*/;run;quit;ods html5(id=vscode) close; +`; + + assert.equal(sasCodeDoc.getWrappedCode(), expected); + }); + it("wrap sql code", () => { const parameters: SASCodeDocumentParameters = { languageId: "sql", diff --git a/client/testFixture/formatter/expected.sas b/client/testFixture/formatter/expected.sas index 7cb36d0c7..813c09385 100644 --- a/client/testFixture/formatter/expected.sas +++ b/client/testFixture/formatter/expected.sas @@ -46,6 +46,16 @@ def my_function(): endsubmit; run; +proc rlang; +submit; +# Reference to variable defined in previous PROC RLANG call +print(paste("x =", x)) +my_function <- function() { + print("Inside the proc step") +} +endsubmit; +run; + proc lua; submit; local dsid = sas.open("sashelp.company") -- open for input @@ -131,6 +141,17 @@ print('first statement after for loop') endinteractive; run; +proc rlang; +submit; +fruits <- c("apple", "banana", "cherry") +for (x in fruits) { + print(x) +} + +print('first statement after for loop') +endsubmit; +run; + proc lua; submit; diff --git a/client/testFixture/formatter/unformatted.sas b/client/testFixture/formatter/unformatted.sas index 923c7adaf..739699876 100644 --- a/client/testFixture/formatter/unformatted.sas +++ b/client/testFixture/formatter/unformatted.sas @@ -40,6 +40,15 @@ def my_function(): print("Inside the proc step") endsubmit; run; +proc rlang; +submit; +# Reference to variable defined in previous PROC RLANG call +print(paste("x =", x)) +my_function <- function() { + print("Inside the proc step") +} +endsubmit; +run; proc lua; submit; local dsid = sas.open("sashelp.company") -- open for input @@ -126,6 +135,17 @@ print('first statement after for loop') endinteractive; run; +proc rlang; +submit; +fruits <- c("apple", "banana", "cherry") +for (x in fruits) { + print(x) +} + +print('first statement after for loop') +endsubmit; +run; + proc lua; submit; From e62c8e80f46f1e9ba30708322a90fda6189d18f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:46:24 +0000 Subject: [PATCH 16/34] reverting embedded lang test assert for rlang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DCO Remediation Commit for Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 454a6abc0f0315e2148e6b844e65eec0b31e5726 Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- .../test/embedded_lang/embedded_lang.test.ts | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index 77a6abddb..4a0725e59 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -74,25 +74,9 @@ describe("Test code zone for embedded language", () => { for (let i = 0; i < doc.lineCount; i++) { zoneList.push(codeZoneManager.getCurrentZone(i, 1)); } - assert.equal( - zoneList[1], - CodeZoneManager.ZONE_TYPE.PROC_STMT, - `Expected PROC_STMT at line 2 but got ${CodeZoneManager.getZoneTypeName(zoneList[1])} (Code: ${zoneList[1]})`, - ); - assert.equal( - zoneList[2], - CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, - `Expected EMBEDDED_LANG at line 3 but got ${CodeZoneManager.getZoneTypeName(zoneList[2])} (Code: ${zoneList[2]})`, - ); - assert.equal( - zoneList[4], - CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG, - `Expected EMBEDDED_LANG at line 5 but got ${CodeZoneManager.getZoneTypeName(zoneList[4])} (Code: ${zoneList[4]})`, - ); - assert.equal( - zoneList[6], - CodeZoneManager.ZONE_TYPE.PROC_STMT, - `Expected PROC_STMT at line 7 but got ${CodeZoneManager.getZoneTypeName(zoneList[6])} (Code: ${zoneList[6]})`, - ); + assert.equal(zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT); + assert.equal(zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); }); }); From c5f8f7f726b54df1718f1f1bd6a4149ca9d9dba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:57:35 +0000 Subject: [PATCH 17/34] updating references to "rlang" as a language to "r" to work better with VS Code's language server --- client/src/components/notebook/Controller.ts | 2 +- client/src/components/notebook/exporters/toHTML.ts | 2 +- client/src/components/notebook/exporters/toSAS.ts | 2 ++ client/src/components/utils/SASCodeDocument.ts | 2 +- client/test/components/util/SASCodeDocument.test.ts | 2 +- client/testFixture/sasnb_export.sasnb | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/components/notebook/Controller.ts b/client/src/components/notebook/Controller.ts index 01c1cfa1d..26a161609 100644 --- a/client/src/components/notebook/Controller.ts +++ b/client/src/components/notebook/Controller.ts @@ -11,7 +11,7 @@ export class NotebookController { readonly controllerId = "sas-notebook-controller-id"; readonly notebookType = "sas-notebook"; readonly label = "SAS Notebook"; - readonly supportedLanguages = ["sas", "sql", "python", "rlang"]; + readonly supportedLanguages = ["sas", "sql", "python", "r"]; private readonly _controller: vscode.NotebookController; private _executionOrder = 0; diff --git a/client/src/components/notebook/exporters/toHTML.ts b/client/src/components/notebook/exporters/toHTML.ts index beb79a704..917b85184 100644 --- a/client/src/components/notebook/exporters/toHTML.ts +++ b/client/src/components/notebook/exporters/toHTML.ts @@ -28,7 +28,7 @@ import { includeLogInNotebookExport } from "../../utils/settings"; const templatesDir = path.resolve(__dirname, "../notebook/exporters/templates"); hljs.registerLanguage("python", python); -hljs.registerLanguage("rlang", r); +hljs.registerLanguage("r", r); hljs.registerLanguage("sql", sql); export const exportToHTML = async ( diff --git a/client/src/components/notebook/exporters/toSAS.ts b/client/src/components/notebook/exporters/toSAS.ts index 3543a2b07..613050afc 100644 --- a/client/src/components/notebook/exporters/toSAS.ts +++ b/client/src/components/notebook/exporters/toSAS.ts @@ -15,6 +15,8 @@ const exportCell = (cell: NotebookCell) => { return text; case "python": return wrapPython(text); + case "r": + return wrapRlang(text); case "rlang": return wrapRlang(text); case "sql": diff --git a/client/src/components/utils/SASCodeDocument.ts b/client/src/components/utils/SASCodeDocument.ts index fba1e54a0..1425a485c 100644 --- a/client/src/components/utils/SASCodeDocument.ts +++ b/client/src/components/utils/SASCodeDocument.ts @@ -206,7 +206,7 @@ ${code}`; wrapped = this.wrapPython(wrapped); } - if (this.parameters.languageId === "rlang") { + if (this.parameters.languageId === "r" || this.parameters.languageId === "rlang") { wrapped = this.wrapRlang(wrapped); } diff --git a/client/test/components/util/SASCodeDocument.test.ts b/client/test/components/util/SASCodeDocument.test.ts index 27017870c..dbc4640c8 100644 --- a/client/test/components/util/SASCodeDocument.test.ts +++ b/client/test/components/util/SASCodeDocument.test.ts @@ -40,7 +40,7 @@ run; it("wrap rlang code", () => { const parameters: SASCodeDocumentParameters = { - languageId: "rlang", + languageId: "r", code: `for (x in 1:6) { print(x) } diff --git a/client/testFixture/sasnb_export.sasnb b/client/testFixture/sasnb_export.sasnb index f1167285b..55b2f338a 100644 --- a/client/testFixture/sasnb_export.sasnb +++ b/client/testFixture/sasnb_export.sasnb @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"rlang","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file From d4da7ade4c221ba091ab0be3182c6b8a9d1dd86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:58:27 +0000 Subject: [PATCH 18/34] making spacing a bit nicer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DCO Remediation Commit for Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> I, Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com>, hereby add my Signed-off-by to this commit: c5f8f7f726b54df1718f1f1bd6a4149ca9d9dba9 Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/src/components/utils/SASCodeDocument.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/utils/SASCodeDocument.ts b/client/src/components/utils/SASCodeDocument.ts index 1425a485c..c15cedf23 100644 --- a/client/src/components/utils/SASCodeDocument.ts +++ b/client/src/components/utils/SASCodeDocument.ts @@ -206,7 +206,10 @@ ${code}`; wrapped = this.wrapPython(wrapped); } - if (this.parameters.languageId === "r" || this.parameters.languageId === "rlang") { + if ( + this.parameters.languageId === "r" || + this.parameters.languageId === "rlang" + ) { wrapped = this.wrapRlang(wrapped); } From 7e58b1ca2c78c5ff68b8d6f8e4db19875b877e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:06:07 +0000 Subject: [PATCH 19/34] tweaking R UID to see if it makes a difference MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/src/components/ContentNavigator/convert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/ContentNavigator/convert.ts b/client/src/components/ContentNavigator/convert.ts index 80a03568e..c64619fc6 100644 --- a/client/src/components/ContentNavigator/convert.ts +++ b/client/src/components/ContentNavigator/convert.ts @@ -20,7 +20,7 @@ const stepRef: Record = { sas: "a7190700-f59c-4a94-afe2-214ce639fcde", sql: "a7190700-f59c-4a94-afe2-214ce639fcde", python: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", - rlang: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", + rlang: "ab59f8c4-af9a-4608-a5d6-a8365357bb98", }; const stepTitle: Record = { From 925ff772fee28dcffc74a44512a8c325b22b26f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:27:58 +0000 Subject: [PATCH 20/34] Updating notebook with correctly highlighted R code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/testFixture/sasnb_export.sasnb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/testFixture/sasnb_export.sasnb b/client/testFixture/sasnb_export.sasnb index 55b2f338a..ab5ac4a37 100644 --- a/client/testFixture/sasnb_export.sasnb +++ b/client/testFixture/sasnb_export.sasnb @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"rlang","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"r","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file From 9e1b66a06381a029dcb49a0e8fd8c085bcab802a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:40:58 +0000 Subject: [PATCH 21/34] uploading notebook with R output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/testFixture/sasnb_export.sasnb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/testFixture/sasnb_export.sasnb b/client/testFixture/sasnb_export.sasnb index ab5ac4a37..6f1183941 100644 --- a/client/testFixture/sasnb_export.sasnb +++ b/client/testFixture/sasnb_export.sasnb @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"r","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"44 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The SAS System

\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"16 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The PROCEDURE MEANS printed page 1.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.04 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"24 ods html5;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5 Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"27 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"6 The SAS System Monday, August 21, 2023 02:56:00 PM\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 ;run;quit;ods html5 close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"14 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"15 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"16 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Python initialized.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Python 3.11.10 (main, Nov 30 2025, 14:30:37) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] on linux\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Type \\\"help\\\", \\\"copyright\\\", \\\"credits\\\" or \\\"license\\\" for more information.\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"24 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 1.99 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.08 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"r","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"27 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 proc rlang;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 die <- 1:6\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 paste(\\\"Die Maths: \\\", die[3]*4 + die[6])\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"36 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"37 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"[1] \\\"Die Maths: 18\\\"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE RLANG used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"38 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"39 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"40 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"3 The SAS System Friday, 5 December 2025 14:39:00\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"41 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"42 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"43 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml3.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"44 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.02 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"52 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"53 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"54 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"55 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"56 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"57 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"58 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"59 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"60 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"61 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"62 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"63 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"64 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"65 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"66 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"68 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"69 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file From 3b4180210e2bc8532dfb870d8710ccebfa7c3b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:41:43 +0000 Subject: [PATCH 22/34] making the rlang id match python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/src/components/ContentNavigator/convert.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/ContentNavigator/convert.ts b/client/src/components/ContentNavigator/convert.ts index c64619fc6..80a03568e 100644 --- a/client/src/components/ContentNavigator/convert.ts +++ b/client/src/components/ContentNavigator/convert.ts @@ -20,7 +20,7 @@ const stepRef: Record = { sas: "a7190700-f59c-4a94-afe2-214ce639fcde", sql: "a7190700-f59c-4a94-afe2-214ce639fcde", python: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", - rlang: "ab59f8c4-af9a-4608-a5d6-a8365357bb98", + rlang: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", }; const stepTitle: Record = { From 54f72e365e05e35e3dd102820ef2be616e5900e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:57:50 +0000 Subject: [PATCH 23/34] Updating references to languages in docs to include R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- README.md | 2 +- website/docs/Features/sasNotebook.md | 2 +- website/docs/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 122544562..ba6de89fd 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The SAS extension includes many [features](https://sassoftware.github.io/vscode- - SAS syntax highlighting and help, code completion, and code snippets - Navigate SAS Content and libraries, including table viewer -- Create notebooks for SAS, SQL, Python and other languages +- Create notebooks for SAS, SQL, Python, R, and other languages diff --git a/website/docs/Features/sasNotebook.md b/website/docs/Features/sasNotebook.md index c2e7afb8d..01066361d 100644 --- a/website/docs/Features/sasNotebook.md +++ b/website/docs/Features/sasNotebook.md @@ -25,7 +25,7 @@ To export your SAS Notebook to other formats, click the **More Actions** (`...`) ### SAS -PYTHON and SQL code cells will be wrapped with PROC PYTHON/SQL respectively to be executed on SAS. Markdown cells will be converted to block comments. +PYTHON, R, and SQL code cells will be wrapped with PROC PYTHON/RLANG/SQL respectively to be executed on SAS. Markdown cells will be converted to block comments. ### HTML diff --git a/website/docs/README.md b/website/docs/README.md index e54c39d6e..8955ff2ef 100644 --- a/website/docs/README.md +++ b/website/docs/README.md @@ -16,4 +16,4 @@ The SAS extension includes the following features: - Access to SAS Content and libraries -- Ability to create notebooks for SAS, SQL, Python, and other languages +- Ability to create notebooks for SAS, SQL, Python, R, and other languages From 82d5f267641ed576d6c3f3538411cbb4cb6332e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:59:52 +0000 Subject: [PATCH 24/34] Including R changes in the Changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96aaddbc9..f55ed822b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Add the ability to sort columns in data viewer and view column properties ([#1622](https://github.com/sassoftware/vscode-sas-extension/pull/1622)) - Add code comment collapsing ([#1638](https://github.com/sassoftware/vscode-sas-extension/pull/1638)) - Add ability to view dataset properties ([#1631](https://github.com/sassoftware/vscode-sas-extension/pull/1631)) +- Add R language support for PROC RLANG (syntax highlighting, notebook cells, code formatting preservation) ### Fixed From ca092d23ecc44316221bb5a4cba4d1d9b3876ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:20:04 +0000 Subject: [PATCH 25/34] removing rlang case now that references have been updated to r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/src/components/notebook/exporters/toSAS.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/src/components/notebook/exporters/toSAS.ts b/client/src/components/notebook/exporters/toSAS.ts index 613050afc..d90674bf1 100644 --- a/client/src/components/notebook/exporters/toSAS.ts +++ b/client/src/components/notebook/exporters/toSAS.ts @@ -17,8 +17,6 @@ const exportCell = (cell: NotebookCell) => { return wrapPython(text); case "r": return wrapRlang(text); - case "rlang": - return wrapRlang(text); case "sql": return wrapSQL(text); case "markdown": From adc239c32fdf73ce8fbe71023d42c679a7f1990b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:21:55 +0000 Subject: [PATCH 26/34] removing debug function from CodeZoneManager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/src/sas/CodeZoneManager.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/server/src/sas/CodeZoneManager.ts b/server/src/sas/CodeZoneManager.ts index 6ba023c89..a55717882 100644 --- a/server/src/sas/CodeZoneManager.ts +++ b/server/src/sas/CodeZoneManager.ts @@ -2027,17 +2027,16 @@ export class CodeZoneManager { const zone = this._zone(stack, context); return zone.type; } - - // Helper function for debugging zone types - static getZoneTypeName(zone: number): string { - for (const [attr, value] of Object.entries(CodeZoneManager.ZONE_TYPE)) { - if (value === zone) { - return attr; - } - } - return `UNKNOWN(${zone})`; - } - + //only for debug + //function _getZoneName(zone) { + // for(var attr in ZONE_TYPE) { + // if (ZONE_TYPE.hasOwnProperty(attr)) { + // if (ZONE_TYPE[attr] === zone) { + // return attr; + // } + // } + // } + //} private _datasetOptions(context: Context) { let token1 = this._getNextEx(context), equal, From 18cba798412d160f6030cfa6b60358e578531b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 15:23:07 +0000 Subject: [PATCH 27/34] Simplifying R comment/string regex in Lexer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- server/src/sas/Lexer.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/src/sas/Lexer.ts b/server/src/sas/Lexer.ts index c0797c991..f8cfd09ec 100644 --- a/server/src/sas/Lexer.ts +++ b/server/src/sas/Lexer.ts @@ -439,11 +439,7 @@ export class Lexer { ).exec(lineContent.substring(pos)); if (match) { const matchedText = match[0]; - if ( - matchedText.startsWith("'") || - matchedText.startsWith('"') || - matchedText.startsWith("#") - ) { + if (/^('|"|#)/.test(matchedText)) { // do nothing to skip string and single line comment } else { token = this._foundEmbeddedCodeToken(this.curr, { From 40362335a4d76f9fc3dd6b64462ac01f7faf431b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Fri, 5 Dec 2025 17:48:29 +0000 Subject: [PATCH 28/34] updating Code Document to only require r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- client/src/components/utils/SASCodeDocument.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/src/components/utils/SASCodeDocument.ts b/client/src/components/utils/SASCodeDocument.ts index c15cedf23..56837979e 100644 --- a/client/src/components/utils/SASCodeDocument.ts +++ b/client/src/components/utils/SASCodeDocument.ts @@ -206,10 +206,7 @@ ${code}`; wrapped = this.wrapPython(wrapped); } - if ( - this.parameters.languageId === "r" || - this.parameters.languageId === "rlang" - ) { + if (this.parameters.languageId === "r") { wrapped = this.wrapRlang(wrapped); } From ec3df3bdce8c477194c102785a3f84cefbb8fe12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:26:41 +0000 Subject: [PATCH 29/34] Adding tests for theoretical Proc Julia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elijah Cúchulainn Reid <56865341+Wizzzzzzard@users.noreply.github.com> --- .../components/util/SASCodeDocument.test.ts | 34 +++++++++++++++++++ client/testFixture/formatter/expected.sas | 21 ++++++++++++ client/testFixture/formatter/unformatted.sas | 20 +++++++++++ client/testFixture/sasnb_export.sas | 16 +++++++++ client/testFixture/sasnb_export.sasnb | 2 +- .../test/embedded_lang/embedded_lang.test.ts | 15 ++++++++ .../testFixture/embedded_lang/proc_julia.sas | 8 +++++ 7 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 server/testFixture/embedded_lang/proc_julia.sas diff --git a/client/test/components/util/SASCodeDocument.test.ts b/client/test/components/util/SASCodeDocument.test.ts index dbc4640c8..5c37ba56b 100644 --- a/client/test/components/util/SASCodeDocument.test.ts +++ b/client/test/components/util/SASCodeDocument.test.ts @@ -72,6 +72,40 @@ run; assert.equal(sasCodeDoc.getWrappedCode(), expected); }); + it("wrap julia code", () => { + const parameters: SASCodeDocumentParameters = { + languageId: "julia", + code: `# Julia code example +println("Hello from Julia!") +x = [1, 2, 3, 4, 5] +mean_val = sum(x) / length(x)`, + selectedCode: "", + htmlStyle: "Illuminate", + outputHtml: true, + uuid: "519058ad-d33b-4b5c-9d23-4cc8d6ffb163", + checkKeyword: async () => false, + }; + + const sasCodeDoc = new SASCodeDocument(parameters); + + const expected = `/** LOG_START_INDICATOR **/ +title;footnote;ods _all_ close; +ods graphics on; +ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inline') body="519058ad-d33b-4b5c-9d23-4cc8d6ffb163.htm"; +proc julia; +submit; +# Julia code example +println("Hello from Julia!") +x = [1, 2, 3, 4, 5] +mean_val = sum(x) / length(x) +endsubmit; +run; +;*';*";*/;run;quit;ods html5(id=vscode) close; +`; + + assert.equal(sasCodeDoc.getWrappedCode(), expected); + }); + it("wrap sql code", () => { const parameters: SASCodeDocumentParameters = { languageId: "sql", diff --git a/client/testFixture/formatter/expected.sas b/client/testFixture/formatter/expected.sas index 813c09385..1e8fd41a4 100644 --- a/client/testFixture/formatter/expected.sas +++ b/client/testFixture/formatter/expected.sas @@ -56,6 +56,16 @@ my_function <- function() { endsubmit; run; +proc julia; +submit; +# Reference to variable defined in previous PROC JULIA call +println("x = ", x) +function my_function() + println("Inside the proc step") +end +endsubmit; +run; + proc lua; submit; local dsid = sas.open("sashelp.company") -- open for input @@ -152,6 +162,17 @@ print('first statement after for loop') endsubmit; run; +proc julia; +submit; +fruits = ["apple", "banana", "cherry"] +for x in fruits + println(x) +end + +println("first statement after for loop") +endsubmit; +run; + proc lua; submit; diff --git a/client/testFixture/formatter/unformatted.sas b/client/testFixture/formatter/unformatted.sas index 739699876..f289e3c6a 100644 --- a/client/testFixture/formatter/unformatted.sas +++ b/client/testFixture/formatter/unformatted.sas @@ -49,6 +49,15 @@ my_function <- function() { } endsubmit; run; +proc julia; +submit; +# Reference to variable defined in previous PROC JULIA call +println("x = ", x) +function my_function() + println("Inside the proc step") +end +endsubmit; +run; proc lua; submit; local dsid = sas.open("sashelp.company") -- open for input @@ -146,6 +155,17 @@ print('first statement after for loop') endsubmit; run; +proc julia; +submit; +fruits = ["apple", "banana", "cherry"] +for x in fruits + println(x) +end + +println("first statement after for loop") +endsubmit; +run; + proc lua; submit; diff --git a/client/testFixture/sasnb_export.sas b/client/testFixture/sasnb_export.sas index 6b436bff7..3eeec2670 100644 --- a/client/testFixture/sasnb_export.sas +++ b/client/testFixture/sasnb_export.sas @@ -36,6 +36,22 @@ paste("Die Maths: ", die[3]*4 + die[6]) endsubmit; run; +/* +## Julia Code + +This is some Julia code +*/ + +/* +This is a separate note in **Markdown** format. +*/ +proc julia; +submit; +dice=1:6 +println("Dice Maths: ", dice[3]*4 + dice[6]) +endsubmit; +run; + /* ## SAS Code */ diff --git a/client/testFixture/sasnb_export.sasnb b/client/testFixture/sasnb_export.sasnb index 6f1183941..3aa791dfe 100644 --- a/client/testFixture/sasnb_export.sasnb +++ b/client/testFixture/sasnb_export.sasnb @@ -1 +1 @@ -[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"14 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"15 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"16 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Python initialized.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Python 3.11.10 (main, Nov 30 2025, 14:30:37) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] on linux\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Type \\\"help\\\", \\\"copyright\\\", \\\"credits\\\" or \\\"license\\\" for more information.\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"24 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 1.99 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.08 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"r","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"27 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 proc rlang;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 die <- 1:6\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 paste(\\\"Die Maths: \\\", die[3]*4 + die[6])\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"36 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"37 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"[1] \\\"Die Maths: 18\\\"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE RLANG used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"38 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"39 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"40 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"3 The SAS System Friday, 5 December 2025 14:39:00\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"41 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"42 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"43 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml3.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"44 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.02 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"52 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"53 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"54 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"55 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"56 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"57 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"58 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"59 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"60 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"61 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"62 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"63 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"64 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"65 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"66 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"68 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"69 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file +[{"kind":1,"language":"markdown","value":"# Notebook to SAS Test","outputs":[]},{"kind":1,"language":"markdown","value":"## Python Code\n\nThis is some Python code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"python","value":"a, b = 4, 2\nprint(\"Result: \", a*10 + b)","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"14 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"15 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"16 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"17 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml1.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"18 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"19 proc python;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Python initialized.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Python 3.11.10 (main, Nov 30 2025, 14:30:37) [GCC 11.5.0 20240719 (Red Hat 11.5.0-11)] on linux\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Type \\\"help\\\", \\\"copyright\\\", \\\"credits\\\" or \\\"license\\\" for more information.\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"20 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"21 a, b = 4, 2\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"22 print(\\\"Result: \\\", a*10 + b)\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"23 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"24 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>>\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"Result: 42\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \">>> \",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE PYTHON used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 1.99 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.08 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"25 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"26 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## R Code\n\nThis is some R code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"r","value":"die <- 1:6\npaste(\"Die Maths: \", die[3]*4 + die[6])","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"27 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"28 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"29 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"30 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml2.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"31 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"32 proc rlang;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 submit\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Resuming Python state from previous PROC PYTHON invocation.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"33 ! ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"34 die <- 1:6\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"35 paste(\\\"Die Maths: \\\", die[3]*4 + die[6])\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"36 endsubmit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"37 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"[1] \\\"Die Maths: 18\\\"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE RLANG used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"38 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"39 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## Julia Code\n\nThis is some Julia code","outputs":[]},{"kind":1,"language":"markdown","value":"This is a separate note in **Markdown** format.","outputs":[]},{"kind":2,"language":"julia","value":"dice=1:6\nprintln(\"Dice Maths: \", dice[3]*4 + dice[6])","outputs":[]},{"kind":1,"language":"markdown","value":"## SAS Code","outputs":[]},{"kind":2,"language":"sas","value":"data work.prdsale;\n\tset sashelp.PRDSALE;\nrun;\n\nproc means data=work.prdsale;\nrun;","outputs":[{"items":[{"data":"\n\n\n\n\nSAS Output\n\n\n\n
\n
\n

The MEANS Procedure

\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
VariableLabelNMeanStd DevMinimumMaximum
\n
\n
ACTUAL
\n
PREDICT
\n
QUARTER
\n
YEAR
\n
MONTH
\n
\n
\n
\n
Actual Sales
\n
Predicted Sales
\n
Quarter
\n
Year
\n
Month
\n
\n
\n
\n
1440
\n
1440
\n
1440
\n
1440
\n
1440
\n
\n
\n
\n
507.1784722
\n
490.4826389
\n
2.5000000
\n
1993.50
\n
12403.00
\n
\n
\n
\n
287.0313065
\n
285.7667904
\n
1.1184224
\n
0.5001737
\n
210.6291578
\n
\n
\n
\n
3.0000000
\n
0
\n
1.0000000
\n
1993.00
\n
12054.00
\n
\n
\n
\n
1000.00
\n
1000.00
\n
4.0000000
\n
1994.00
\n
12753.00
\n
\n
\n
\n
\n\n\n","mime":"application/vnd.sas.ods.html5"},{"data":"[\n\t{\n\t\t\"line\": \"40 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"3 The SAS System Friday, 5 December 2025 14:39:00\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"title\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"41 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"42 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"43 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml3.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"44 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"45 data work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"46 \\tset sashelp.PRDSALE;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"47 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set SASHELP.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: The data set WORK.PRDSALE has 1440 observations and 10 variables.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: DATA statement used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.00 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.02 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"48 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"49 proc means data=work.prdsale;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"50 run;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: There were 1440 observations read from the data set WORK.PRDSALE.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE MEANS used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.05 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"51 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"52 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"## SQL Code","outputs":[]},{"kind":2,"language":"sql","value":"CREATE TABLE WORK.QUERY_PRDSALE AS\n SELECT\n (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\n (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\n FROM\n WORK.PRDSALE t1\n GROUP BY\n t1.COUNTRY","outputs":[{"items":[{"data":"[\n\t{\n\t\t\"line\": \"53 /** LOG_START_INDICATOR **/\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"54 title;footnote;ods _all_ close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"55 ods graphics on;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"56 ods html5(id=vscode) style=Ignite options(bitmap_mode='inline' svg_mode='inline');\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Writing HTML5(VSCODE) Body file: sashtml4.htm\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"57 %let _SASPROGRAMFILE = %nrquote(%nrstr(/Users/elreid/personalGit/vscode-sas-extension/client/testFixture/sasnb_export.sasnb));\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"58 proc sql;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"59 CREATE TABLE WORK.QUERY_PRDSALE AS\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"60 SELECT\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"61 (t1.COUNTRY) LABEL='Country' FORMAT=$CHAR10.,\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"62 (SUM(t1.ACTUAL)) FORMAT=DOLLAR12.2 LENGTH=8 AS SUM_ACTUAL\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"63 FROM\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"64 WORK.PRDSALE t1\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"65 GROUP BY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"66 t1.COUNTRY\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: Table WORK.QUERY_PRDSALE created, with 3 rows and 2 columns.\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"normal\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"67 ! quit;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"NOTE: PROCEDURE SQL used (Total process time):\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" real time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" cpu time 0.01 seconds\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \" \",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"68 ;*';*\\\";*/;run;quit;ods html5(id=vscode) close;\",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"69 \",\n\t\t\"type\": \"source\",\n\t\t\"version\": 1\n\t},\n\t{\n\t\t\"line\": \"\",\n\t\t\"type\": \"note\",\n\t\t\"version\": 1\n\t}\n]","mime":"application/vnd.sas.compute.log.lines"}]}]},{"kind":1,"language":"markdown","value":"A last comment in Markdown at the end of the document","outputs":[]},{"kind":1,"language":"markdown","value":"","outputs":[]}] \ No newline at end of file diff --git a/server/test/embedded_lang/embedded_lang.test.ts b/server/test/embedded_lang/embedded_lang.test.ts index 4a0725e59..c2bc05b1e 100644 --- a/server/test/embedded_lang/embedded_lang.test.ts +++ b/server/test/embedded_lang/embedded_lang.test.ts @@ -79,4 +79,19 @@ describe("Test code zone for embedded language", () => { assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); }); + + it("proc julia", () => { + const doc = openDoc("server/testFixture/embedded_lang/proc_julia.sas"); + const languageServer = new LanguageServiceProvider(doc); + const codeZoneManager = languageServer.getCodeZoneManager(); + + const zoneList = []; + for (let i = 0; i < doc.lineCount; i++) { + zoneList.push(codeZoneManager.getCurrentZone(i, 1)); + } + assert.equal(zoneList[1], CodeZoneManager.ZONE_TYPE.PROC_STMT); + assert.equal(zoneList[2], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[4], CodeZoneManager.ZONE_TYPE.EMBEDDED_LANG); + assert.equal(zoneList[6], CodeZoneManager.ZONE_TYPE.PROC_STMT); + }); }); diff --git a/server/testFixture/embedded_lang/proc_julia.sas b/server/testFixture/embedded_lang/proc_julia.sas new file mode 100644 index 000000000..caaf30ba3 --- /dev/null +++ b/server/testFixture/embedded_lang/proc_julia.sas @@ -0,0 +1,8 @@ +proc julia; +submit; + for x in 1:6 + print(x) + end + print("first statement after for loop") +endsubmit; +run; \ No newline at end of file From 602891faf76be953f37f815c8960c9e61f63f18f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:27:20 +0000 Subject: [PATCH 30/34] Adding Julia syntax highlighting package --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 7146789fc..b42bd0485 100644 --- a/package.json +++ b/package.json @@ -1297,7 +1297,8 @@ "source.python": "python", "source.lua": "lua", "source.sql": "sql", - "source.r": "r" + "source.r": "r", + "source.julia": "julia" } } ], From 5a77c3135abfd944b693de6810d1fcb1a615086f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:28:50 +0000 Subject: [PATCH 31/34] Adding Julia support for parsing and code zones --- server/src/sas/CodeZoneManager.ts | 2 +- server/src/sas/Lexer.ts | 96 ++++++++++++++++++++++++++++++ server/src/sas/LexerEx.ts | 3 +- server/src/sas/formatter/parser.ts | 6 +- 4 files changed, 102 insertions(+), 5 deletions(-) diff --git a/server/src/sas/CodeZoneManager.ts b/server/src/sas/CodeZoneManager.ts index a55717882..bf9c9a9c3 100644 --- a/server/src/sas/CodeZoneManager.ts +++ b/server/src/sas/CodeZoneManager.ts @@ -1132,7 +1132,7 @@ export class CodeZoneManager { this._getFullStmtName(context, this._procName, stmt); const zone = this._stmtEx(context, stmt); type = zone.type; - if (["PYTHON", "LUA", "RLANG"].includes(this._procName)) { + if (["PYTHON", "LUA", "RLANG", "JULIA"].includes(this._procName)) { if (!this._embeddedCodeStarted) { if (["SUBMIT", "INTERACTIVE", "I"].includes(stmt.text)) { this._embeddedCodeStarted = true; diff --git a/server/src/sas/Lexer.ts b/server/src/sas/Lexer.ts index f8cfd09ec..89d3bbc5e 100644 --- a/server/src/sas/Lexer.ts +++ b/server/src/sas/Lexer.ts @@ -89,6 +89,9 @@ enum EmbeddedLangState { PROC_RLANG_DEF, PROC_RLANG_SUBMIT_OR_INTERACTIVE, PROC_RLANG_CODE, + PROC_JULIA_DEF, + PROC_JULIA_SUBMIT_OR_INTERACTIVE, + PROC_JULIA_CODE, } export class Lexer { start = { line: 0, column: 0 }; @@ -295,6 +298,8 @@ export class Lexer { this.context.embeddedLangState = EmbeddedLangState.PROC_PYTHON_DEF; } else if (token.type === "text" && token.text === "RLANG") { this.context.embeddedLangState = EmbeddedLangState.PROC_RLANG_DEF; + } else if (token.type === "text" && token.text === "JULIA") { + this.context.embeddedLangState = EmbeddedLangState.PROC_JULIA_DEF; } else if (token.type === "text" && token.text === "LUA") { this.context.embeddedLangState = EmbeddedLangState.PROC_LUA_DEF; } @@ -343,6 +348,20 @@ export class Lexer { } break SWITCH; } + case EmbeddedLangState.PROC_JULIA_DEF: { + token = this._readToken(); + if (!token) { + break SWITCH; + } + if ( + token.type === "text" && + ["SUBMIT", "INTERACTIVE", "I"].includes(token.text) + ) { + this.context.embeddedLangState = + EmbeddedLangState.PROC_JULIA_SUBMIT_OR_INTERACTIVE; + } + break SWITCH; + } case EmbeddedLangState.PROC_PYTHON_SUBMIT_OR_INTERACTIVE: { token = this._readToken(); if (!token) { @@ -454,6 +473,83 @@ export class Lexer { token = this._foundEmbeddedCodeToken(this.curr); break SWITCH; } + case EmbeddedLangState.PROC_JULIA_SUBMIT_OR_INTERACTIVE: { + token = this._readToken(); + if (!token) { + break SWITCH; + } + if (token.type === "sep" && token.text === ";") { + this.context.embeddedLangState = EmbeddedLangState.PROC_JULIA_CODE; + } + break SWITCH; + } + case EmbeddedLangState.PROC_JULIA_CODE: { + // Julia supports triple-quoted strings and nested multi-line comments + let multiLineStrState: false | '"""' = false; + let multiLineCommentDepth = 0; + for ( + let line = this.curr.line; + line < this.model.getLineCount(); + line++ + ) { + const lineContent = this._readEmbeddedCodeLine(this.curr, line); + let pos = 0; + let match; + do { + if (match) { + pos += match.index + match[0].length; + } + if (multiLineCommentDepth > 0) { + // Inside multi-line comment #= ... =# + match = /#=|=#/.exec(lineContent.substring(pos)); + if (match) { + if (match[0] === "#=") { + multiLineCommentDepth++; + } else if (match[0] === "=#") { + multiLineCommentDepth--; + } + } + } else if (multiLineStrState) { + // Inside triple-quoted string + match = /"""/.exec(lineContent.substring(pos)); + if (match) { + multiLineStrState = false; + } + } else { + // Looking for strings, comments, or SAS keywords + const stringReg = /"""|("[^"\\\n]*(\\.[^"\\\n]*)*")/; + const commentReg = /#=|#.*$/; + const secReg = + /(\b((endsubmit|endinteractive)(\s+|\/\*.*?\*\/)*;|(data|proc|%macro)\b[^'";]*;))/; + match = new RegExp( + `${stringReg.source}|${commentReg.source}|${secReg.source}`, + "m", + ).exec(lineContent.substring(pos)); + if (match) { + const matchedText = match[0]; + if (matchedText === '"""') { + multiLineStrState = '"""'; + } else if (matchedText === "#=") { + multiLineCommentDepth = 1; + } else if ( + matchedText.startsWith('"') || + matchedText.startsWith("#") + ) { + // do nothing to skip string and single line comment + } else { + token = this._foundEmbeddedCodeToken(this.curr, { + line: line, + column: pos + match.index, + }); + break SWITCH; + } + } + } + } while (match); + } + token = this._foundEmbeddedCodeToken(this.curr); + break SWITCH; + } case EmbeddedLangState.PROC_LUA_SUBMIT_OR_INTERACTIVE: { token = this._readToken(); if (!token) { diff --git a/server/src/sas/LexerEx.ts b/server/src/sas/LexerEx.ts index 848e766fe..feed029ff 100644 --- a/server/src/sas/LexerEx.ts +++ b/server/src/sas/LexerEx.ts @@ -3104,7 +3104,8 @@ export class LexerEx { } else if ( procName === "LUA" || procName === "PYTHON" || - procName === "RLANG" + procName === "RLANG" || + procName === "JULIA" ) { if (["SUBMIT", "INTERACTIVE", "I"].includes(word)) { const next = this.prefetch_({ pos: 1 }); diff --git a/server/src/sas/formatter/parser.ts b/server/src/sas/formatter/parser.ts index 6a2d35059..bc3899fe0 100644 --- a/server/src/sas/formatter/parser.ts +++ b/server/src/sas/formatter/parser.ts @@ -124,7 +124,7 @@ const preserveProcs = ( token: Token, model: Model, ) => { - // should not format python/R/lua, treat it as raw data + // should not format python/R/julia/lua, treat it as raw data const lastStatement = region.children.length >= 2 && region.children[region.children.length - 1].children; @@ -135,7 +135,7 @@ const preserveProcs = ( region.children[0].children.length > 0 && lastStatement.length > 1 && "text" in region.children[0].children[1] && - /^(python|lua|rlang)$/i.test(region.children[0].children[1].text) && + /^(python|lua|rlang|julia)$/i.test(region.children[0].children[1].text) && "text" in lastStatement[0] && /^(submit|interactive|i)$/i.test(lastStatement[0].text) ) { @@ -286,7 +286,7 @@ export const getParser = const node = tokens[i]; let parent = parents.length ? parents[parents.length - 1] : root; - //#region --- Preserve Python/R/Lua + //#region --- Preserve Python/R/Julia/Lua if (region && region.block) { preserveProc = preserveProcs(preserveProc, region, node, model); if (preserveProc === 0 && i === tokens.length - 1) { From 65c9393eff11a5e1ea009b4198c1ffc3f730a581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:29:41 +0000 Subject: [PATCH 32/34] adding func to detect and wrap Julia Code in Notebook --- client/src/components/ContentNavigator/convert.ts | 4 +++- client/src/components/notebook/Controller.ts | 2 +- client/src/components/utils/SASCodeDocument.ts | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/client/src/components/ContentNavigator/convert.ts b/client/src/components/ContentNavigator/convert.ts index 80a03568e..b35214b49 100644 --- a/client/src/components/ContentNavigator/convert.ts +++ b/client/src/components/ContentNavigator/convert.ts @@ -21,6 +21,7 @@ const stepRef: Record = { sql: "a7190700-f59c-4a94-afe2-214ce639fcde", python: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", rlang: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", + julia: "ab59f8c4-af9a-4608-a5d5-a8365357bb99", }; const stepTitle: Record = { @@ -28,6 +29,7 @@ const stepTitle: Record = { sql: l10n.t("SQL Program"), python: l10n.t("Python Program"), rlang: l10n.t("R Program"), + julia: l10n.t("Julia Program"), }; const NODE_SPACING = 150; @@ -307,7 +309,7 @@ function generateCodeListFromSASNotebook(content: string): Entry[] { let code = cell.value; if (code !== "") { const language = cell.language; - if (["python", "sas", "sql", "rlang"].includes(language)) { + if (["python", "sas", "sql", "rlang", "julia"].includes(language)) { if (language === "sql") { code = `PROC SQL; ${code}; diff --git a/client/src/components/notebook/Controller.ts b/client/src/components/notebook/Controller.ts index 26a161609..595600ceb 100644 --- a/client/src/components/notebook/Controller.ts +++ b/client/src/components/notebook/Controller.ts @@ -11,7 +11,7 @@ export class NotebookController { readonly controllerId = "sas-notebook-controller-id"; readonly notebookType = "sas-notebook"; readonly label = "SAS Notebook"; - readonly supportedLanguages = ["sas", "sql", "python", "r"]; + readonly supportedLanguages = ["sas", "sql", "python", "r", "julia"]; private readonly _controller: vscode.NotebookController; private _executionOrder = 0; diff --git a/client/src/components/utils/SASCodeDocument.ts b/client/src/components/utils/SASCodeDocument.ts index 56837979e..288b8f198 100644 --- a/client/src/components/utils/SASCodeDocument.ts +++ b/client/src/components/utils/SASCodeDocument.ts @@ -188,6 +188,14 @@ endsubmit; run;`; } + private wrapJulia(code: string) { + return `proc julia; +submit; +${code} +endsubmit; +run;`; + } + private insertLogStartIndicator(code: string): string { // add a comment line at the top of code, // this comment line will be used as indicator to the beginning of log related with this code @@ -210,6 +218,10 @@ ${code}`; wrapped = this.wrapRlang(wrapped); } + if (this.parameters.languageId === "julia") { + wrapped = this.wrapJulia(wrapped); + } + wrapped = this.wrapCodeWithSASProgramFileName(wrapped); wrapped = this.wrapCodeWithPreambleAndPostamble(wrapped); From b81d24e54ffb819ff3f9d0f0ec14b432fd66e76c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:30:02 +0000 Subject: [PATCH 33/34] adding code to export Julia code to HTML and/or SAS formats --- client/src/components/notebook/exporters/toHTML.ts | 2 ++ client/src/components/notebook/exporters/toSAS.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/client/src/components/notebook/exporters/toHTML.ts b/client/src/components/notebook/exporters/toHTML.ts index 917b85184..c117cd130 100644 --- a/client/src/components/notebook/exporters/toHTML.ts +++ b/client/src/components/notebook/exporters/toHTML.ts @@ -16,6 +16,7 @@ import { import { readFileSync } from "fs"; import hljs from "highlight.js/lib/core"; +import julia from "highlight.js/lib/languages/julia"; import python from "highlight.js/lib/languages/python"; import r from "highlight.js/lib/languages/r"; import sql from "highlight.js/lib/languages/sql"; @@ -30,6 +31,7 @@ const templatesDir = path.resolve(__dirname, "../notebook/exporters/templates"); hljs.registerLanguage("python", python); hljs.registerLanguage("r", r); hljs.registerLanguage("sql", sql); +hljs.registerLanguage("julia", julia); export const exportToHTML = async ( notebook: NotebookDocument, diff --git a/client/src/components/notebook/exporters/toSAS.ts b/client/src/components/notebook/exporters/toSAS.ts index d90674bf1..f9ee0cef3 100644 --- a/client/src/components/notebook/exporters/toSAS.ts +++ b/client/src/components/notebook/exporters/toSAS.ts @@ -19,6 +19,8 @@ const exportCell = (cell: NotebookCell) => { return wrapRlang(text); case "sql": return wrapSQL(text); + case "julia": + return wrapJulia(text); case "markdown": return `/*\n${text}\n*/`; } @@ -44,3 +46,9 @@ submit; ${code} endsubmit; run;`; + +const wrapJulia = (code: string) => `proc julia; +submit; +${code} +endsubmit; +run;`; From cf4dbe98b2f019e3a035b1adcf84777ff88d8fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijah=20C=C3=BAchulainn=20Reid?= <56865341+Wizzzzzzard@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:41:21 +0000 Subject: [PATCH 34/34] fixing test fixture by adding missing newline --- client/testFixture/sasnb_export.sas | 1 + 1 file changed, 1 insertion(+) diff --git a/client/testFixture/sasnb_export.sas b/client/testFixture/sasnb_export.sas index 3eeec2670..6af44c718 100644 --- a/client/testFixture/sasnb_export.sas +++ b/client/testFixture/sasnb_export.sas @@ -45,6 +45,7 @@ This is some Julia code /* This is a separate note in **Markdown** format. */ + proc julia; submit; dice=1:6