BookmarkSubscribeRSS Feed
Tech1234
Calcite | Level 5

Hello,

I have created a nice survival plot for my analysis but cannot find a way to save/export as a SVG file for journal publication. Can you please help?


I am using SAS Studio, this is my code. 

 

PROC IMPORT OUT=OUTCOMES
DATAFILE= "/home/u62465117/BTC KRAS ALLELE SUBTYPE/Outcomes By Mutations.2.xls"
DBMS=XLS REPLACE;
GETNAMES=YES;
SHEET=SHEET1;
DATAROW=3;
RUN;
 
PROC FORMAT ; VALUE GROUP 1 = "G12D" 2 = "G12V" 3 = "Q61H" ; RUN ; 
DATA MUTATION ; INPUT GROUP MONTHS STATUS $ @@ ;
FORMAT GROUP ; DATALINES ; 
RUN ;
 
ODS GRAPHICS ON / outputfmt=eps;
TITLE1 "OUTCOMES OF KRAS ALLELE SUBTYPES" ;
PROC LIFETEST DATA = OUTCOMES 
PLOTS=(SURVIVAL (ATRISK=0 TO 1000 BY 20 TEST)
LOGLOGS
LOGSURV) ;
TIME MONTHS * STATUS ( 0 ) ;
STRATA GROUP ; RUN ;
3 REPLIES 3
ballardw
Super User

Your code is writing EPS (encapsulated post script graphics if I recall correctly) . You need to specify an ODS Destination that will support SVG and then use the OUTPUTFMT=SVG (not EPS)

 

ODS LISTING and ODS HTML5 should work.

Tech1234
Calcite | Level 5

Thank you for your help.


I am an extreme beginner. Is there anyway you could elaborate (or show the additional / new code needed).

I am very sorry and very appreciative.

Ksharp
Super User

Here is an example.

ods listing gpath='c:\temp\';
ods graphics /outputfmt=svg imagename='want';
proc sgplot data=sashelp.class;
scatter x=weight y=height/group=sex;
run;

Ksharp_0-1708857911148.png

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 3 replies
  • 518 views
  • 0 likes
  • 3 in conversation