BookmarkSubscribeRSS Feed
kmgraju
Calcite | Level 5

Hi all,

I started to learn SAS university edition.

When I import .csv file and convert to SAS table, the result will be stored in WORK library. When I close the session and open next time I could not find the table in WORK library. How to do?

 

I am trying to plot Sg plot. I would like to specify major and minor axis grid . I would like to show minor axis and major axis with more division. How do I achive ?  How do I edit graph like I need to draw a line inside the graph write something inside the graph etc after I get regression line 

 

 

 

 

proc sgplot data=work.CAR_DATA;
title 'time vs speed';
scatter x=time y=speed;

 

Thank you for your support.

 

Regards

Govind

 

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

 

Question 1: Work is a temporary library pointing to the temporary SAS area, when SAS is closed work is removed.  Set a libname to a physical network path and put data you want to store there.

 

Question 2:  To learn about SGPLOT, or Graph Template Language, rather than me give a long winded example, pop over to this blog.  Examples of all types of graphs, layouts etc. 

http://blogs.sas.com/content/graphicallyspeaking/

Rick_SAS
SAS Super FREQ

Use the AXIS statements to control grids and tick marks. The GRID option puts grid lines at each tick location. The VALUES= option enables you to specify the location of ticks, like this:

 


proc sgplot data=sashelp.cars;
scatter x=weight y=mpg_city;
xaxis grid values=(2000 to 7000 by 1000);
yaxis grid values=(10 to 60 by 5);
run;

The easiest way to edit a graph and add custom lables, arrows, text boxes, etc, is to use the Graphics Editor. An example and discussion is available in the article "Change a plot title by using the ODS Graphics Editor."

kmgraju
Calcite | Level 5
Dear Rick
I am using university edition. ODS graphic editor is not available . how to enable the ODI graphic editor. .I could not enable minor tick also.I am trying to learn myself the SAS . Thank you for your help
Rick_SAS
SAS Super FREQ

The GRID and VALUES= options enable you to control the lies and ticks.  You can often use the DATALABELS= option on the SCATTER statement to label individual observations

 

There is also the TEXT statement and the VECTOR statement, which enables you to draw text and arrows at arbitrary locations.

 

You say,  "I need to draw a line inside the graph write something inside the graph etc after I get regression line." Please clarify. Specify what you want to do, perhaps by referring to the graph that I created.   For example, I can add a line to a plot by using the LINEPARM statement, and information about the line by using the INSET statements:

 

proc sgplot data=sashelp.cars;
scatter x=weight y=mpg_city;
lineparm x=0 y=38 slope=-0.005;
inset "Intercept = 38" "Slope = -0.005" / 
       border title="Parameter Estimates" position=topright;
xaxis grid values=(2000 to 7000 by 1000);
yaxis grid values=(10 to 60 by 5);
run;
Jay54
Meteorite | Level 14

ODS Graphics Editor is really meant for use for editing of graphs from stat procedures, where you do not have access to the code that made the graph.  When you are using SGPLOT, you can easily change the code yourself, which is better than using Editor.  

 

This is true, except for the free form annotation.  In your case using University Edition, you can add the annotation using the SGANNOTATE feature. See SGF 2016 paper.  Or, you can use any image editor like Microsoft Publisher to add hard coded annotations after the fact.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

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
  • 5 replies
  • 1032 views
  • 0 likes
  • 4 in conversation