I had a situation about 2 years where I needed SAS to auto email without needing to click the Send button. The way I got it done was by having SAS write a vbs file and then have SAS execute the vbs file.
/*** Create vbs code ***/
data _null_;
file "c:\temp\AutoEmail.vbs";
put 'Set fso =...
Are you trying to import the source data for the pivot table or the pivot table?
You should be able to import the source data with a proc import.
[code]
PROC IMPORT OUT= WORK.yourdata
DATAFILE= "C:\yourfile.xls"
DBMS=EXCEL REPLACE;
SHEET="sheetname$";
GETNAMES=YES;
MIXED=NO...
I'm not a time expert, but here is my best effort.
/*sample dataset*/
data unformatted;
input time code $3.;
datalines;
1300 ert
1412 brt
1435 grt
;
run;
data formatted;
set unformatted;
newtime = put(time,$4.);
format realtime hhmm5.;
realtime =...
That field is formatted as a character in the SAS dataset, correct? (i.e. - $20 or something similar)
I don't use ODS very much so I don't know if that is what is causing that, but I have used proc export and the Excel libname engine with good success to export long numbers that have been...
After thinking about it for another minute, since you data is probably in a column format, something like this can work. (Also, I adjusted the formula a little bit. Took out the "-60" to get the periods to count like you wanted them to).
data yourdata;
input Time time.;
format Time time...
kangaroo2,
Try using an equation like this.
data test;
format x y z time.;
x = '08:00:00't;
y = '08:01:00't;
z = '08:02:00't;
period1 = (x-(x-60))/60;
period2 = (y-(x-60))/60;
period3 = (z-(x-60))/60;
run;
dblan
Here is my solution, hope this helps.
/* create test dataset */
data have;
input FileName_ID $80.;
datalines;
August_ES_AMBP_Default_LeftNews_1_UK_Visa (278414)
September_ES_AMBP_Default_LeftNews_1_UK_Visa (278415)
October_ES_AMBP_Default_LeftNews_1_UK_Visa (278416)...
Just a quick guess, but it looks like your table "E_Q Data CNTS" in Access has spaces in the name.
SAS probably reads that as 3 different tables.
Maybe try "E_Q_Data_CNTS" as the table in the SAS code, or as a test rename the table in Access to something without spaces to see if you still get...
You have to use double quotes(") instead of of single quotes(') when you have a variable that needs a quotes around it.
%LET Var = D;
PROC SQL;
SELECT title, rating, category
FROM movies
WHERE category LIKE "&var.%";
QUIT;
Hope this helps.
Dave
prakash,
Do you need different sort orders for the different groups?
In your first example, Group 1's values are 8,2,then 4.
Then Group 2's values are sorted 2,8, then 4.
Here a way to sort just based on the Value column:
You can create a column to sort with, then drop it once the data is...
Prakash,
I don't understand how you want the dataset reformatted, but you can use the sort procedure to resort your data.
proc sort data=yourdataset;
by group value;
run;
By default it sorts ascending, but you can change that by putting "descending" in front of the variable you want to sort...
The part that makes more difficult is the need to have zero's when there isn't a match. For example, the number of CT's in 0. A count for that wouldn't show up in the Proc Freq because that combination isn't in the dataset.
Below is one possible way to get the data reshaped like you are...
I've added a field to try to demonstrate why you are seeing this. First, let me explain how SAS handles dates. SAS holds dates as numeric values starting at 0 and adding 1 for each following day. Additional, the counting starts with Jan 01 1960.
So to SAS
Jan 1, 1960 = 0
Jan 2, 1960 = 1...
Are you just trying to get a random sample?
You can use Proc Surveryselect for that.
proc surveyselect data=Full_List method=srs n=50 out=Sample_List;
run;
Method srs = Simple random selection
N = number of samples you want
If you want samples that equal a certain percentage of your data you...
This should work.
data have;
input x y z count ;
datalines;
1 0 1 2
1 1 0 1
0 1 1 2
;
run;
Data want;
set have;
do i=1 to count;
output;
end;
run;
You can add (drop=count i) right behind Want to remove those 2 variables.
Here is something I use in a lot of my code.
%let UserID=%sysget(USERNAME);
To check to see if it returns what you want, you can run:
%put User is &UserID;
Hopefully this is what you need.
Dave
I think you would have to use SAS to execute a .vbs file to shutdown the PC.
Here is a quick attempt to show how it could be done:
data _null_;
file "c:\temp\Shutdown.vbs";
put 'Sub ShutDown';
put 'nLogOff=0';
put 'nReboot=2' ;
put 'nForceLogOff=4';
put 'nForceReboot=6';
put 'nPowerDown=8'...
Are the values in graf6 literally "<=1 and ">=2", or are you trying to say if the value in graf6 is less than or equal to 1 (or greater than/equal to 2)?
If they are literally "<=1 and ">=2", then your code looks ok. For example, using your code plus a small sample dataset, the following runs...
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.