Hello,
I am creating a report that has a table and title statement using PROC REPORT. I am having trouble getting the title statement to left align in the report. Can someone provide me with some pointers. Thank you
data sas3;
input naics $ code $ mfp Sectoral_Quantity_Index Combined_Inputs_quantity_index capital_services Labor_Input intermediate_quantity_index;
datalines ;
Agriculture 11 0 0 0 0 0 0
Mining 21 0 0 0 0 0 0
Utilities 22 0 0 0 0 0 0
Construction 23 0 0 0 0 0 0
Manufacturing 3361-3369 0 0 0 0 0 0
Durable 3361-3363 0 0 0 0 0 0
Nondurable 3364-3363 0 0 0 0 0 0
Wholesale 42 0 0 0 0 0 0
Retail 44,45 0 0 0 0 0 0
Transportation 48-49 0 0 0 0 0 0
Information 51 0 0 0 0 0 0
Finance 52 0 0 0 0 0 0
Real 53 0 0 0 0 0 0
Professional 54 0 0 0 0 0 0
Management 55 0 0 0 0 0 0
Admin 56 0 0 0 0 0 0
Educational 61 0 0 0 0 0 0
Health 62 0 0 0 0 0 0
Arts 71 0 0 0 0 0 0
Accommodation 72 0 0 0 0 0 0
Other 81 0 0 0 0 0 0
;
run;
Options nodate nonumber linesize=100;
options symbolgen mprint;
proc printto print= "L:\Jadoo\PROD5 New Text Tables\Table.txt" ;
run;
title1 justify=left "Table 1. Total factor productivity and related data, 2019";
Proc report data = work.sas3 spacing = 1 ;
column naics code ('Percent Change' mfp Sectoral_Quantity_Index
Combined_Inputs_quantity_index capital_services
Labor_Input intermediate_quantity_index);
define NAICS/Display " Industry " left width = 20 ;
define code/Display " 2012 NAICS Code" right width = 7 ;
define mfp/Display "TFP" center width = 5 ;
define Sectoral_Quantity_Index/Display "Output" center width = 6 ;
define Combined_Inputs_quantity_index /Display "Combined Inputs" center width = 8 ;
define capital_services/Display "Capital Input" center width = 7 ;
define Labor_Input/Display "Labor Input" center width = 5 ;
define intermediate_quantity_index/ Display "Intermediate Inputs" center width = 12 ;
run;
Please show what is wrong about the current output.
Did you try the NOCENTER system option?
Please show what is wrong about the current output.
Did you try the NOCENTER system option?
Hi. That worked. Thanks. Is there a way to do it without the title statement? Is there a feature in PROC REPORT that one can make a title?
Hi:
There's a feature in PROC REPORT where you can write custom text at the TOP of the table, but within the boundaries of the table. In the example below, see how the TITLE text is at the very top of the report, outside the boundaries of the report. But the COMPUTE block text is within the boundaries of the report, as shown below:
However, this may or may not be what you want or need. This is what PROC REPORT can do. As you can see in my example, you should NOT need NOCENTER in order to left align the title string.
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.