The SAS Output Delivery System and reporting techniques

Shift within one column in Proc Report

Reply
Regular Contributor
Posts: 210

Shift within one column in Proc Report

[ Edited ]

Hi all,

 

Hi all,

 

Could you please help in the following case. I have to shift text within one column in Proc Report. At the moment I have two variables: 

1 - Timepoint and 2 - Statistic.

In the table ones have to be 'almost in one column'. large.jpg

 

Super User
Super User
Posts: 9,227

Re: Shift within one column in Proc Report

Posted in reply to DmytroYermak

What does your data look like?  Me I would create blank row with just the Pre-dose or 15 min etc. as rows themselves.  Then the summary stats can be indented by "  "||strip(summary_stat) so your variable looks indented in the data.  then in proc report ensure you use asis=on otherwise the spaces will be removed:

  define col1 / style={asis=on};

Please show test data, in the form of a datastep using the {i}, and what you have code wise to get better answers.

 

SAS Super FREQ
Posts: 9,261

Re: Shift within one column in Proc Report

Posted in reply to DmytroYermak

Hi:

  This looks like the standard demographic type report that I discussed how to generate in my 2008 paper, Creating Complex Reports. Look here http://www2.sas.com/proceedings/forum2008/173-2008.pdf  at examples 1 and 8. There are 2 examples for #1, done with PROC REPORT and 1 example for 8 done with Table Templates and DATA _NULL_. You will find the zip file of programs here: http://support.sas.com/rnd/papers/#SGF2008 -- just scroll down until you find the title -- there's a link to download the zip.

 

  Basically, you need to make some helper variables so you know which rows are indented and treated differently. The current structure of your data file will make a big difference in how much data manipulation you need to do. What code are you currently using? Is PROC REPORT currently creating the data? How did you get the example for your screen shot?

 

cynthia

Regular Contributor
Posts: 210

Re: Shift within one column in Proc Report

Posted in reply to Cynthia_sas
Thank you, Cynthia. I need some time to be familiarized with. I will return with questions later on, if any.
Super User
Posts: 10,623

Re: Shift within one column in Proc Report

Posted in reply to DmytroYermak

Check style option

style={pretext='              '}

Regular Contributor
Posts: 210

Re: Shift within one column in Proc Report

Ksharp, do you mean to put style={pretext=' '} in define? Should I leave the two variables in this case?
SAS Super FREQ
Posts: 9,261

Re: Shift within one column in Proc Report

[ Edited ]
Posted in reply to DmytroYermak

Hi:
Proc REPORT will not nest 2 variables in 1 column. There are a couple of ways to put the name of one group above another group, but again, it really depends on the structure of your data. Before I would use PRETEXT=, I would investigate whether the destination supports LEFTMARGIN or INDENT which are more straightforward solutions.

I will post an example.

use_leftmargin.png

 

Note how LEFTMARGIN caused the PRODUCT column to be indented under the LINE that was written for each REGION. REGION has to be on the COLUMN statement, but can be defined as a NOPRINT item so that break processing can be used to write the REGION value once for each group of products.

Cynthia

Ask a Question
Discussion stats
  • 6 replies
  • 382 views
  • 2 likes
  • 4 in conversation