@GN0001 wrote:
Hello team,
PHI = protected health information
This is what the code edited to and it worked. I placed it here for future users. The problem was that "Where" turned to red all of a sudden. I changed the location of where and deleted semicolon from proc summary line.
This is the code:
proc summary nway missing data=path.members
(where = (MBR_STATE="CA"));
This is the log:
2976
2977 proc summary nway missing data=path.members
2978 (where = (MBR_STATE="CA"));
2979 var a b c
2980 class zip;
2981 output out=thisdata (drop=_TYPE_ _FREQ_) sum=;
2982 run;
Thanks,
Blue
Not quite. It does not include the notes about the completion of the step, or not, and how many observations are in the output data set.
When I replace your data set with SASHELP.CLASS and use variables from that set in the same syntax this is the result:
364 proc summary nway missing data=sashelp.class
365 (where = (age>13));
366 var height weight
367 class sex;
ERROR: Variable CLASS not found.
ERROR: Variable Sex in list does not match type prescribed for this list.
368 output out=thisdata (drop=_TYPE_ _FREQ_) sum=;
369 run;
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.THISDATA may be incomplete. When this step was stopped there were 0
observations and 0 variables.
WARNING: Data set WORK.THISDATA was not replaced because this step was stopped.
NOTE: PROCEDURE SUMMARY used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Note the ERROR message prior to CLASS because Class is not a variable in the data set. Your code should show something different if you do not have a variable named Class in your path.members data set.
If I correct that with the ; in the correct place at the end of the VAR statement:
370 proc summary nway missing data=sashelp.class
371 (where = (age>13));
372 var height weight;
373 class sex;
374 output out=thisdata (drop=_TYPE_ _FREQ_) sum=;
375 run;
NOTE: There were 9 observations read from the data set SASHELP.CLASS.
WHERE age>13;
NOTE: The data set WORK.THISDATA has 2 observations and 3 variables.
NOTE: PROCEDURE SUMMARY used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
The NOTEs at the end of the code are important and often answers questions. Such as "why is my output set empty". READ the log and you might set something about 0 observations read from the data set where the condition is stated. Happens all the time when we misspell a word or miss the case of a value "jane" instead of "Jane" for example.
So show the notes after the procedure.
IF there are not any, and that can happen, then save your code and restart your SAS session. The most common cause of no details in the log is creating an imbalanced quote or ( ) pair so that the syntax parser thinks your posted code is part of something else and you have likely made the current SAS session unstable. Especially if you have submitted multiple instance of incorrect code.
... View more