As a generic 'handy hint', the following code will reset a SAS session which has become corrupted and keeps erroring out:
;;;; * ( ( %* ' " ) ) */; %mend; run cancel;
Cheers,
Chris
Hi Bhanu. Not sure your dataset is structured too wonderfully, but this code will work providing your data is EXACTLY as you say - i.e. always having pairs of records where day is D-01 or D001 deprending on PRE- or POST-
data data2; set data1;
newvar=substr(hours,1,6);
run;
proc sort data =...
Intriguing question. I haven't tested this code, which I found here:
http://www.science.gmu.edu/stat362/02f/sas12.htm
but worth a try...
%MACRO MovAve(ds,v,ln);
%* This adds to the specified dataset, the moving
average of the specified variable over a given
length.
The name of the...
Hi
If it's the SAS log that's filling up, the following link gives a few options to prevent the messages from appearing...
http://support.sas.com/kb/5/888.html
Cheers,
Chris
Actually, thinking about it, a simpler way to get the same result would be to use proc sql, (no proc print required as sql output is automatically printed) - try this...
proc sql;
select
variable1, variable2, etc
from your_dataset
where mod(monotonic(),100000)=0
;
quit;
Hi - I think you need to create an observation number on your source dataset before doing the proc print. Try a variation of this:
data xx; set whatever;
zz=_n_;
run;
proc print data=xx;
where mod(zz,100000)=0;
run;
Hi all - basics of the problem are as follows:
I have a dataset with many records. Each contains 12 variables, representing the status of an account at the end of each month in a given year. Is there an easy way to compare these variables (without a lot of if - else statements).
I need to...
OK. The source dataset looks like this
1 10 50
2 10 10
3 20 60
4 10 10
5 20 10
6 10 70
7 10 40
8 30 30
9 20 10
12 10 10
It loops through fine until the value of IntLookUpValue hits 10, then the error is triggered at the statement
If IsError(myVar =...
Hi folks
I have written a piece of code to populate cells from a source data file. There will be no more than 12 rows of data in the source file, one row per month. However, sometimes one or more months will not produce any data and the number of rows of data will be fewer. My code works fine...
Glenn - absolutely spot on! I removed the chr(34)s from the right hand side of the 'Range2=' part of the expression, as it was looking for numbers.
It now works perfectly - thanks for your time and effort, have a star!
Thanks for that Glenn - I think it's getting there! It's no longer returning the error message, but everything now resolves to zero (incorrectly). Could you talk me through the significance of the Chr(34)s in the string - I might then be able to work out what to do to fix it?
Thanks again,
Chris
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.