06-16-2016 02:25 PM - edited 06-16-2016 02:41 PM
This macro works very well before I found on the internet.
I used this macro for a long time.
%let TABLE=sashelp.cars; %let COLUMN=make; proc sql noprint; /* build a mini program for each value */ /* create a table with valid chars from data value */ select distinct cat("DATA out_",compress(&COLUMN.,,'kad'), "; set &TABLE.(where=(&COLUMN.='", &COLUMN., "')); run;") into :allsteps separated by ';' from &TABLE.; quit; /* macro that includes the program we just generated */ %macro runSteps; &allsteps.; %mend; /* and...run the macro when ready */ %runSteps;
I need of two things
1. I want to In addition to adding new condition (where Cylinders=max(Cylinders)) but I could not.
2. Not create SAS data sets, I want to cretae ods html file and save in my pc.
I would be glad if you help.
06-16-2016 06:12 PM
This macro is creating code you can run.
You can add your condition before the RUN statement.
What at do you mean by HTML output? Do you want a file for each dataset?
06-17-2016 03:12 AM
thanks for your reply to Reeza
I gave the example of the data set (sashelp.cars).
I have the data set with continuous data added every day or every hours.
So I can not add condition before the RUN statement. Because of dynamic data.
This macro make output SAS data set. I want to create type CSV or HTML.
06-17-2016 07:40 AM
yes,my condition is dynamic which is added date and time whose name is add_date.
First of all;
1.Records are added at different times.
2.Records continuously being added to and retained in the archives table.
3.On the same date and time can be added thousands of records for different regions
4.My first condition is the Maximum Addition time(add_date)
5.Second condition is regions
6.Select the records provide the first and second condition
7.then the selected recording by region and add_date , want to save as CSV or HTML file with name is region_add_date
Region names and add_date are dynamic.
06-25-2016 09:13 AM
Your requirements have nothing to do with the macro you initially posted. Where does it come in?
1.For your first condition a SQL query works fine
2. For second to create a CSV or multiple use either a data step export or proc export.
Which of those do you need help with?