BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

Hi. In my proc print can I rename the column headers?

 

N = 'Count'

Rule_Order = 'Rule'

ad_dt_char = 'AD Date'

 

And for the Rule_Order column is there any way to format the values so that whole number don't have the .0 attached?

 

                                              The SAS System                          08:52 Friday, April 8, 2016 132

                                                      RULE_
                                               Obs    ORDER      N    ad_dt_char

                                                 1     1.0      80    TOTAL
                                                 2     1.0       5    03/14/2016
                                                 3     1.0       3    03/15/2016
                                                 4     1.0      14    03/16/2016
                                                 5     1.0      13    03/17/2016
                                                 6     1.0      20    03/18/2016
                                                 7     1.0      19    03/19/2016
                                                 8     1.0       4    03/22/2016
                                                 9     1.0       2    03/25/2016
                                                10     1.5     202    TOTAL
                                                11     1.5       1    03/15/2016
                                                12     1.5       1    03/17/2016
                                                13     1.5       2    03/18/2016
                                                14     1.5       6    03/19/2016
                                                15     1.5      12    03/21/2016
                                                16     1.5       4    03/22/2016

 

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @buechler66,

 

Try this:

proc print data=yourdata label;
label N = 'Count'
      Rule_Order = 'Rule'
      ad_dt_char = 'AD Date';
format Rule_Order best6.; /* please adapt length 6 as appropriate */
run;

View solution in original post

3 REPLIES 3
FreelanceReinh
Jade | Level 19

Hi @buechler66,

 

Try this:

proc print data=yourdata label;
label N = 'Count'
      Rule_Order = 'Rule'
      ad_dt_char = 'AD Date';
format Rule_Order best6.; /* please adapt length 6 as appropriate */
run;
buechler66
Barite | Level 11
Awesome help. Ty.
FreelanceReinh
Jade | Level 19

You're welcome. 

 

Please note that the suggested code assigns the labels and format only temporarily to the respective variables, only for the duration of the PROC PRINT step. Alternatively, you can add the same LABEL and FORMAT statements to a data step creating the input dataset for PROC PRINT ("yourdata") in order to assign the labels and format permanently. Then you don't need these statements in future PROC PRINT steps, only the LABEL option in the PROC PRINT statement (first line of code).

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
  • 3 replies
  • 738 views
  • 0 likes
  • 2 in conversation