BookmarkSubscribeRSS Feed
stancemcgraw
Obsidian | Level 7

Hello,

  I was just going through some simple nonparametric tests when I decided to try a procedure that would place two variables tha tI want to look at side by side in terms of frequency and counts, pre and post next to each other in a table:

 

609  proc freq ;

610     tables nihss lastmRs nihss*lastmRs / out=FreqCount outexpect sparse;

611     weight Count;

ERROR: Variable COUNT not found.

612     title 'nihss and lastmrS';

613  run;

 

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set WORK.FREQCOUNT may be incomplete.  When this step was stopped there were 0 observations and 0 variables.

NOTE: PROCEDURE FREQ used (Total process time):

      real time           0.01 seconds

      cpu time            0.00 seconds

 

 

 

614  proc print noobs;

615     title2 'Output Data Set from PROC FREQ';

616  run;

 

NOTE: No variables in data set WORK.FREQCOUNT.

NOTE: PROCEDURE PRINT used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

 

 

617  proc freq ;

618     tables nihss lastmRs nihss*lastmRs / out=FreqCount outexpect sparse;

ERROR: Variable NIHSS not found.

ERROR: Variable LASTMRS not found.

ERROR: Variable NIHSS not found.

ERROR: Variable LASTMRS not found.

619     weight Count;

ERROR: Variable COUNT not found.

620     title 'nihss and lastmrS';

621  run;

 

**first it said that count was not found, so then I decided to stop trying that procedure and go back to trying the other procedures and now my variables cannot be found:

 

627  proc ttest h0 = 50;

628    var age;

ERROR: Variable AGE not found.

629  run;

 

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE TTEST used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 seconds

 

 

I have no idea how to reverse this.  It seems to be stuck on that first procedure I wanted tot ry....

8 REPLIES 8
Reeza
Super User

All of your Procs are missing DATA=DATASETNAME

 

You need to tell the proc what dataset to use. 

The default value is last created dataset, but there are exceptions so I recommend ALWAYS specifying it. 

 

 

stancemcgraw
Obsidian | Level 7

Ok-but that did not fix my bigger problem.  I was able to perform all of my proc steps without the data=statement for that past couple of hours, but once I tried the above procedure, it messed something up.  I want to be able to do that again, 

 

672  proc univariate data=iat.timetoiat;

673  histogram punctorecanal/normal;

674  run;

NOTE: PROCEDURE UNIVARIATE used (Total process time):

      real time           0.43 seconds

      cpu time            0.18 seconds

 

 

675  proc npar1way wilcoxon;

676    class sex;

ERROR: Variable SEX not found.

677    var time_to_nuero;

ERROR: Variable TIME_TO_NUERO not found.

678  run;

 

NOTE: The SAS System stopped processing this step because of errors.

NOTE: PROCEDURE NPAR1WAY used (Total process time):

      real time           0.00 seconds

      cpu time            0.00 second

Reeza
Super User

Don't. 

Your going to run into errors or unexpected behaviour. 

Reeza
Super User

Don't. 

Your going to run into errors or unexpected behaviour. 

stancemcgraw
Obsidian | Level 7

ok, I can do it agian (using the code below,  but now everything has a incorrect title...)

 

data iat;set iat.timetoiat;

proc print data=iat.timetoiat;

run;

stancemcgraw
Obsidian | Level 7
I figured it out, you do
title;

and it cancels all titles. thanks!
Reeza
Super User

I really hope you do explicilty state your datasets...especially for future you or the analyst who has to read your code.

For example, what is the source data for the proc means statement, the class or temp2 dataset output from proc freq? And more importantly can you identify it without running the code.

data class;
set sashelp.class;
run;

proc freq data=class; table age*sex/out=temp2; run; proc means; run;

Anyways, if your question is answered please mark it as answered.

Reeza
Super User

And it's actually likely the procedure before the Freq that messed things up since it doesn't have a data set to reference anymore. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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