Below is my sample data:
data have;
infile datalines
dlm='|';
input Directory $ Date SizeInMB;
informat Date Date9.;
format Date Date9.;
datalines;
Folder 1|'13Mar2021'd|20
Folder 1|'14Mar2021'd|26
Folder 1|'15Mar2021'd|14
Folder 2|'13Mar2021'd|250
Folder 2|'14Mar2021'd|110
Folder 2|'15Mar2021'd|300
Folder 3|'13Mar2021'd|.89
Folder 3|'14Mar2021'd|4
Folder 3|'15Mar2021'd|3
;
run;
May I know how to graph it wherein:
1. The date will be in the x-axis
2. SizeInMb will be in the y-axis
3. The directories will be in the line graph (So there will be a legend)
I would also want to divide the graph by their sizes. Example, folders with SizeinMB ranging from 100 to 100MB will be in Graph1, filders with sizes ranging from 101 to 200 will be in Graph2, and so on and so forth
proc sgplot data=have;
scatter x=date y=sizeinmb/group=directory;
run;
For the part of your problem that says "I would also want to divide the graph by their sizes. Example, folders with SizeinMB ranging from 100 to 100MB will be in Graph1, filders with sizes ranging from 101 to 200 will be in Graph2, and so on and so forth".
You would have to create a variable in the data set which indicates the size of the folder, and then in PROC SGPLOT, you would use a BY statement.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.