Posts

Showing posts with the label Label

PROC TRANSPOSE: How to Convert Variables(columns) into Observations(ROWS) and Observations(ROWS) into Variables(Columns)

Image
During my early days as a SAS programmer, I used to get confused which statement in PROC TRANSPOSE used for what and why? PROC TRANSPOSE syntax looks like a straightforward thing, but we need to look at important details it offers and without that we may get unexpected results. Proc Transpose Options: Proc Tranpose offers several options like OUT=, LABEL=, NAME=, and PREFIX=. Each option is distinct from the others. "OUT=" option assigns an output dataset, "LABEL=" option assigns a nemae to the variable which has the label of the transposed variable. If we don’t use "LABEL=" option in the PROC TRANSPOSE syntax, the defalut “_LABEL_” will be assigned to the variable that is being transposed. "NAME= " option works same as the "LABEL=" option, as if we use NAME=option in the TRANSPOSE syntax, which will assign the name to the variable that is being tranposed. There is another option that we can use in the TRANSPOSE syntax that ...

Displaying the Graphs (Bar charts) using PROC GCHART in SAS

Image
Displaying the Graphs (Bar charts) using PROC GCHART in SAS : Just a day ago, I've received a question on Graphs from one of the member of  my orkut community , which prompted me to create following example. Below are 5 different types of Graphs were produced (including 3d graphs) using Proc Gchart. Sample data set used for the examples: data x; input quarter $ ncl ram; cards; q1 20000 2000 q1 30000 3000 q1 45000 2000 q2 23000 2003 q2 45000 4500 q3 46000 5600 q3 89000 600 q3 67000 4500 q4 45890 890 q4 46000 9800 ; run ; *Example1: Simple barchart; /* Add a title */ title 'Sales Report'; /* Produce the bar chart */ proc gchart data=x; vbar quarter / sumvar=ncl nozero ; format ncl dollar8.; run ; quit ; Snapshot of the output: *Example2: Producing 3D graphs with cylinder shape using Proc Gchart; pattern c=blue; axis1 minor=none label=('NCL Sum'); title 'Bar Chart Shape'; /* use the SHAPE= option to specify a cyl...