Hello,
I want to keep my indentation in proc report (as presented in data), but when it flows to a new line it misalign.
data:
desc
Number of participants
Cardiac disorders
Palpitations
Gastrointestinal disorders
Gastrointestinal polyp haemorrhage
code: define statement "desc"
proc report data = final1 nowd headline headskip missing split='@' style(header column)=[protectspecialchars=off];
%if &blind=Y %then %do;
columns ordx1 aebodsys total1 aedecod desc ;
define ordx1 / descending order order=internal noprint;
define aebodsys / order order=internal noprint;
define total1 / descending order order=internal noprint;
define aedecod / order order=internal noprint;
define desc /display style(header)=[just=left] style(column)=[asis=on cellwidth=2.5 in ] flow " ";
run;
The text-wrapping occurs in the first column? Did you try setting a large width for the first column?
Do you want the h to be aligned with G in the line above it in your yellow-coloured text?
@HitmonTran wrote:
that's correct. I updated the post to include sample data.
Not really "data".
Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.
> I updated the post to include sample data.
Sample data would be data we can your code against.
This should always be provided when you ask for help if you want to help yourself.
In any case, I think that's the standard behaviour, and that's it.
Maybe try inserting padding characters in those labels that cause problems?
How about trying these STYLE options in your column DEFINE statement?
style=[textalign=left cellwidth=2.5in tagattr="wrap:yes"]
You need to use TEXTALIGN=left to ensure there is no indenting and the TAGATTR setting WRAP to yes should set wrapping on in the column.
Hi:
This is a variation of a program I posted for someone else about indenting -- he did not have to worry about wrapping, but the fix is the same -- use the leftmargin= option, as shown below.
With a big enough cellwidth and leftmargin set at .25 in , there is NOT any wrapping.
However, with cellwidth of 1.5in and a leftmargin of .25, you can see that when the line does need to wrap, it wraps to the leftmargin value:
I already had the code set up for PDF using the same data as the previous example, so all I did was change the cellwidth and change the output file name and you can see that wrapping occurs as you wanted.
Cynthia
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.