<?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: PROC SHEWHART Separate HREF per BY Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685546#M207934</link>
    <description>&lt;P&gt;Thanks Reeza, your comment got me thinking more about what to set _VAR_ to and I was able to figure it out.&lt;/P&gt;&lt;P&gt;The out table no longer had x4 in it, so I had to create a new column with x4 that _VAR_ in my_process_tbl could reference.&lt;/P&gt;&lt;P&gt;Next, I had to add a _VAR_ column in href_data that contains x4 for each row.&lt;/P&gt;&lt;P&gt;And that did the trick!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The working code is below:&lt;/P&gt;&lt;PRE&gt;/* HREF Data Table Test */

*Closes html results;
ods html close;

*DM Submits a SAS statement to the Program Editor, Log, or Procedure Output;
dm log "OUT; CLEAR; LOG; CLEAR;" log continue;
dm log 'next results; clear; cancel;' whostedit continue;

*Creates a new html result;
ods html newfile=none;

%LET data_loc = C:\Users\NAOG\Desktop\Projects\Weekly CC Alerts\Add Vertical Line PROC SHEWART;
LIBNAME mylib "&amp;amp;data_loc";


DATA my_process;
INPUT x1 $ x2 $ x3 $ x4 group time;
DATALINES;
a a a 1 1 1
a a a 2 1 2
a a a 1 1 3
a a a 3 1 4
a a b 1 2 1
a a b 4 2 2
a a b 5 2 3
a a b 6 2 4
a b a 3 3 1
a b a 2 3 2
a b a 1 3 3
a b a 10 3 4
a b b 4 4 1
a b b 0 4 2
a b b 5 4 3
a b b 15 4 4
b a a 2 5 1
b a a 2 5 2
b a a 2 5 3
b a a 2 5 4
b a b 1 6 1
b a b 1 6 2
b a b 1 6 3
b a b 1 6 4
b b a 5 7 1
b b a 5 7 2
b b a 5 7 3
b b a 5 7 4
b b b 4 8 1
b b b 4 8 2
b b b 4 8 3
b b b 4 8 4
;
RUN;

DATA href_data;
INPUT x1 $ x2 $ x3 $ _REF_;
DATALINES;
a a a 1
a a b 1
a b a 1
a b b 3
b a a 4
b a b 2
b b a 2
b b b 3
;
RUN;

PROC SHEWHART DATA = my_process; BY x1 x2 x3;
	IRCHART x4*time / href= href_data outlimits = my_process_lims outtable = my_process_tbl;
RUN;


DATA href_data;
INPUT x1 $ x2 $ x3 $ _REF_ _VAR_ $;
DATALINES;
a a a 1 x4
a a b 1 x4
a b a 1 x4
a b b 3 x4
b a a 4 x4
b a b 2 x4
b b a 2 x4
b b b 3 x4
;
RUN;

DATA my_process_tbl;
	SET  my_process_tbl;
	x4 = _SUBI_;
RUN;


PROC SHEWHART TABLE = my_process_tbl;
BY x1 x2 x3;
IRCHART x4*time / href = href_Data;
RUN;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 Sep 2020 20:53:27 GMT</pubDate>
    <dc:creator>narnia649</dc:creator>
    <dc:date>2020-09-21T20:53:27Z</dc:date>
    <item>
      <title>PROC SHEWHART Separate HREF per BY Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685537#M207930</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Question:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;How do I get href to display different per by variable group using the PROC SHEWHARTS &amp;amp; TABLE= option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling to get a separate HREF to occur per by variable when using the PROC SHEWHARTS &amp;amp; TABLE option.&lt;/P&gt;&lt;P&gt;I can get it to work if I use DATA instead of TABLE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My fake data below shows 3 grouping variables (X1-X3), a measurement (X4), a unique value that represents the combination of X1-X3 &amp;amp; a sequential time for each group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use, DATA=my_process, it works exactly as I want. It outputs the control charts with reference lines based on the _REF_ variable inside the href_data data table. For example, when x1=a, x2=b, x3= b or abb combination, the href is drawn at time step 3 as outlined by the href_data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="narnia649_0-1600719676984.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/49621iC710F2B31826B850/image-size/medium?v=v2&amp;amp;px=400" role="button" title="narnia649_0-1600719676984.png" alt="narnia649_0-1600719676984.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I output the data as a table and run PROC SHEWHART TABLE = my_process_tbl, I get a Warning message: "No match between the values of _VAR_ in MY_PROCESS_TBL and one or more process variable&lt;BR /&gt;names."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do I have to change in the my_process_tbl to get the href to work again?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA my_process;
INPUT x1 $ x2 $ x3 $ x4 group time;
DATALINES;
a a a 1 1 1
a a a 2 1 2
a a a 1 1 3
a a a 3 1 4
a a b 1 2 1
a a b 4 2 2
a a b 5 2 3
a a b 6 2 4
a b a 3 3 1
a b a 2 3 2
a b a 1 3 3
a b a 10 3 4
a b b 4 4 1
a b b 0 4 2
a b b 5 4 3
a b b 15 4 4
b a a 2 5 1
b a a 2 5 2
b a a 2 5 3
b a a 2 5 4
b a b 1 6 1
b a b 1 6 2
b a b 1 6 3
b a b 1 6 4
b b a 5 7 1
b b a 5 7 2
b b a 5 7 3
b b a 5 7 4
b b b 4 8 1
b b b 4 8 2
b b b 4 8 3
b b b 4 8 4
;
RUN;

DATA href_data;
INPUT x1 $ x2 $ x3 $ _REF_;
DATALINES;
a a a 1
a a b 1
a b a 1
a b b 3
b a a 4
b a b 2
b b a 2
b b b 3
;
RUN;

PROC SHEWHART DATA = my_process; BY x1 x2 x3;
	IRCHART x4*time / href= href_data outlimits = my_process_lims outtable = my_process_tbl;
RUN;

PROC SHEWHART TABLE = my_process_tbl;
BY x1 x2 x3;
IRCHART _SUBI_*time / href = href_Data;
RUN;&lt;/PRE&gt;&lt;P&gt;Thanks in advance for your help on this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:23:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685537#M207930</guid>
      <dc:creator>narnia649</dc:creator>
      <dc:date>2020-09-21T20:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART Separate HREF per BY Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685539#M207932</link>
      <description>Do you maybe need to include the _VAR_ in the href_data dataset?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685539#M207932</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-21T20:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART Separate HREF per BY Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685543#M207933</link>
      <description>&lt;P&gt;I tried a few ways of setting _VAR_ in the href_data table, but none seemed to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still get the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would you set the _VAR_ to?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685543#M207933</guid>
      <dc:creator>narnia649</dc:creator>
      <dc:date>2020-09-21T20:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART Separate HREF per BY Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685546#M207934</link>
      <description>&lt;P&gt;Thanks Reeza, your comment got me thinking more about what to set _VAR_ to and I was able to figure it out.&lt;/P&gt;&lt;P&gt;The out table no longer had x4 in it, so I had to create a new column with x4 that _VAR_ in my_process_tbl could reference.&lt;/P&gt;&lt;P&gt;Next, I had to add a _VAR_ column in href_data that contains x4 for each row.&lt;/P&gt;&lt;P&gt;And that did the trick!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The working code is below:&lt;/P&gt;&lt;PRE&gt;/* HREF Data Table Test */

*Closes html results;
ods html close;

*DM Submits a SAS statement to the Program Editor, Log, or Procedure Output;
dm log "OUT; CLEAR; LOG; CLEAR;" log continue;
dm log 'next results; clear; cancel;' whostedit continue;

*Creates a new html result;
ods html newfile=none;

%LET data_loc = C:\Users\NAOG\Desktop\Projects\Weekly CC Alerts\Add Vertical Line PROC SHEWART;
LIBNAME mylib "&amp;amp;data_loc";


DATA my_process;
INPUT x1 $ x2 $ x3 $ x4 group time;
DATALINES;
a a a 1 1 1
a a a 2 1 2
a a a 1 1 3
a a a 3 1 4
a a b 1 2 1
a a b 4 2 2
a a b 5 2 3
a a b 6 2 4
a b a 3 3 1
a b a 2 3 2
a b a 1 3 3
a b a 10 3 4
a b b 4 4 1
a b b 0 4 2
a b b 5 4 3
a b b 15 4 4
b a a 2 5 1
b a a 2 5 2
b a a 2 5 3
b a a 2 5 4
b a b 1 6 1
b a b 1 6 2
b a b 1 6 3
b a b 1 6 4
b b a 5 7 1
b b a 5 7 2
b b a 5 7 3
b b a 5 7 4
b b b 4 8 1
b b b 4 8 2
b b b 4 8 3
b b b 4 8 4
;
RUN;

DATA href_data;
INPUT x1 $ x2 $ x3 $ _REF_;
DATALINES;
a a a 1
a a b 1
a b a 1
a b b 3
b a a 4
b a b 2
b b a 2
b b b 3
;
RUN;

PROC SHEWHART DATA = my_process; BY x1 x2 x3;
	IRCHART x4*time / href= href_data outlimits = my_process_lims outtable = my_process_tbl;
RUN;


DATA href_data;
INPUT x1 $ x2 $ x3 $ _REF_ _VAR_ $;
DATALINES;
a a a 1 x4
a a b 1 x4
a b a 1 x4
a b b 3 x4
b a a 4 x4
b a b 2 x4
b b a 2 x4
b b b 3 x4
;
RUN;

DATA my_process_tbl;
	SET  my_process_tbl;
	x4 = _SUBI_;
RUN;


PROC SHEWHART TABLE = my_process_tbl;
BY x1 x2 x3;
IRCHART x4*time / href = href_Data;
RUN;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:53:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685546#M207934</guid>
      <dc:creator>narnia649</dc:creator>
      <dc:date>2020-09-21T20:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SHEWHART Separate HREF per BY Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685547#M207935</link>
      <description>Great, glad to hear you got it working and figured out how to specify it properly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 21 Sep 2020 20:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SHEWHART-Separate-HREF-per-BY-Variable/m-p/685547#M207935</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-09-21T20:56:24Z</dc:date>
    </item>
  </channel>
</rss>

