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.

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