12-02-2012 02:33 PM
I've data in below format in my dataset, i want to print it in same way by adding leading blanks by using proc report. in my original source dataset some rows contains leading blanks and some rows starting with character. in below example, first row started with normal character, second and third rows started with leading blanks.
Axiata Group Berhad (Bangladesh) Bd
proc report data=data1;
Now all rows by defaultly writing in left justify with above code. any way to print the same format (some rows started with charcter and some rows started with leading blanks) in proc report
12-02-2012 07:16 PM
What is your destination of interest? HTML, RTF, PDF? There have been previous forum postings on doing indention using PROC REPORT. You would look for examples of using INDENT= or LEFTMARGIN=.
Your DEFINE statement for NAME1 is incorrect...there must be SOMETHING else on the DEFINE statement...So, you should be seeing an error message similar to what is shown below:
237 define name;
ERROR 22-322: Syntax error, expecting one of the following: -, /, :.
ERROR 76-322: Syntax error, statement will be ignored.
The type of indention you show would be done with a CALL DEFINE statement inside a COMPUTE block.
Just curious, do you really only have 1 variable on the report???
12-02-2012 08:18 PM
I've many numeric columns in report, but only one character column as stated in above. So i am generating this proc report in Stored process. So I want to print the charcter data hierachical order. i.e. i dont want to use left justify, want to print same as in source dataset
12-03-2012 01:01 AM
I did not say to use left justify. I said to use the style override for LEFTMARGIN. There is a difference. See attached screenshot run using the Females in SASHELP.CLASS -- and then indenting only some of the names.. You could also try to use ASIS=ON style override if your data has embedded blanks. The problem with ASIS=ON is that, as a stored process, it is possible that your client application (such as PowerPoint or Web Report Studio might ignore any of the style overrides that you set up in PROC REPORT. I think it is more likely that ASIS=ON would be ignored than the LEFTMARGIN.
You might want to work with Tech Support on this because there might not be one solution that works for all the client apps that can receive your stored process. You may have to use more advanced macro programming to account for different indenting techniques for different client apps. And, there may be some client apps where you can't get indenting...for example...if you use the SAS Add-in for Microsoft Office and return CSV results to Excel, there is not anything you can do to preserve the indenting.
if name in ( 'Barbara', 'Carol', 'Janet', 'Joyce') then