Hi all;
I have an error by using this code to transport files from SAS to word file !
Any help?
I need someone to edit this code to make proper for my requirement.
thank you so much for your time
Ibrahim
ods graphics/attrpriority=none rtf file = 'C:\Users\Barkamih\Desktop\Graphs\milkkg.rtf';
proc sgplot data=fit;
series y = Milk_Yield x = Days_In_Milk / group=pr;
xaxis values=(0 to 320 by 20);
yaxis values=(0 to 40 by 2);
styleattrs datacontrastcolors=(RED BLUE Green black) datalinepatterns=(ShortDash MediumDash LongDash solid);
run;
ods rtf close;
this is the error that I got
320 ods graphics/attrpriority=none rtf file = 'C:\Users\Barkamih\Desktop\Graphs\milkkg.rtf';
---
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, ANTIALIAS, ANTIALIASMAX, ATTRPRIORITY,
BORDER, BYLINE, DATASKINMAX, DISCRETEMAX, DRILLTARGET, GROUPMAX, HEIGHT, IMAGEMAP,
IMAGENAME, LABELMAX, LABELPLACEMENT, LEGENDAREAMAX, LOESSMAXOBS, LOESSOBSMAX,
MAXLEGENDAREA, NOANTIALIAS, NOBORDER, NOIMAGEMAP, NOSCALE, NOSCALEMARKERS, NOSUBPIXEL,
OUTPUTFMT, PANELCELLMAX, POP, PUSH, RESET, SCALE, SCALEMARKERS, SHOW, STACKDEPTHMAX,
SUBPIXEL, TIPMAX, WIDTH.
ERROR 76-322: Syntax error, statement will be ignored.
321 proc sgplot data=fit;
322 series y = Milk_Yield x = Days_In_Milk / group=pr;
323 xaxis values=(0 to 320 by 20);
324 yaxis values=(0 to 40 by 2);
325 styleattrs datacontrastcolors=(RED BLUE Green black) datalinepatterns=(ShortDash MediumDash
325! LongDash solid);
326 run;
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds
WARNING: No output destinations active.
NOTE: There were 99718 observations read from the data set WORK.FIT.
327 ods rtf close;
Please post logs in a code box (</>), so that the formatting is kept.
I suggest to split ODS GRAPHICS and ODS RTF into two separate statements.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.