Hi All,
I'm facing difficulty in generating a graph thru sas code. Attached is the sample graph output expected.
Request if some can help me on the code that produces this output.
Thanks for your help.
Rgds, Anil
Data step code:
data TEMP.DN;
infile datalines dsd truncover;
input log_date:DATE9. space_used:COMMA4. yy:32. mm:32. dd:32.;
datalines4;
01JUL2017,21,2017,7,1
02JUL2017,22,2017,7,2
03JUL2017,22,2017,7,3
04JUL2017,22,2017,7,4
05JUL2017,22,2017,7,5
06JUL2017,22,2017,7,6
07JUL2017,22,2017,7,7
08JUL2017,22,2017,7,8
09JUL2017,22,2017,7,9
10JUL2017,22,2017,7,10
11JUL2017,22,2017,7,11
12JUL2017,22,2017,7,12
13JUL2017,23,2017,7,13
14JUL2017,23,2017,7,14
15JUL2017,23,2017,7,15
16JUL2017,24,2017,7,16
17JUL2017,24,2017,7,17
18JUL2017,24,2017,7,18
19JUL2017,24,2017,7,19
20JUL2017,25,2017,7,20
21JUL2017,25,2017,7,21
22JUL2017,25,2017,7,22
23JUL2017,25,2017,7,23
24JUL2017,25,2017,7,24
25JUL2017,25,2017,7,25
26JUL2017,25,2017,7,26
27JUL2017,26,2017,7,27
28JUL2017,26,2017,7,28
29JUL2017,26,2017,7,29
30JUL2017,26,2017,7,30
31JUL2017,26,2017,7,31
01AUG2017,27,2017,8,1
02AUG2017,28,2017,8,2
03AUG2017,28,2017,8,3
04AUG2017,28,2017,8,4
05AUG2017,28,2017,8,5
06AUG2017,28,2017,8,6
07AUG2017,28,2017,8,7
08AUG2017,28,2017,8,8
;;;;
Thank you guys.. All of your codes in portions helped me build my graph.
This community is awesome...
Thanks, Anil
Please use the macro provided in https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... to convert your dataset to a data step and post that in a code box ({i} or "little running man" icon).
Excel files cannot convey the structure of a dataset, can pose a security risk, and are therefore blocked from downloading at many corporate sites (which give employment to the majority of posters here).
For the wanted result, attach a screenshot.
What do you want your graph to look like? 🙂
Attached zip file has the expected look.
This is the code I got from EG with point-and-click (I'm no GRAPH expert):
Axis1
STYLE=1
WIDTH=1
MINOR=NONE
;
Axis2
STYLE=1
WIDTH=1
VALUE=NONE
;
PROC GCHART DATA=WORK.DN
;
VBAR
mm
/
SUMVAR=space_used
GROUP=dd
CLIPREF
FRAME TYPE=SUM
NOLEGEND
COUTLINE=BLACK
RAXIS=AXIS1
MAXIS=AXIS2
PATTERNID=MIDPOINT
;
RUN;
NOT TESTED, but something like this
proc sgplot data=DN;
vbar dd / response=space_used group=mm groupdisplay=cluster;
run;
Consult the PROC SGPLOT documentation to adjust the axes and so on to your liking
http://support.sas.com/documentation/cdl/en/grstatproc/62603/HTML/default/viewer.htm#sgplot-stmt.htm
Thank you guys.. All of your codes in portions helped me build my graph.
This community is awesome...
Thanks, Anil
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.