BookmarkSubscribeRSS Feed
kunjgemi
Calcite | Level 5

Hi, 

 

I am trying to learn the SGPLOT STYLEATTRS Statement. On trying below code (exactly copied from the URL add for reference), I am getting "ERROR 180-322: Statement is not valid or it is used out of proper order.". I checked my syntax as well but can't figure out what is an actual issue here. Can somebody help?

 

/* Sort the data set by the group variable */
proc sort data=sashelp.class out=class;
  by age;
run;
/* Generate the graph using the sorted data */
proc sgplot data=class;
  styleattrs  
     datacontrastcolors=(red green blue) 
     datalinepatterns=(dot solid);
  series x=height y=weight / group=age;
  keylegend;
run;

 

https://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p1dt33l6a6epk6n1chtynsgsjgit.htm&doc...

6 REPLIES 6
data_null__
Jade | Level 19

Show your log.  I'll guess that either your version of SAS does not support STYLEATTRS or there is some other problem causing the 180 error.

kunjgemi
Calcite | Level 5

I am doing this coding in SAS EG 7.15 (7.100.5.5850) (32-bit) SAS version is 9.3.

Reeza
Super User

Your link above is for SAS 9.4 but you've indicated you're using SAS 9.3 

 

Checking the SAS 9.3 documentation, STYLEATTRS is not listed in the syntax. 

 

https://support.sas.com/documentation/cdl/en/grstatproc/65235/HTML/default/viewer.htm#n0yjdd910dh59z...

 

If your purpose is learning, try SAS Academics on Demand (Independent Learner path) or SAS University Edition. 

If your purpose is implementing style controls, you'll need either template modifications or GTL depending on what you're trying to do. 

 


@kunjgemi wrote:

Hi, 

 

I am trying to learn the SGPLOT STYLEATTRS Statement. On trying below code (exactly copied from the URL add for reference), I am getting "ERROR 180-322: Statement is not valid or it is used out of proper order.". I checked my syntax as well but can't figure out what is an actual issue here. Can somebody help?

 

/* Sort the data set by the group variable */
proc sort data=sashelp.class out=class;
  by age;
run;
/* Generate the graph using the sorted data */
proc sgplot data=class;
  styleattrs  
     datacontrastcolors=(red green blue) 
     datalinepatterns=(dot solid);
  series x=height y=weight / group=age;
  keylegend;
run;

 

https://documentation.sas.com/?docsetId=grstatproc&docsetTarget=p1dt33l6a6epk6n1chtynsgsjgit.htm&doc...


 

kunjgemi
Calcite | Level 5

Hi, 

 

Currently, my company has SAS 9.3, so how shall I add differently line patterns and symbol to below plot with SAS 9.3?

 

Untitled.png

Reeza
Super User
Data attribute maps, which I recommend over STYLEATTRS anyways or, as I mentioned above, customize your style template.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1643 views
  • 3 likes
  • 4 in conversation