Programming the statistical procedures from SAS

sprdplot macro

Accepted Solution Solved
Reply
Regular Contributor
Posts: 204
Accepted Solution

sprdplot macro

Dear SAS forumers,

 

Can I please ask if anyone has tried this spread-level plot macro http://www.datavis.ca/sasmac/sprdplot.html?

If so, did you manage to run it without problems?

When I tried to run it with my data, the error started at line211: %labels(data=_sumry_, x=logm, y=logs, text=left(%scan(&class,1)), size=&htext, pos=2, out=_label_); Here I have enclosed partial log window output if you could explain how it can be resolved please?
 

Thank you much.

 

17     %labels(data=_sumry_, x=logm, y=logs, text=left(%scan(&class,1)),        size=&htext,
       -
       180
17  ! pos=2, out=_label_);  data _slope_;    set _parms_(keep=logm);     drop logm power;
17  ! xsys='1'; ysys='1';    length text $16 function $8;    x = %scan(&sploc,1);    y
WARNING: Apparent invocation of macro LABELS not resolved.
SYMBOLGEN:  Macro variable CLASS resolves to raps drinkinghelp2
SYMBOLGEN:  Macro variable HTEXT resolves to 1.7
MPRINT(SPRDPLOT):   %labels(data=_sumry_, x=logm, y=logs, text=left(raps), size=1.7, pos=2,
out=_label_);
NOTE: The previous statement has been deleted.
WARNING: The data set WORK._PARMS_ may be incomplete.  When this step was stopped there were 0
         observations and 0 variables.
MPRINT(SPRDPLOT):   data _slope_;
MPRINT(SPRDPLOT):   set _parms_(keep=logm);
ERROR: The variable LOGM in the DROP, KEEP, or RENAME list has never been referenced.

 


Accepted Solutions
Solution
‎06-08-2016 04:38 AM
Trusted Advisor
Posts: 1,114

Re: sprdplot macro

Yes, in http://www.datavis.ca/sasmac/labels.html it says: "This is an updated version of the LABEL macro ..., renamed to 'LABELS' to avoid a conflict with the LABEL macro in ANNOMAC.SAS." So, LABELS might be the right one to use.

View solution in original post


All Replies
Grand Advisor
Posts: 16,908

Re: sprdplot macro

It looks like it's dependent on another macro - labels. Did you download that macro and define it?

 

It looks to be here:

http://datavis.ca/sasmac/labels.html

Trusted Advisor
Posts: 1,114

Re: sprdplot macro

Hello @wong,

 

I'm not sure why in your code macro LABELS is called, whereas in the code of SPRDPLOT I only find a call of macro LABEL. Anyhow, both LABEL and LABELS are available under Utility macros --> Graphics utility on the web page you linked to. So, simply download the macros you need and compile them (i.e. simply submit the macro code) or put them into an autocall library before you call SPRDPLOT.

Grand Advisor
Posts: 16,908

Re: sprdplot macro

Hmm...interesting. The macro for download is also called %labels, not %label. 

 

Michael also stores his macros on GitHub and %label and %labels macro are both available here. It does look like it was updated to %labels about 4 years, in the last change note.

 

https://github.com/friendly/SAS-macros

 

 

Solution
‎06-08-2016 04:38 AM
Trusted Advisor
Posts: 1,114

Re: sprdplot macro

Yes, in http://www.datavis.ca/sasmac/labels.html it says: "This is an updated version of the LABEL macro ..., renamed to 'LABELS' to avoid a conflict with the LABEL macro in ANNOMAC.SAS." So, LABELS might be the right one to use.

Regular Contributor
Posts: 204

Re: sprdplot macro

Dear @FreelanceReinhard and @Reeza.

The sprdplot macro now runs without problem.

Thank you very much Smiley Happy

 

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 253 views
  • 6 likes
  • 3 in conversation