BookmarkSubscribeRSS Feed
ANKH1
Pyrite | Level 9

Hi, 

I´m trying to display three variables, two are type character and one is numeric. I get the following warning for var3 which type is numeric and format is YESNO.

 

proc report data= test;

column var1 var2 var3;

define var1 / display "Group";

define var2 / display "Number";

define var3 / display "Checked";

run,

 

I run it and I get this warning: var3 is not in report definition

8 REPLIES 8
PaigeMiller
Diamond | Level 26

Whenever you get an error in the log, you need to show us the ENTIRE log for that PROC or for that DATA step. Please copy the ENTIRE log as text and paste it into the window that appears when you click on the </> icon

 

PaigeMiller_0-1663012019648.png

--
Paige Miller
ANKH1
Pyrite | Level 9
1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 NOTE: ODS statements in the SAS Studio environment may disable some output features.
 73         
 74         PROC REPORT DATA= test NOWD MISSING SPLIT='~' SPACING=2
 75         style(header)=[background=white font_face=Arial font_size=8pt font_weight=bold]
 76         style(column)=[background=white font_face=Arial font_size=8pt font_weight=medium]
 77         style(report)=[rules=all frame=hsides cellpadding=1.2pt background=white font_face=Arial font_size=8pt
 77       ! font_weight=medium];
 78         
 79         columns var1 var2 var3;
 80         
 81         define var1 / display "GROUP" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 82         define var2 / display "NUMBER" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 83         define var3 / display "CHECKED" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 84         
 85         run;
 
 WARNING: var3 is not in the report definition.
 NOTE: There were 113 observations read from the data set WORK.test.
 NOTE: PROCEDURE REPORT used (Total process time):
       real time           0.12 seconds
       cpu time            0.11 seconds
       
 
 86         ods rtf close;
 87         title;
 88         footnote;
 89         
 90         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 103        
Kurt_Bremser
Super User

With a dataset like you describe, the problem can't happen:

data test;
input var1 $ var2 $ var3;
datalines;
A B 1
;

PROC REPORT DATA= test NOWD MISSING SPLIT='~' SPACING=2
style(header)=[background=white font_face=Arial font_size=8pt font_weight=bold]
style(column)=[background=white font_face=Arial font_size=8pt font_weight=medium]
style(report)=[rules=all frame=hsides cellpadding=1.2pt background=white font_face=Arial font_size=8pt
font_weight=medium];

columns var1 var2 var3;

define var1 / display "GROUP" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
define var2 / display "NUMBER" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
define var3 / display "CHECKED" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];

run;

Log:

 75         PROC REPORT DATA= test NOWD MISSING SPLIT='~' SPACING=2
 76         style(header)=[background=white font_face=Arial font_size=8pt font_weight=bold]
 77         style(column)=[background=white font_face=Arial font_size=8pt font_weight=medium]
 78         style(report)=[rules=all frame=hsides cellpadding=1.2pt background=white font_face=Arial font_size=8pt
 79         font_weight=medium];
 80         
 81         columns var1 var2 var3;
 82         
 83         define var1 / display "GROUP" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 84         define var2 / display "NUMBER" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 85         define var3 / display "CHECKED" style(column)=[cellwidth=3.0in asis=on just=center] style(header)=[just=center];
 86         
 87         run;
 
 NOTE: There were 1 observations read from the data set WORK.TEST.
 NOTE:  Verwendet wurde: PROZEDUR REPORT - (Gesamtverarbeitungszeit):
       real time           0.01 seconds
       user cpu time       0.01 seconds
       system cpu time     0.01 seconds

My guess is that you do not have var3 in the dataset. Run PROC CONTENTS on dataset test and show us the output.

ANKH1
Pyrite | Level 9

Hi, I've ran proc contents. Var3 is in the dataset. Is it maybe that Var3 is type numeric but the format is YESNO? The type and format come from the imported dataset (I didn't create the dataset). How can I change the format or type?

Thank you.

Tom
Super User Tom
Super User

I suspect you have some strange characters in your code that is causing SAS to not see VAR3 in the COLUMN statement.

 

That is the note you get when you use a variable a DEFINE statement that is not listed in the COLUMN statement.

Example:

212  proc report data=sashelp.class;
213    column name age  ;
214    define var3 / display ;
215  run;

WARNING: var3 is not in the report definition.

Retype the COLUMN statement and the DEFINE statement for VAR3 to make sure there are no hidden characters there.

ANKH1
Pyrite | Level 9

Thanks! It worked.

SASKiwi
PROC Star

You have a comma on the end of your RUN statement instead of a semicolon. I've corrected it:

proc report data= test;
column var1 var2 var3;
define var1 / display "Group";
define var2 / display "Number";
define var3 / display "Checked";
run;
ANKH1
Pyrite | Level 9

Sorry the semicolon was not added to the post but it was included the code when I ran it.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 8 replies
  • 1349 views
  • 0 likes
  • 5 in conversation