<?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 Re: Display message in editor window in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342403#M78512</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Using an interactive window in 'full' SAS to stop a merge

inspired by
https://goo.gl/JFdCp1
https://communities.sas.com/t5/Base-SAS-Programming/Display-message-in-editor-window/m-p/342380

If manager='' in dataset temp1 then pop up an interactive
window asking the user if he would rather not update
temp1 using temp2

HAVE   TEMP1 and TEMP2
==================================

Up to 40 obs from TEMP1 total obs=4

Obs    KEY    MANAGER    PROJECT    COST

 1      1     Alfred        14      69.0
 2      2     Alice         13      56.5
 3      3                    .        .    Missing in TEMP1
 4      4     Janet         15      62.5



Up to 40 obs TEMP2 total obs=3

Obs    KEY    MANAGER    PROJECT    COST

 1      1                    .        .
 2      2                    .        .
 3      3     Barbara       13      65.3  Manager Present in TEMP2 then stop
 4      4                    .        .


WANT ( if manager is missing in temp1 and is populated in
       temp2 pop up this window

+---------------------------+
| COMMAND ====&amp;gt;              |
|                            |
|       Continue Y/N _       |
|                            |
+---------------------------+

IF 'N' is entered

Up to 40 obs from AVAILABLE total obs=3

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3


Up to 40 obs WORK.NOT_AVAILABLE total obs=1

Obs    KEY    MANAGER    PROJECT    COST

 1      3     Barbara       13      65.3

IF 'Y' then

Up to 40 obs from AVAILABLE total obs=4

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3
 4      4     Janet      Janet          .        .


NOTE: No observations in data set WORK.NOT_AVAILABLE.

WORKING CODE
============

  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;

FULL SOLUTION
=============

data available not_available(drop=sav_manager);
  retain key manager;
  retain  yn '_';
  merge temp1(in=a rename=manager=sav_manager) temp2;
  by key;
  if a then do;
      manager=coalescec(sav_manager,manager);
      output available;
  end;
  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;
  if yn="N" then do;
     manager=coalescec(sav_manager,manager);
     output not_available;
     stop;
  end;
  drop yn;
run;quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 19 Mar 2017 21:34:42 GMT</pubDate>
    <dc:creator>rogerjdeangelis</dc:creator>
    <dc:date>2017-03-19T21:34:42Z</dc:date>
    <item>
      <title>Display message in editor window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342380#M78502</link>
      <description>&lt;P&gt;data available &amp;nbsp;not_available;&lt;/P&gt;
&lt;P&gt;merge _temp1 (in=a) _temp2 (in=b); &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;/* One - To - One Join*/&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;by x;&lt;/P&gt;
&lt;P&gt;if a then output available;&lt;/P&gt;
&lt;P&gt;if manager = '' then output not_available;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the above code, i am pulling information from _temp2 like manager, project details to _temp1 based on my common variable x.&lt;/P&gt;
&lt;P&gt;so dataset "available" will have all the observations coming from _temp1 based on "if" filter. the second dataset "not available" will have observations if my mangager details are missing in "available" dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if by chance, if the values are present in "not_available" dataset then sas should stop executing. it should display a message in editor window that "Manager details are missing. Please check".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me on this, is there any way i can pop up messages in editor window&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 18:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342380#M78502</guid>
      <dc:creator>SMohanReddy</dc:creator>
      <dc:date>2017-03-19T18:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Display message in editor window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342382#M78503</link>
      <description>&lt;P&gt;%Window&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 18:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342382#M78503</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-19T18:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: Display message in editor window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342403#M78512</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Using an interactive window in 'full' SAS to stop a merge

inspired by
https://goo.gl/JFdCp1
https://communities.sas.com/t5/Base-SAS-Programming/Display-message-in-editor-window/m-p/342380

If manager='' in dataset temp1 then pop up an interactive
window asking the user if he would rather not update
temp1 using temp2

HAVE   TEMP1 and TEMP2
==================================

Up to 40 obs from TEMP1 total obs=4

Obs    KEY    MANAGER    PROJECT    COST

 1      1     Alfred        14      69.0
 2      2     Alice         13      56.5
 3      3                    .        .    Missing in TEMP1
 4      4     Janet         15      62.5



Up to 40 obs TEMP2 total obs=3

Obs    KEY    MANAGER    PROJECT    COST

 1      1                    .        .
 2      2                    .        .
 3      3     Barbara       13      65.3  Manager Present in TEMP2 then stop
 4      4                    .        .


WANT ( if manager is missing in temp1 and is populated in
       temp2 pop up this window

+---------------------------+
| COMMAND ====&amp;gt;              |
|                            |
|       Continue Y/N _       |
|                            |
+---------------------------+

IF 'N' is entered

Up to 40 obs from AVAILABLE total obs=3

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3


Up to 40 obs WORK.NOT_AVAILABLE total obs=1

Obs    KEY    MANAGER    PROJECT    COST

 1      3     Barbara       13      65.3

IF 'Y' then

Up to 40 obs from AVAILABLE total obs=4

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3
 4      4     Janet      Janet          .        .


NOTE: No observations in data set WORK.NOT_AVAILABLE.

WORKING CODE
============

  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;

FULL SOLUTION
=============

data available not_available(drop=sav_manager);
  retain key manager;
  retain  yn '_';
  merge temp1(in=a rename=manager=sav_manager) temp2;
  by key;
  if a then do;
      manager=coalescec(sav_manager,manager);
      output available;
  end;
  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;
  if yn="N" then do;
     manager=coalescec(sav_manager,manager);
     output not_available;
     stop;
  end;
  drop yn;
run;quit;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Mar 2017 21:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342403#M78512</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-19T21:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Display message in editor window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342404#M78513</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Using an interactive window in 'full' SAS to stop a merge

inspired by
https://goo.gl/JFdCp1
https://communities.sas.com/t5/Base-SAS-Programming/Display-message-in-editor-window/m-p/342380

If manager='' in dataset temp1 then pop up an interactive
window asking the user if he would rather not update
temp1 using temp2

HAVE   TEMP1 and TEMP2
==================================

Up to 40 obs from TEMP1 total obs=4

Obs    KEY    MANAGER    PROJECT    COST

 1      1     Alfred        14      69.0
 2      2     Alice         13      56.5
 3      3                    .        .    Missing in TEMP1
 4      4     Janet         15      62.5



Up to 40 obs TEMP2 total obs=3

Obs    KEY    MANAGER    PROJECT    COST

 1      1                    .        .
 2      2                    .        .
 3      3     Barbara       13      65.3  Manager Present in TEMP2 then stop
 4      4                    .        .


WANT ( if manager is missing in temp1 and is populated in
       temp2 pop up this window

+---------------------------+
| COMMAND ====&amp;gt;              |
|                            |
|       Continue Y/N _       |
|                            |
+---------------------------+

IF 'N' is entered

Up to 40 obs from AVAILABLE total obs=3

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3


Up to 40 obs WORK.NOT_AVAILABLE total obs=1

Obs    KEY    MANAGER    PROJECT    COST

 1      3     Barbara       13      65.3

IF 'Y' then

Up to 40 obs from AVAILABLE total obs=4

                          SAV_
Obs    KEY    MANAGER    MANAGER    PROJECT    COST

 1      1     Alfred     Alfred         .        .
 2      2     Alice      Alice          .        .
 3      3     Barbara                  13      65.3
 4      4     Janet      Janet          .        .


NOTE: No observations in data set WORK.NOT_AVAILABLE.

WORKING CODE
============

  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;

FULL SOLUTION
=============

data available not_available(drop=sav_manager);
  retain key manager;
  retain  yn '_';
  merge temp1(in=a rename=manager=sav_manager) temp2;
  by key;
  if a then do;
      manager=coalescec(sav_manager,manager);
      output available;
  end;
  if sav_manager='' then do;
       window dsn irow=1 rows=12 color=white
          #3 @10
          "Continue Y/N:" +1 YN $1.;
        display dsn;
  end;
  if yn="N" then do;
     manager=coalescec(sav_manager,manager);
     output not_available;
     stop;
  end;
  drop yn;
run;quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 21:35:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-message-in-editor-window/m-p/342404#M78513</guid>
      <dc:creator>rogerjdeangelis</dc:creator>
      <dc:date>2017-03-19T21:35:30Z</dc:date>
    </item>
  </channel>
</rss>

