ODS layout / region not working for me

Posted on 2012-08-23
Last Modified: 2012-08-24

I'm trying to create a report that I want to use the ods layout feature of SAS. The code as I have it,  places two of three items  but not exactly where I would like them and the third never shows up at all (error: NOTE: The graph will be rendered as an image due to the use of data skins.
WARNING: The absolute region was too small to accommodate the text supplied. OUTPUT WAS LOST.)
I've tried making the region bigger, etc, but it never comes out.

I would like the layout to look something like


And what I'm getting is:
All the examples on the web make it look so easy, but I can't get the darn graphs in the right place.

Code :
Options  nodate  orientation=landscape;
ods pdf file="c:\ods_outputs\%trim(%sysfunc(dequote(%scan(&hospital_name.,&i,'+')))).pdf" 
 startpage=never ;
ods layout start height = 8.5in width = 11in;

ods region width=11in height=.75in x=0in y=0in;
	ods pdf text="Summary of ED visits at %trim(%sysfunc(dequote(%scan(&hospital_name.,&i,'+')))) hospital. People Age 65+ 2011/12 Fiscal Year";

ods region width=4.5in height=3in x=0.25in y=1in;
proc print data=new noobs label;
var metric distinct_visitor percent;run;

ods region width=3in height=3in x=0.25in y=3.5in;
proc sgplot data=t_75;
xaxis type=discrete;
vbar Triage_level1 /
title 'Distribution of Visits by Triage Level Age 75+';

ods region width=4in height=5in x=5in y=3.5in;
proc sgplot data=t_75;
xaxis type=discrete;
vbar disposition /
title 'Disposition Status Age 75+';

ods layout end;
ods pdf close;

Open in new window

Question by:Diaphanosoma
    LVL 11

    Accepted Solution


    So, upfront, I am still working on SAS 9.2 - so I can't test the dataskins issue - but based on the NOTE: I don't think its a major issue.

    I have a feeling that the problem might actually be a simple one.

    SAS has global statements that run immediately (eg. OPTIONS, ODS statements) and others (DATA steps and PROCs) that require something to "activate" the DATA step or PROC.  Normally this is a RUN statement, but can also be the start of a new PROC or DATA step.

    I think because you do not have a RUN; statement in line 20, the ods region statement runs before the first PROC SGPLOT, and as a result the regions do not work.

    Short answer: put a RUN; statement in line 20.
    LVL 1

    Author Comment

    Thanks Art.

    Its been a while since a missing run statement got me flummoxed.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    In today’s complex data management environments, it is not unusual for UNIX servers to be dedicated to a particular department, purpose, or database.  As a result, a SAS® data analyst often works with multiple servers, each with its own data storage…
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now