BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Matim
Obsidian | Level 7

Hello,

I wrote code to perform a post hoc pairwise comparison on my dataset called garlic. I view the answers and edited my code to correct any errors and warnings to match with the code found on the solution. After executing the program, I have one warning and one error. The warning states "

Output 'control plot' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used." The error states "Statement is not valid or it is used out of proper order."? How can I resolve the warning and error messages? 
 
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
 78         proc glm data=stat1.garlic;
 79            plots(only)=(diffplot(center)controlplot);
                 _____
                 180
 NOTE: The previous statement has been deleted.
 ERROR 180-322: Statement is not valid or it is used out of proper order.

The log is telling you that something is wrong with the PLOTS statement where it is. In fact, there is no PLOTS statement in PROC GLM. 


Why does PROC GLM not recognize the PLOTS option of the PROC GLM statement, and think it is a separate statement? Because you have ended the PROC GLM statement with a semicolon. If you remove the semicolon, then PLOTS becomes part of the PROC GLM statement where it is a valid option.

--
Paige Miller

View solution in original post

14 REPLIES 14
PaigeMiller
Diamond | Level 26

Many of us will not download attachments.

 

Please copy and paste the log from the SAS log window (do not copy from your MS Word document) and paste it here after clicking on the </> icon. Please show us the ENITRE log for this PROC. Do not chop out parts of the log

--
Paige Miller
Matim
Obsidian | Level 7

Sure @PaigeMiller ,

 

Here is the log from SAS Studio,

 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         *Practice: Using PROC GLM to Perform Post Hoc Pairwise Comparisons
 75         1);
 76         ods graphics;
 77         ods select lsmeans diff diffplot controlplot;
 78         proc glm data=stat1.garlic;
 79            plots(only)=(diffplot(center)controlplot);
                 _____
                 180
 NOTE: The previous statement has been deleted.
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 80            class fertilizer;
 81            model Bulbwt=Fertilizer;
 82            Tukey: lsmeans Fertilizer / pdiff=all adjust=tukey;
 83            title "Post-Hoc Analysis of ANOVA---Fertilizer as Predictor";
 84         run;
 
 85         quit;
 
 WARNING: Output 'controlplot' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
          verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
          the NOPRINT option is not used.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE GLM used (Total process time):
       real time           4.90 seconds
       cpu time            0.26 seconds
       
 86         title;
 87         
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 101      

 Let me know if I need to do anything else.

Thanks.

PaigeMiller
Diamond | Level 26
 78         proc glm data=stat1.garlic;
 79            plots(only)=(diffplot(center)controlplot);
                 _____
                 180
 NOTE: The previous statement has been deleted.
 ERROR 180-322: Statement is not valid or it is used out of proper order.

The log is telling you that something is wrong with the PLOTS statement where it is. In fact, there is no PLOTS statement in PROC GLM. 


Why does PROC GLM not recognize the PLOTS option of the PROC GLM statement, and think it is a separate statement? Because you have ended the PROC GLM statement with a semicolon. If you remove the semicolon, then PLOTS becomes part of the PROC GLM statement where it is a valid option.

--
Paige Miller
Matim
Obsidian | Level 7
Alright @PaigeMiller,
I removed the semicolon after the garlic dataset statement and saw the error removed. Thanks for your help in this part. I still have a warning regarding the controlplot output. How do I create the output?
ballardw
Super User

@Matim wrote:

Hello,

I wrote code to perform a post hoc pairwise comparison on my dataset called garlic. I view the answers and edited my code to correct any errors and warnings to match with the code found on the solution. After executing the program, I have one warning and one error. The warning states "

Output 'control plot' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used." The error states "Statement is not valid or it is used out of proper order."? How can I resolve the warning and error messages? 
 

The type of message relate to "Output 'control plot' was not created" has a few common issues. The one I make most often is using ODS OUTPUT with the incorrect name, the names typically do not have spaces in them so you might just need ControlPlot instead of "control plot". As the note mentioned the procedure may require a specific option to be used on either a Proc statement or other statement. So make sure the options you used will create the object. Typically you can search the documentation under the Details tab for "ODS Graphics" or "ODS Table Names" to find the proper name and the required options.

Matim
Obsidian | Level 7
I have tried correcting the spelling of controlplot and separated this word into two words of 'control' and 'plot', but I still got the same warning message. I will try searching the documentation and see what I can find there.
PaigeMiller
Diamond | Level 26

Hello, @Matim 

 

Show me the log where you have made the change I described. I can't diagnose your code from written paragraphs.

--
Paige Miller
Matim
Obsidian | Level 7

Sure @PaigeMiller ,

 

Here is the log with the changes I have made thus far from your advice.

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         *Practice: Using PROC GLM to Perform Post Hoc Pairwise Comparisons
 75         1);
 76         ods graphics;
 77         ods select lsmeans diff diffplot ControlPlot;
 78         proc glm data=stat1.garlic
 79            plots(only)=(diffplot(center) ControlPlot);
 80            class fertilizer;
 81            model Bulbwt=Fertilizer;
 82            Tukey: lsmeans Fertilizer / pdiff=all adjust=tukey;
 83            title "Post-Hoc Analysis of ANOVA---Fertilizer as Predictor";
 84         run;
 
 85         quit;
 
 WARNING: Output 'ControlPlot' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
          verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
          the NOPRINT option is not used.
 NOTE: PROCEDURE GLM used (Total process time):
       real time           0.51 seconds
       cpu time            0.23 seconds
       
 
 86         title;
 87         
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 101        
PaigeMiller
Diamond | Level 26

You might want to bookmark this part of the SAS documentation, if you are going to be doing more plotting from PROC GLM.

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

 

It says clearly you must use the option PDIFF=CONTROL in the LSMEANS statement to get the CONTROLPLOT output.

 

Capture.PNG

 

 

--
Paige Miller
Matim
Obsidian | Level 7
Okay Paige,
Thanks for the reference table.
Matim
Obsidian | Level 7

Hi @PaigeMiller ,

So, I tried to apply the statement of LSMEANS/PDIFF=CONTROL and I got 2 errors as the result. Here is the log for the code.

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         ods graphics;
 75         
 76         ods select lsmeans / pdiff=control;
                                      _
                                      22
                                      200
 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, #, (, '.', /, WHERE, \.  
 ERROR 200-322: The symbol is not recognized and will be ignored.
 77         proc glm data=stat1.garlic
 78            plots(only)=(diffplot(center) controlplot);
 79            class fertilizer;
 80            model Bulbwt=Fertilizer;
 81            Tukey: lsmeans Fertilizer / pdiff=all adjust=tukey;
 82            title "Post-Hoc Analysis of ANOVA---Fertilizer as Predictor";
 83         run;
 
 84         quit;
 
 NOTE: PROCEDURE GLM used (Total process time):
       real time           0.61 seconds
       cpu time            0.29 seconds
       
 
 85         title;
 86         
 87         
 88         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 100        

In the original code where I had one warning, I seeked the solution to the exercise and the solution shows the exact coding where I originally had one warning and zero errors. I copied the solution to my programming interface and ran the code. I still got the same warning message. Am I not applying the reference code correctly? 

Thanks

Mat.

PaigeMiller
Diamond | Level 26

PDIFF=CONTROL is supposed to go in the LSMEANS statement and not the ODS statement.

--
Paige Miller
Matim
Obsidian | Level 7

Alright,

I removed the pdiff=control from the ods statement and placed it in the lsmeans statement under proc glm based on the reference table. I now end up with more warnings and one error. How did I get more warnings that now state 'diff','diffplot', and 'lsmeans' were not created? I also got an error stating 'a Model Statement' must be created'. Here is the log again.

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         ods graphics;
 75         ods select lsmeans diff diffplot controlplot;
 76         proc glm data=stat1.garlic
 77            plots(only)=(diffplot(center) controlplot);
 78            lsmeans/pdiff=control;
 79            lsmeans/pdiff;
 80            class fertilizer;
 81            model Bulbwt=Fertilizer;
 82            Tukey: lsmeans Fertilizer / pdiff=all adjust=tukey;
 83            title "Post-Hoc Analysis of ANOVA---Fertilizer as Predictor";
 84         run;
 
 ERROR: A MODEL statement must be given.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE GLM used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 WARNING: Output 'controlplot' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
          verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
          the NOPRINT option is not used.
 WARNING: Output 'diffplot' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
          verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
          the NOPRINT option is not used.
 WARNING: Output 'diff' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, verify 
          that the appropriate procedure options are used to produce the requested output object.  For example, verify that the 
          NOPRINT option is not used.
 WARNING: Output 'lsmeans' was not created.  Make sure that the output object name, label, or path is spelled correctly.  Also, 
          verify that the appropriate procedure options are used to produce the requested output object.  For example, verify that 
          the NOPRINT option is not used.
 85         quit;
 86         title;
 87         
 88         
 89         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 101        

 

PaigeMiller
Diamond | Level 26

You might want to bookmark the PROC GLM documentation and refer to it as needed.

https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.4&docsetId=statug&docsetTarget=statu...

 

The LSMEANS statements must come AFTER the model statement.

 

Capture.PNG

--
Paige Miller

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 14 replies
  • 2295 views
  • 1 like
  • 3 in conversation