+ Reply to Thread
Results 1 to 4 of 4

Thread: PROC REPORT with escape char?

  1. #1
    Points: 3,892, Level: 39
    Level completed: 62%, Points required for next Level: 58

    Posts
    302
    Thanks
    16
    Thanked 15 Times in 15 Posts

    PROC REPORT with escape char?



    Hello all,

    first, here is the code I am working with:

    proc report data=data;
    column date ("Group A" (cost average)) ("Group B" (cost average));
    ...
    ...
    (extra code excluded)
    run; quit;

    The code in bold is what my question focuses on. What this does is creates a 2 headers, one labeled "Group A" and the other labeled "Group B".

    However, I would like to know if there is a way to change the color of these headers? Right now, they are both going to be the same color but I'd like them to be difference. Since they are not actual variables, I don't think I can use them in a define statement (if I could I would be able to use style(header)=[backgroundcolor=] to change the colors).

    Someone suggested using an escapechar but I have not been able to get it to work either. Any suggestions?

    I have included a microsoft word document which visualizes my question (I did not include any actual SAS output, I just used the word table builder).

    Thanks!
    Attached Files

  2. #2
    Test of Gnomality
    Points: 8,264, Level: 61
    Level completed: 38%, Points required for next Level: 186
    hlsmith's Avatar
    Posts
    1,504
    Thanks
    98
    Thanked 255 Times in 248 Posts

    Re: PROC REPORT with escape char?

    Something like the following will eventually get you there:

    Code: 
    proc report data=data;
    column date ("Group A" (cost average)) ("Group B" (cost average));
    define column / group
           style (header) = {background=yellow};
    ...
    ...
    (extra code excluded)
    run; quit;


    Though this may only change the header, more detail is needed to get at that cell,
    perhaps:

    keyword "Group A" / style = {background=yellow}

  3. #3
    Points: 3,892, Level: 39
    Level completed: 62%, Points required for next Level: 58

    Posts
    302
    Thanks
    16
    Thanked 15 Times in 15 Posts

    Re: PROC REPORT with escape char?

    proc report data=data;
    column date ("Group A" (cost average)) ("Group B" (cost average));
    define date / "Date";
    define cost / "Cost" format=dollar15.2;
    define average / "Cost" format=dollar15.2;
    ...
    ...

    that's pretty much what the rest of the code looks like - I just use define statements.

    I'm not quite sure how or where "keyword "Group A" / style = {background=yellow}" fits in?

  4. #4
    Test of Gnomality
    Points: 8,264, Level: 61
    Level completed: 38%, Points required for next Level: 186
    hlsmith's Avatar
    Posts
    1,504
    Thanks
    98
    Thanked 255 Times in 248 Posts

    Re: PROC REPORT with escape char?


    Yeah, your correct, keyword wants a preexisting keyword in SAS. I would imagine that you could get at a solution using the following.

    http://support.sas.com/resources/pap...lesinprocs.pdf

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats