BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
yo1
Obsidian | Level 7 yo1
Obsidian | Level 7

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Please show what is wrong about the current output.

 

Did you try the NOCENTER system option?

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

Please show what is wrong about the current output.

 

Did you try the NOCENTER system option?

yo1
Obsidian | Level 7 yo1
Obsidian | Level 7

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?

Cynthia_sas
SAS Super FREQ

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:

Cynthia_sas_0-1629826315296.png

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

 

DrAbhijeetSafai
Lapis Lazuli | Level 10
That worked for me. Thanks.

- Dr. Abhijeet Safai
Dr. Abhijeet Safai
Certified Base and Clinical SAS Programmer
Associate Data Analyst
Actu-Real

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 2745 views
  • 1 like
  • 4 in conversation