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
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 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.
i done try but it get error
@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.
where place I must put propcase?? it is after proc tabulate or before or can put inside proc tabulate
@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.
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.
ok tq..i will try
it appears on data set but not in the result tabulate..
how
@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?
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
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.