BookmarkSubscribeRSS Feed
kansas
Calcite | Level 5

Hi,

Im creating a report using ods pdf. Im using layout keyword as well. How can i insert a vertical line at a given x,y value ?

Thank  you

8 REPLIES 8
Cynthia_sas
SAS Super FREQ

Hi:

  You say that you are creating a report, but you do not say what your procedure of choice is. Generally speaking, SAS procedures create 2 distinct types of reports -- tabular reports and graphical reports. Tabular reports do not have X,Y values -- they have report rows which represent either observations or calculated statistics or some type of analysis. Graphical reports can have X,Y values, in that the X axis is generally a midpoint axis and the Y axis is generally the response axis. Using the ANNOTATE facility, you can draw a line, overlaid on a graphical image, based on X,Y coordinates.

  Without knowing what procedure you are using to create your ODS PDF output file, this is a hard question to answer, especially since you say that you are also using ODS LAYOUT (which is experimental). I would recommend that you open a track with Tech Support on this question, as they can look at all your code and your data and your experimeantal ODS LAYOUT statements and see whether there a way to insert a line into your output.

cynthia

kansas
Calcite | Level 5

Hi.

im generating a pdf page with two charts(Coming from two datasets).(using proc gplot then wrapping it in a ods region) I want to add a vertical seperator between those two charts). Hope this explanation is sufficient

Thanks

Ksharp
Super User

In the Arther Carpenter 's book complete guide to sas report process , I found this:

ods pdf style=default file="c:\temp\line.pdf" startpage=never;
proc report data=sashelp.class nowd;
run;
%annomac
* Build the annotate data set;
data Annolines;
length function color $8;
retain xsys ysys '5';
* Syntax for the LINE macro;
*LINE (x1, y1, x2, y2, color, line_type, size);
%line(.5,69.6,50.5,69.6,blue,1,30)
%line(.5,80.5,50.5,80.5,red,1,30)
%line(42.2,67,42.2,94,green,1,30)
run;
* Use the annotate data set;
proc gslide anno=annolines;
run;
quit;
ods _all_ close;

Ksharp

kansas
Calcite | Level 5

Thanks ksharp,

I have couple of questions on the above code.

Is the macro "line" an inbuild macro ? i cannot find the macro.

Do i have to use the sas annonate if i to use this line macro ?

Thanks.

Cynthia_sas
SAS Super FREQ

Hi:

  The ANNOTATE facility has a group of "autocall" macro programs that, used with SAS/GRAPH, simplifies the use of the ANNOTATE facility. So this is not an instream compiled macro program. Since it lives in the autocall location, it is loaded when needed. Every time you use these ANNOTATE macro programs, however, you must precede your usage with a reference to the organizing macro program %ANNOMAC -- which actually compiles the annotate macro programs for usage. You can read about them here:

http://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#annotate_annotate...

cynthia

kansas
Calcite | Level 5

Thanks cynthia.

I ll try it out and let you know how it goes. Smiley Happy

kansas
Calcite | Level 5

Using ANNONATE facility i was able to solve my issue.


Thanks.

ArtC
Rhodochrosite | Level 12

Thank you for pointing out this example Ksharp.  Somehow I had missed the thread.  This technique was, as far as I know, pioneered by Pete Lund of Looking Glass Analytics.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 8 replies
  • 3138 views
  • 6 likes
  • 4 in conversation