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;
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);
Thank you. I tried the program you recommended, but the SAS log shows that ODSPDF printing did not produce output.
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.
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!
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.