BookmarkSubscribeRSS Feed
DmytroYermak
Lapis Lazuli | Level 10

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

 

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

 

Cynthia_sas
SAS Super FREQ

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

DmytroYermak
Lapis Lazuli | Level 10
Thank you, Cynthia. I need some time to be familiarized with. I will return with questions later on, if any.
Ksharp
Super User

Check style option

style={pretext='              '}

DmytroYermak
Lapis Lazuli | Level 10
Ksharp, do you mean to put style={pretext=' '} in define? Should I leave the two variables in this case?
Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1990 views
  • 2 likes
  • 4 in conversation