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

TITLE;
TITLE1 j=left FONT='Arial' c=black Bold "student UITM";
TITLE2 j=left FONT='Arial' italic H=3 " 2000";
/* -------------------------------------------------------------------
Code generated by SAS Task

Generated on: Monday, August 19, 2019 at 1:04:19 PM
By task: Summary Tables (2)

Input Data: SASOA:WORK.Student
Server: SASOA
------------------------------------------------------------------- */

%_eg_conditional_dropds(WORK.AA);


/* -------------------------------------------------------------------
Run the tabulate procedure
------------------------------------------------------------------- */
ods escapechar='\';
PROC TABULATE
DATA=WORK.student (FIRSTOBS=1) STYLE={CELLPADDING=50 TEXTALIGN=C HEIGHT=20}

OUT=WORK.AA(LABEL="Summary Tables for Student UITM")

;
VAR STATE_ID;
CLASS REF_YEAR / ORDER=UNFORMATTED MISSING;
CLASS STATE_NAME_E / ORDER=UNFORMATTED MISSING;
TABLE
/* Row Dimension */
ALL={LABEL="Malaysia"} STATE_NAME_E={LABEL=" "} ,
/* Column Dimension */
REF_YEAR={LABEL=" "}*(STATE_ID={LABEL=" "}*N ={LABEL='Bilangan Numbers'}*F=COMMA12. STATE_ID={LABEL=" "}*ColPctN={LABEL="%"})
/*Table Options */
/ BOX={LABEL='Negeri State'};
;

RUN;
/* -------------------------------------------------------------------
End of task code
------------------------------------------------------------------- */
RUN; QUIT;
TITLE;

 

please help me:

1) how to split/ new line in Negeri State [BOX={LABEL='Negeri State'}] and Bilangan Numbers [N ={LABEL='Bilangan Numbers'}].

eg: in the table will be [Negeri state] but I want it will be like  Negeri

                                                                                                 State

2) how to do uppercase to be Capitalize each word 

eg: KUALA LUMPUR will be Kuala Lumpur

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

You haven't written any  sas  code, right?

 

You need something like

data work.ProperStateName;
  set INSERT_THE_NAME_OF_YOUR_DATASET_HERE;
  STATE_NAME_E=propcase(STATE_NAME_E);
run;

Afterwards you have to use work.ProperStateName in proc tabulate.

View solution in original post

12 REPLIES 12
andreas_lds
Jade | Level 19

@merahilyana wrote:

 

2) how to do uppercase to be Capitalize each word 

eg: KUALA LUMPUR will be Kuala Lumpur


 

You can use the function propcase to apply the required changes.

 

EDIT: You will need to write a data step to use the function.

merahilyana
Fluorite | Level 6

i done try but it get error

andreas_lds
Jade | Level 19

@merahilyana wrote:

i done try but it get error


Because i don't work for nsa or cia i don't have access to your computer and can't see the log with the error message. You should post the log using the {i} icon.

merahilyana
Fluorite | Level 6

where place I must put propcase?? it is after proc tabulate or before or can put inside proc tabulate

andreas_lds
Jade | Level 19

@merahilyana wrote:

where place I must put propcase?? it is after proc tabulate or before or can put inside proc tabulate


You need a separate step before proc tabulate.

merahilyana
Fluorite | Level 6
Can you give me the example..
merahilyana
Fluorite | Level 6
data;
STATE_NAME_E=propcase(STATE_NAME_E);
run;

i did like this before proc tabulate.. but nothing changed in result
andreas_lds
Jade | Level 19

You haven't written any  sas  code, right?

 

You need something like

data work.ProperStateName;
  set INSERT_THE_NAME_OF_YOUR_DATASET_HERE;
  STATE_NAME_E=propcase(STATE_NAME_E);
run;

Afterwards you have to use work.ProperStateName in proc tabulate.

merahilyana
Fluorite | Level 6

ok tq..i will try

 

it appears on data set but not in the result tabulate..

how

andreas_lds
Jade | Level 19

@merahilyana wrote:

ok tq..i will try

 

it appears on data set but not in the result tabulate..

how


Have you changed the dataset in proc tabulate?

merahilyana
Fluorite | Level 6
Yay, Finally I can solve it question no 2. Thank you for helping me.
LisaSklar
Obsidian | Level 7

To insert a line break in the middle of a label, you just need to use your ODS Escapechar with the line break command, 'n'. Try this:

 

{LABEL='Negeri\nState'}

 

Cheers,

Lisa

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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