BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mabeg510
Calcite | Level 5

I am trying to use pdmix800.sas in order to generate letter displays of pairwise mean comparisons in proc mixed?

Previously I was running SAS studio on my computer. I had a pdmix800.sas macros file stored locally on my computer and I was running and getting results correctly. 

 

Now I am using SAS studio on cloud (remote) and I was not able to call the macros file. I searched the SAS community, and it seemed to me to create a library for the macros file in my cloud account (I am not sure if this is the correct way). I did that and I gave a path to it in the editor. But the code is not giving me an output for letter displays.

 

I am appreciating all help in this for the correct code!

 

This the code I have written in the editor:

 

proc sort; by group;
proc mixed; by group;
class buff time;
model e=time;
random buff;
repeated time / type=AR(1) sub=buff;
lsmeans time / diff;

ODS LISTING;
ods output diffs=ppp lsmeans=mmm;
ods listing exclude diffs lsmeans;
run;
LIBNAME mydata "/home/mabeg510/PD folder";
%pdmix800(ppp,mmm,alpha=.05,sort=no);

run;

 

This is the log file I am getting:

 

143 LIBNAME mydata "/home/mabeg510/PD folder";
NOTE: Libref MYDATA was successfully assigned as follows:
Engine: V9
Physical Name: /home/mabeg510/PD folder
WARNING: Apparent invocation of macro PDMIX800 not resolved.
144 %pdmix800(ppp,mmm,alpha=.05,sort=no);
_
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
145
146 run;

 

Thank you for the help.

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Before you can use a macro such as that you have to compile the macro code to make it available in the current session (unless it is one of the macro functions SAS supplies).

That means you need the code that starts with

%macro pdmix80(<typically parameter list goes here>)

<code>

%mend;

 

You have to compile that code by submitting it before calling the macro. Then the macro would be available for "invocation".

 

If the %macro / %mend is not in your current program you can reference the file by use of

%include <path>\pdmix800.sas; 

%include is an instruction to use text from a file as part of the current program. This would have to appear before your invocation of the macro.

You would have to make sure that your studio session sees that file which may mean uploading the code to the server running SAS Studio, probably best to your "/home/mabeg510/PD folder" where that folder would be the Path part.

View solution in original post

2 REPLIES 2
ballardw
Super User

Before you can use a macro such as that you have to compile the macro code to make it available in the current session (unless it is one of the macro functions SAS supplies).

That means you need the code that starts with

%macro pdmix80(<typically parameter list goes here>)

<code>

%mend;

 

You have to compile that code by submitting it before calling the macro. Then the macro would be available for "invocation".

 

If the %macro / %mend is not in your current program you can reference the file by use of

%include <path>\pdmix800.sas; 

%include is an instruction to use text from a file as part of the current program. This would have to appear before your invocation of the macro.

You would have to make sure that your studio session sees that file which may mean uploading the code to the server running SAS Studio, probably best to your "/home/mabeg510/PD folder" where that folder would be the Path part.

mabeg510
Calcite | Level 5
Dear ballardw,
Thank you so much for helping!
Cheers

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
  • 2 replies
  • 496 views
  • 1 like
  • 2 in conversation