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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.