<?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 How we can find specific coordinates on a plot and measure height difference in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313392#M21135</link>
    <description>&lt;P&gt;I have data set which has daily observations of X Y cordinates. The sample dats is available at the bottom:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have plotted some of the data and plots are shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5943iA35E2A91E12123F2/image-size/original?v=v2&amp;amp;px=-1" alt="sample plots" title="sample plots" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want to do is to find the mid points and highest points on the curves as shown in the pictures.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One plot is for data on 28Sep16 and other on 17Nov16 (X, Y cords).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to know the different in hieghts on these points (top and mid). Y can be treated as height in 'mm'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can someone please help? Thanks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;attached as code12.txt&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Nov 2016 11:16:57 GMT</pubDate>
    <dc:creator>imanojkumar1</dc:creator>
    <dc:date>2016-11-22T11:16:57Z</dc:date>
    <item>
      <title>How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313392#M21135</link>
      <description>&lt;P&gt;I have data set which has daily observations of X Y cordinates. The sample dats is available at the bottom:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have plotted some of the data and plots are shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5943iA35E2A91E12123F2/image-size/original?v=v2&amp;amp;px=-1" alt="sample plots" title="sample plots" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want to do is to find the mid points and highest points on the curves as shown in the pictures.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;One plot is for data on 28Sep16 and other on 17Nov16 (X, Y cords).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to know the different in hieghts on these points (top and mid). Y can be treated as height in 'mm'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can someone please help? Thanks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;attached as code12.txt&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 11:16:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313392#M21135</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T11:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313403#M21137</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do not post links to websites in your post. &amp;nbsp;Post test data as text in the form of a datastep in the post. &amp;nbsp;You can follow this guidance if you need help to get this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For your question, the graph is merely a representation of your data, hence any value you need to arrive at should be calculatable from the data. &amp;nbsp;For instance, your first "point" would be max(of variable plotted on Y axis). &amp;nbsp;The next point maybe mean/median of the values on the Y axis (not entirely sure from what you posted), and the final point would be mean/median of X axis variable. &amp;nbsp;So you can use proc means to get all of the above information.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 10:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313403#M21137</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-22T10:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313411#M21139</link>
      <description>&lt;P&gt;Post data here better or attach a txt file.&lt;/P&gt;
&lt;P&gt;You can use DIF() to get it. if dif() change from positive into negative, then it is highest &amp;nbsp;value.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/08/28/finite-diff-estimate-maxi.html" target="_blank"&gt;http://blogs.sas.com/content/iml/2013/08/28/finite-diff-estimate-maxi.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If dif() = next dif() then it shoulde be mid value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 10:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313411#M21139</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-22T10:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313416#M21140</link>
      <description>&lt;P&gt;Since data size is larger than allowable limit of 200,000, I am attaching it in data step in .txt file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that date format (Date18.) is not correct format &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; for the datetimestamp type i have in data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 11:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313416#M21140</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T11:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313417#M21141</link>
      <description>Hi Ksharp I have attacted the data as data step in text file above with my question. Thanks for suggetion. Please note that date format (Date18.) is not correct format for the datetimestamp type I have in data.</description>
      <pubDate>Tue, 22 Nov 2016 11:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313417#M21141</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T11:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313422#M21142</link>
      <description>&lt;P&gt;I am trying something lile this one..... but I dont know how to find other mid points and calculate difference in Heights at those coordinates...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
     CREATE VIEW WORK.XYData AS
           SELECT T.X, T.Y
     FROM mydata as T
;
QUIT;

PROC SQL;
SELECT MAX(Y) FORMAT=6.2 LABEL='MAXY' INTO : MAXY FROM
WORK.XYData ;
QUIT;
&lt;BR /&gt;DATA WORK.MAXY ;
SET WORK.XYData;
Where Y=&amp;amp;MAXY. ;
RUN;

PROC SQL;
SELECT X FORMAT=6.2 LABEL='MAXY_X' INTO : MAXX FROM
WORK.MAXY ;
QUIT;

/* DATA WORK.MINY_X ;
SET WORK.XYData ;
Where Y&amp;gt;0. ;
RUN;*/

PROC SQL;
SELECT MIN(Y) FORMAT=6.2 LABEL='MINY' INTO : MINY FROM WORK.XYData 
Where Y&amp;gt;=0.;
QUIT;

%put &amp;amp;MINY.;

DATA WORK.MINY_X ;
SET WORK.XYData;
Where Y=&amp;amp;MINY. ;
RUN;

PROC SQL;
SELECT X FORMAT=6.2 LABEL='MINY_X' INTO : MINY_X FROM
WORK.MINY_X ;
QUIT;

%put &amp;amp;MINY_X;
/* End of custom user code. */
SYMBOL1
     INTERPOL=SM0
     HEIGHT=10pt
     VALUE=NONE
     LINE=1
     WIDTH=2
     CV = _STYLE_;
Axis1
     STYLE=1
     WIDTH=1
     ORDER=(-70000 TO 40000 BY 5000)
     MINOR=NONE;
Axis2
     STYLE=34
     WIDTH=1
     ORDER=-20000 TO 140000 BY 5000
     MINOR=NONE
     LABEL=NONE;
TITLE;
TITLE1 "Line Plot";
FOOTNOTE;
FOOTNOTE1 "";


PROC GPLOT DATA = WORK.XYData
;
PLOT Y * X  /
     VAXIS=AXIS1
     HAXIS=AXIS2
NOFRAME    
     LHREF=1
     CHREF=BLACK
     LVREF=1
     CVREF=BLACK
     VREF=0

VREF=-10000
VREF=&amp;amp;MAXY.
HREF=&amp;amp;MAXX.
HREF=&amp;amp;MINY_X.
/* End of custom user code. */
;
RUN; QUIT;

TITLE; FOOTNOTE;
GOPTIONS RESET = SYMBOL;


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 11:37:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313422#M21142</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T11:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313434#M21143</link>
      <description>&lt;P&gt;You have overcomplicated things a bit there. &amp;nbsp;First some tips - I would suggest move to a modern graphing system - SGPLOT and Graph Template Language. &amp;nbsp;I would also suggest code formatting, consitent indentation/casing and such like to make code readable. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your problem can simplfy to, get values you need, add them to the data, overlay the points you want:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table G as
  select  A.*,
          B.MAX_Y,
          B.MAX_X,
          B.MIN_Y
  from    WORK.XYDATA A
  left join (select MAX(Y) as MAX_Y,
                    MAX(X) as MAX_X,
                    MIN(Y) as MIN_Y
             from   WORK.XYDATA) B
  on      1=1;
quit;
             
title1 "Line Plot";
footnote;
footnote1 "";

proc sgplot data=g;
  series y=y x=x;
  scatter y=max_y / datalabel=max_y;
  scatter y=max_x / datalabel=max_x;
  scatter y=min_y / datalabel=min_y;
run;&lt;/PRE&gt;
&lt;P&gt;Not tested this of course, but something like that should work. &amp;nbsp;The scatter puts a point at max value and the datalabel tells it to add teh value as the label. &amp;nbsp;There are many options with GTL/Sgplot.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:02:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313434#M21143</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-22T12:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313441#M21144</link>
      <description>&lt;P&gt;I got errors...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;35           scatter y=MAX_Y / datalabel=MAX_Y;
                            _
                            79
                            76
36           scatter y=MAX_X / datalabel=MAX_X;
                            _
                            79
                            76
37           scatter y=MIN_Y / datalabel=MIN_Y;
                            _
                            79
2                                                          The SAS System                           13:59 Tuesday, November 22, 2016

                            76
ERROR 79-322: Expecting a X.
ERROR 76-322: Syntax error, statement will be ignored.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:13:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313441#M21144</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T12:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313448#M21145</link>
      <description>&lt;P&gt;This could give a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
infile '/folders/myfolders/code12.txt' truncover;
  input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
  format DateTimeStamp datetime.;
  dif_y=dif(y);
  dif_x=dif(x);
run;

data x;
 merge x x(keep=dif_y dif_x rename=(dif_x=_dif_x dif_y=_dif_y) firstobs=2);
 d1=divide(dif_y,dif_x);
 d2=divide(_dif_y,_dif_x);
 if d1 gt 0 and d2 lt 0 and not missing(d2) or
   d1 lt -1 and -1 lt d2 lt 0 then do;
  if abs(dif_x) gt 2 then do;x1=x;y1=y;
  put dif_x= dif_y= _dif_x= _dif_y=;end;
 end;
run;



ods graphics/ANTIALIASMAX=5200;
proc sgplot data=x;
series x=x y=y /smoothconnect;
scatter x=x1 y=y1/ markerattrs=graphdata2(symbol=starfilled) ;
yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313448#M21145</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-22T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313449#M21146</link>
      <description>&lt;P&gt;Yes, as mentioned, not tested. &amp;nbsp;The error tells you what you need to know:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;scatter y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;MAX_Y x=x &lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt; datalabel&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;MAX_Y&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:54:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313449#M21146</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-22T12:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313451#M21147</link>
      <description>&lt;P&gt;This could be better.Your data has a little problem &amp;nbsp;, check LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
infile '/folders/myfolders/code12.txt' truncover;
  input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
  format DateTimeStamp datetime.;
  dif_y=dif(y);
  dif_x=dif(x);
run;


data x;
 merge x x(keep=dif_y dif_x rename=(dif_x=_dif_x dif_y=_dif_y) firstobs=2);
 d1=divide(dif_y,dif_x);
 d2=divide(_dif_y,_dif_x);
 if (0 lt d1 lt 0.02 and -0.02 lt d2 lt 0 ) or
  ( -1.02 lt d1 lt -1 and -1 lt d2 lt -0.98 ) then do;
  x1=x;y1=y;
  put dif_x= dif_y= _dif_x= _dif_y=;
 end;
run;



ods graphics/ANTIALIASMAX=5200;
proc sgplot data=x;
series x=x y=y /smoothconnect;
scatter x=x1 y=y1/ markerattrs=graphdata2(symbol=starfilled) ;
yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5946i29218B47FC695F1F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313451#M21147</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-22T12:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313457#M21148</link>
      <description>&lt;P&gt;This could be right.Chec coordinates in LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x;
infile '/folders/myfolders/code12.txt' truncover;
  input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
  format DateTimeStamp datetime.;
  dif_y=dif(y);
  dif_x=dif(x);
run;


data x;
 merge x x(keep=dif_y dif_x rename=(dif_x=_dif_x dif_y=_dif_y) firstobs=2);
 d1=divide(dif_y,dif_x);
 d2=divide(_dif_y,_dif_x);
 if (0 lt d1 lt 0.02 and -0.02 lt d2 lt 0 ) or
  ( -1.02 lt d1 lt -1 and -1 lt d2 lt -0.98 ) then do;
 if  dif_x ne 201 then do; x1=x;y1=y;
  put dif_x= dif_y= _dif_x= _dif_y=;end;
 end;
run;



ods graphics/ANTIALIASMAX=5200;
proc sgplot data=x;
series x=x y=y /smoothconnect;
scatter x=x1 y=y1/ markerattrs=graphdata2(symbol=starfilled) ;
yaxis grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/5947i62407B7966FE20A4/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="x.png" title="x.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 13:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313457#M21148</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-22T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313489#M21149</link>
      <description>Got It ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 22 Nov 2016 15:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313489#M21149</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T15:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313523#M21151</link>
      <description>&lt;P&gt;There are issues, sorry.... Now I understand why you were getting errors, I must clarify...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. The data of X, Y where MNo. = 1 to 1260 (Date = 28SEP16:09:03:05, ASN=20) is one set of data -&amp;nbsp;we have to keep it&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;The data of X, Y where MNo. = &lt;STRONG&gt;1174 to 1243&lt;/STRONG&gt; (Date = 14Nov16, ASN=5) is another&amp;nbsp;set of data - which we can ommit because it is incomlete (from 1174 to 1243 rows only)&lt;/P&gt;&lt;P&gt;3. The data of X, Y where MNo. = 1 to 1257&amp;nbsp;(Date = 14Nov16, ASN=20) is another&amp;nbsp;set of data - we have to keep it&lt;/P&gt;&lt;P&gt;4. The data of X, Y where MNo. = 1 to 1282 (Date = 17Nov16:09:00:47, ASN=20) is another&amp;nbsp;set of data -&amp;nbsp;&lt;SPAN&gt;we have to keep it&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;5.&amp;nbsp;The data of X, Y where MNo. = 1 to 12&lt;SPAN&gt;57&lt;/SPAN&gt;&amp;nbsp;(Date = 17Nov16:18:45:14, ASN=20) is another&amp;nbsp;set of data -&amp;nbsp;we have to keep it&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now from the above comments, in the final dataset, what we need is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Data of earliest date (28SEP16:09:03:05) from the data set - idea here is whichever is first DateTime (e.g. 28SEP16:00:00:00 will be first on that date if it is there in the dataset, otherwise whichever lowest DateTime is there will be the first as in case 28SEP16&lt;SPAN&gt;:09:03:05&lt;/SPAN&gt;), take that set of Xs and Ys.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. Whichever is latest date, we have to keep that data (e.g. point no. 5 above) -&amp;nbsp;&lt;STRONG&gt;17Nov16:18:45:14, latest date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;In simple words, keep the data if complete (&amp;gt;1200 rows) and take earliest and latest dates' observations (if ASN are same for both)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 16:40:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313523#M21151</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-22T16:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313643#M21155</link>
      <description>&lt;PRE&gt;
My bad . Don't realize there are a variety of dataset in it.
This code is for 28sep2016 :



data x(where=(date='28sep2016'd));
infile '/folders/myfolders/code12.txt' truncover;
  input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
  format DateTimeStamp datetime. date date9.;
  date=datepart(datetimestamp);
  dif_y=dif(y);
  dif_x=dif(x);
run;


data want;
 merge x x(keep=dif_y dif_x rename=(dif_x=_dif_x dif_y=_dif_y) firstobs=2);
 d1=divide(dif_y,dif_x);
 d2=divide(_dif_y,_dif_x);
 if (0 lt d1 lt 0.02 and -0.02 lt d2 lt 0 ) or
  ( -1.04 lt d1 lt -1 and -1 lt d2 lt -0.96 ) or 
  (d1=0 and d2=0) then do;
  x1=x;y1=y;
  put d1= d2= dif_x= dif_y= _dif_x= _dif_y= x= y=;
 end;
run;



ods graphics/ANTIALIASMAX=5200;
proc sgplot data=want;
series x=x y=y /smoothconnect break;
scatter x=x1 y=y1/ markerattrs=graphdata2(symbol=starfilled) ;
yaxis grid;
run;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 03:12:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313643#M21155</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-23T03:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313678#M21157</link>
      <description>&lt;P&gt;Hi KSharp,&lt;BR /&gt;Thanks once again.&lt;BR /&gt;I got the following error:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;series x=x y=y /smoothconnect break;
_____________
22
202
ERROR 22-322: Syntax error, expecting one of the following: ;, ATTRID, BREAK, CLUSTERWIDTH, CURVELABEL, CURVELABELATTRS,
CURVELABELLOC, CURVELABELPOS, DATALABEL, DATALABELATTRS, DISCRETEOFFSET, GROUP, GROUPDISPLAY, GROUPORDER,
LEGENDLABEL, LINEATTRS, MARKERATTRS, MARKERS, NAME, NOMISSINGGROUP, TRANSPARENCY, URL, X2AXIS, Y2AXIS.
ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ALSO I wonder if I could do something like (for selecting first date and first TS for subsetting):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data x(where=(date=first.datetimestamp and TS=first.TS));
infile '/folders/myfolders/code12.txt' truncover;
  input DateTimeStamp : anydtdtm32. ASN $CWC $ TS $ Mno X Y;
  format DateTimeStamp datetime. date date9.;
  date=datepart(datetimestamp);
  dif_y=dif(y);
  dif_x=dif(x);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 07:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313678#M21157</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-23T07:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313715#M21158</link>
      <description>&lt;P&gt;I think I tried a little differently then what you did for calculation of x_dif and y_dif:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want (drop=LagX LagY); 
 set mydata; 
    LagX=lag(X);
    LagY=lag(Y);
	dif_y=dif(y);
        dif_x=dif(x);
	Date=datepart(DateTimeStamp); format Date date9.;
  if    MNo=1 then Lag_X=0; else Lag_X=LagX;
  if    MNo=1 then Lag_Y=0; else Lag_Y=LagY;
  if    MNo=1 then xDiff=0; else xDiff = X - Lag_X;
  if    MNo=1 then yDiff=0; else yDiff = Y - Lag_Y;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;here the way I did takes care of situation wherever there is MNo. =1, which means start of a new set of observation (an obviously ASN will get changed as well), so row at MNo=1 will have xDiff=0, yDiff=0, Y_Lag=0, X_Lag=0 (as this is first row of the dateset9 and rest all (X and Y) will be calculated based on lag value. This will not result error in computation like we are getting with X_dif and Y_dif.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 09:18:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313715#M21158</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-23T09:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313735#M21159</link>
      <description>&lt;PRE&gt;
Your code is not right.

The ERROR info say SMOOTHCONNECT is not support by your SAS. 
Remove it ,should work.

&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 10:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313735#M21159</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-23T10:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: How we can find specific coordinates on a plot and measure height difference</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313755#M21160</link>
      <description>I realised lately, I am using an older version of SAS. any other alternative, if it is important. otherwise I just removed it and it is working.</description>
      <pubDate>Wed, 23 Nov 2016 12:01:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-we-can-find-specific-coordinates-on-a-plot-and-measure/m-p/313755#M21160</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-23T12:01:52Z</dc:date>
    </item>
  </channel>
</rss>

