<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Juletip #2 – The REGION statement in SAS in SAS Community Nordic</title>
    <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/979833#M507</link>
    <description>&lt;P&gt;REGION isn’t actually a statement but a comment. When you start a comment with &lt;FONT face="courier new,courier" color="#008000"&gt;&lt;STRONG&gt;region&lt;/STRONG&gt;&lt;/FONT&gt;, SAS Studio recognizes it and treats the following lines – up to a comment marked &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#008000"&gt;/* endregion */&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;- as a collapsible block of code. This feature works in VS Code as well. It’s a practical way to group together data steps and procedures, allowing you to submit all the code in one go (&lt;FONT color="#000000"&gt;Run Region&lt;/FONT&gt;) without having to manually select large sections. Regions can also be nested, as shown in the demo and example code. In SAS Studio, these regions are collapsible also in the SAS Log, making code management even easier. For a demonstration, see the video. You can find the code further down.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6385836763112w960h540r360" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6385836763112" data-account="6058004174001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004174001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6385836763112w960h540r360');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://communities.sas.com/t5/video/gallerypage/video-id/6385836763112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* region main */

/* region connect to data */
libname xl XLSX "%sysget(HOME)/data/CARS.xlsx";
/* endregion */

/* region Fetch data */
proc sql noprint;
    create table WORK.CARS_Europe_raw as 
    select * from XL.cars
    where Origin='Europe';
quit;
proc sql noprint;
    create table WORK.CARS_Asia_raw as 
    select * from XL.cars
    where Origin='Asia';
quit;
/* endregion */

/* region Cleanse and enrich  */
data WORK.CARS_Europe;
    set WORK.CARS_Europe_raw;
    L10kmCity = 23.521 / 'MPG (City)'n;
    L10kmHighway = 23.521 / 'MPG (Highway)'n;
run;

data WORK.CARS_Asia;
    set WORK.CARS_Asia_raw;
    L10kmCity = 23.521 / 'MPG (City)'n;
    L10kmHighway = 23.521 / 'MPG (Highway)'n;
run;
/* endregion */

*Clean up...;
proc datasets lib=WORK nodetails nolist ;
    delete CARS_Asia_raw CARS_Europe_raw;
run;

/* endregion all steps */&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 02 Dec 2025 06:56:23 GMT</pubDate>
    <dc:creator>DanielRingqvist</dc:creator>
    <dc:date>2025-12-02T06:56:23Z</dc:date>
    <item>
      <title>Juletip #2 – The REGION statement in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/979833#M507</link>
      <description>&lt;P&gt;REGION isn’t actually a statement but a comment. When you start a comment with &lt;FONT face="courier new,courier" color="#008000"&gt;&lt;STRONG&gt;region&lt;/STRONG&gt;&lt;/FONT&gt;, SAS Studio recognizes it and treats the following lines – up to a comment marked &lt;STRONG&gt;&lt;FONT face="courier new,courier" color="#008000"&gt;/* endregion */&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;- as a collapsible block of code. This feature works in VS Code as well. It’s a practical way to group together data steps and procedures, allowing you to submit all the code in one go (&lt;FONT color="#000000"&gt;Run Region&lt;/FONT&gt;) without having to manually select large sections. Regions can also be nested, as shown in the demo and example code. In SAS Studio, these regions are collapsible also in the SAS Log, making code management even easier. For a demonstration, see the video. You can find the code further down.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6385836763112w960h540r347" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6385836763112" data-account="6058004174001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6058004174001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6385836763112w960h540r347');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://communities.sas.com/t5/video/gallerypage/video-id/6385836763112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* region main */

/* region connect to data */
libname xl XLSX "%sysget(HOME)/data/CARS.xlsx";
/* endregion */

/* region Fetch data */
proc sql noprint;
    create table WORK.CARS_Europe_raw as 
    select * from XL.cars
    where Origin='Europe';
quit;
proc sql noprint;
    create table WORK.CARS_Asia_raw as 
    select * from XL.cars
    where Origin='Asia';
quit;
/* endregion */

/* region Cleanse and enrich  */
data WORK.CARS_Europe;
    set WORK.CARS_Europe_raw;
    L10kmCity = 23.521 / 'MPG (City)'n;
    L10kmHighway = 23.521 / 'MPG (Highway)'n;
run;

data WORK.CARS_Asia;
    set WORK.CARS_Asia_raw;
    L10kmCity = 23.521 / 'MPG (City)'n;
    L10kmHighway = 23.521 / 'MPG (Highway)'n;
run;
/* endregion */

*Clean up...;
proc datasets lib=WORK nodetails nolist ;
    delete CARS_Asia_raw CARS_Europe_raw;
run;

/* endregion all steps */&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Dec 2025 06:56:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/979833#M507</guid>
      <dc:creator>DanielRingqvist</dc:creator>
      <dc:date>2025-12-02T06:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Juletip #2 – The REGION statement in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/980511#M515</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/26870"&gt;@DanielRingqvist&lt;/a&gt;&amp;nbsp; &amp;nbsp;Does this Work on SAS Studio&amp;nbsp;&lt;STRONG&gt;Release: 3.82 (Enterprise Edition)&amp;nbsp; &lt;/STRONG&gt;which comes with SAS 9.4M8?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried but it does not seem to working.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 21:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/980511#M515</guid>
      <dc:creator>pchegoor1</dc:creator>
      <dc:date>2025-12-09T21:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Juletip #2 – The REGION statement in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/980513#M516</link>
      <description>It does not as far as I am aware. As you're on SAS9, have you tried VS Code with the SAS Extension? It's supported in the same way (not in the LOG however.) Brilliant UI against your local or remote SAS9 and so easy to get started.</description>
      <pubDate>Tue, 09 Dec 2025 21:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Community-Nordic/Juletip-2-The-REGION-statement-in-SAS/m-p/980513#M516</guid>
      <dc:creator>DanielRingqvist</dc:creator>
      <dc:date>2025-12-09T21:38:26Z</dc:date>
    </item>
  </channel>
</rss>

