BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Junyong
Pyrite | Level 9

Can I add the ending numbers of time series data in GPLOT? For example,

data _;
do t=1 to 100;
x+rannor(1);
output;
end;
run;
symbol i=join;
proc gplot;
plot x*t;
run;
quit;

SAS generates the left one without the ending number of "x," while the right one is from MS Excel with the ending number 4.5 added manually.

01.png02.png

Thanks for your consideration.

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

For example

data _;
  do X=1 to 100;
    Y+rannor(1);
    output;
  end;
run;

data ANNO;
  retain XSYS '1' YSYS '2' FUNCTION 'label' POSITION '6';
  set _ end=LASTOBS;
  if LASTOBS;   
  X=100;
  TEXT=catt(Y,4.1 -l);
run;

symbol i=join;
proc gplot data=_ anno=ANNO;
  plot Y*X;
  run;
quit;

kk.jpg

 

View solution in original post

2 REPLIES 2
Reeza
Super User
In GPLOT you need to use annotation, in SGPLOT just add a datalabel or TEXT statement.
ChrisNZ
Tourmaline | Level 20

For example

data _;
  do X=1 to 100;
    Y+rannor(1);
    output;
  end;
run;

data ANNO;
  retain XSYS '1' YSYS '2' FUNCTION 'label' POSITION '6';
  set _ end=LASTOBS;
  if LASTOBS;   
  X=100;
  TEXT=catt(Y,4.1 -l);
run;

symbol i=join;
proc gplot data=_ anno=ANNO;
  plot Y*X;
  run;
quit;

kk.jpg

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 884 views
  • 0 likes
  • 3 in conversation