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.

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
  • 6 replies
  • 937 views
  • 3 likes
  • 4 in conversation