BookmarkSubscribeRSS Feed
YoloY
Calcite | Level 5

I ran the SAStraj program, and the result is shown in figure, but cannot be exported to a PDF file.I would appreciate it if someone could help me solve this problem.

ods pdf file="E:\traj.pdf";
%macro traj(data, out, op, os ,oe, nn,order,tilte,subtitle);
PROC TRAJ DATA=&data OUT=&out OUTPLOT=&OP OUTSTAT=&OS OUTEST=&OE; 
id pe_id;
VAR ecrf_06 ecrf_08 ecrf_10 ecrf_12; 
INDEP T1-T4; 
MODEL CNORM;
MIN 0; 
MAX 100; 
NGROUPS &nn;
ORDER ℴ 
RUN;
%mend traj;
%traj(men, out, op, os ,oe,3, 4 4 4,Men,Group3);
ods pdf close;

1.png

3 REPLIES 3
MayurJadhav
Quartz | Level 8

Not sure why it is not working neither I've used proc traj procedure before but it looks like if you put ods statement inside the sas macro might work.

Also, it is worth checking destination path is accessible. @YoloY 

 

Like this:

%macro traj(data, out, op, os ,oe, nn,order,tilte,subtitle);
ods pdf file="E:\traj.pdf";
PROC TRAJ DATA=&data OUT=&out OUTPLOT=&OP OUTSTAT=&OS OUTEST=&OE; 
id pe_id;
VAR ecrf_06 ecrf_08 ecrf_10 ecrf_12; 
INDEP T1-T4; 
MODEL CNORM;
MIN 0; 
MAX 100; 
NGROUPS &nn;
ORDER ℴ 
RUN;
ods pdf close;
%mend traj;
%traj(men, out, op, os ,oe,3, 4 4 4,Men,Group3);
Mayur Jadhav
BI Developer. Writer. Creative Educator.

SAS Blog → https://learnsascode.com
YouTube Channel: → https://www.youtube.com/@imayurj
YoloY
Calcite | Level 5

Thank you. I tried the program you recommended, but the SAS log shows that ODSPDF printing did not produce output.

SASKiwi
PROC Star

Are there any ODS-related errors or notes in your SAS log? Try using TRAJ outside of a macro to exclude that as a possible cause.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 352 views
  • 0 likes
  • 3 in conversation