<?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: Add a vertical reference line to time series plot in sas in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722272#M80225</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/317497"&gt;@xliu1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I try to add a vertical reference line to a time series plot to indicate the year where the forecast starts, but keep getting this error message in sas log. The variable AY has the datetime format Year4. The sas code works for the plot until I add the refline statement. Will appreciate any help with the refline statement! Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1614375450471.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55250iE3175D3E105152AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1614375450471.png" alt="xliu1_0-1614375450471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT DATA=BACHDEG_Forecast;
BAND Upper=u95 Lower=l95 x=AY / Legendlabel="95% Confidence Limits";
scatter x=AY y=degrees_usf;
series x=AY y=forecast;
refline "AY=2022" / axis=x lineattrs=(thickness=1 color=BLUE pattern=dash);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;REFLINE wants either a VARIABLE or an explicit Value that is associated with the Axis.&lt;/P&gt;
&lt;P&gt;So one of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refline AY / &amp;lt;options&amp;gt;;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;refline 2022 /&amp;lt;options&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"AY=2022" would only be valid if the value "AY=2022" appears on your x axis, meaning the axis would be character valued.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the axis is a date value then you would use a date literal value like "01JAN2022"d to provide a date. If you haven't used date literals before they &lt;STRONG&gt;must&lt;/STRONG&gt; be in the Date9 (better) or Date7 appearance, in quotes, with the d immediately following the value.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Feb 2021 06:18:23 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-27T06:18:23Z</dc:date>
    <item>
      <title>Add a vertical reference line to time series plot in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722259#M80224</link>
      <description>&lt;P&gt;I try to add a vertical reference line to a time series plot to indicate the year where the forecast starts, but keep getting this error message in sas log. The variable AY has the datetime format Year4. The sas code works for the plot until I add the refline statement. Will appreciate any help with the refline statement! Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1614375450471.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55250iE3175D3E105152AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1614375450471.png" alt="xliu1_0-1614375450471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT DATA=BACHDEG_Forecast;
BAND Upper=u95 Lower=l95 x=AY / Legendlabel="95% Confidence Limits";
scatter x=AY y=degrees_usf;
series x=AY y=forecast;
refline "AY=2022" / axis=x lineattrs=(thickness=1 color=BLUE pattern=dash);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2021 21:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722259#M80224</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2021-02-26T21:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add a vertical reference line to time series plot in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722272#M80225</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/317497"&gt;@xliu1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I try to add a vertical reference line to a time series plot to indicate the year where the forecast starts, but keep getting this error message in sas log. The variable AY has the datetime format Year4. The sas code works for the plot until I add the refline statement. Will appreciate any help with the refline statement! Thanks!&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xliu1_0-1614375450471.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55250iE3175D3E105152AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xliu1_0-1614375450471.png" alt="xliu1_0-1614375450471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SGPLOT DATA=BACHDEG_Forecast;
BAND Upper=u95 Lower=l95 x=AY / Legendlabel="95% Confidence Limits";
scatter x=AY y=degrees_usf;
series x=AY y=forecast;
refline "AY=2022" / axis=x lineattrs=(thickness=1 color=BLUE pattern=dash);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;REFLINE wants either a VARIABLE or an explicit Value that is associated with the Axis.&lt;/P&gt;
&lt;P&gt;So one of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refline AY / &amp;lt;options&amp;gt;;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;refline 2022 /&amp;lt;options&amp;gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"AY=2022" would only be valid if the value "AY=2022" appears on your x axis, meaning the axis would be character valued.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the axis is a date value then you would use a date literal value like "01JAN2022"d to provide a date. If you haven't used date literals before they &lt;STRONG&gt;must&lt;/STRONG&gt; be in the Date9 (better) or Date7 appearance, in quotes, with the d immediately following the value.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 06:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722272#M80225</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-27T06:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Add a vertical reference line to time series plot in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722289#M80226</link>
      <description>&lt;P&gt;Thanks. It works out perfectly!&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 01:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722289#M80226</guid>
      <dc:creator>xliu1</dc:creator>
      <dc:date>2021-02-27T01:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Add a vertical reference line to time series plot in sas</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722412#M80229</link>
      <description>&lt;P&gt;For more tricks you can do with reference lines and labels, see &lt;A href="https://blogs.sas.com/content/iml/2020/04/13/horizontal-vertical-reference-lines-sas.html" target="_self"&gt;"Add horizontal and vertical reference lines to SAS graphs: The REFLINE statement".&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Feb 2021 12:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-a-vertical-reference-line-to-time-series-plot-in-sas/m-p/722412#M80229</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-02-28T12:06:23Z</dc:date>
    </item>
  </channel>
</rss>

