format row value based on value of another column proc report?

Discussion in 'SAS (Statistical Analysis Software)' started by bigD, Jul 29, 2009.

  1. bigD

    bigD Guest


    Is it possible to format values in proc report based on the value in
    another column. For example, in a report for each company I have
    several measures, some are in percent and some are dollars. I would
    like to report any "cost" or "expense" with a dollar format and
    percents with percent format. As my code stands now, I can do only
    dollar format or a percent format. I guess I need to pre process but
    I'm not sure where to begin.

    Thanks for any insights.

    data test; input measure : $40. fY_2006;
    infile datalines dsd;
    % Contracted expenses, 1.4
    % of Amortization - Building, 2.4
    % of Other Expenses of Total Expenses, 5.4
    Cost per Day food, 292.6
    Cost per day travel, 52.4
    Equipment Expenditures %, 7
    Hotel %, 15.9
    Support %, 4

    proc report nowd data=test;
    column measure fy_2006;
    define measure / display;
    define fY_2006 / analysis sum "Fiscal Year 2006 " format =dollar12.0;
    bigD, Jul 29, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.