02-26-2015 04:28 PM
I have a table called employee.Which have 10 different column or variable.I want to divide the table on the basis of column means 3 col or variable in each table.
code should handel if the col or variable number increased by 1000+.
Appreciate your suggestions.
02-26-2015 06:50 PM
Your question is unclear. For starters:
What do you mean by divide?
How did you come up with 3?
10 is not equally divisible by 3, what happens to the remainder?
Please post sample data/output and/or more details.
02-26-2015 07:19 PM
you can divide the table vertically.I know it's not equally divisible. that's why I have put 3 as a number so that if what ever the column remain it ges to the last table
for ex below varidable or column are there
Last_name first_name Salary Address Hire_date Start_date End_date Account minsal maxsal
so Table1 will have
Last_name first_name Salary
Address Hire_date Start_date
End_date Account minsal
let me know if I can able to explain you
02-26-2015 07:48 PM
Can I ask why you want to do this? You would have to keep a KEY variable across all datasets otherwise they're not useable together anymore.
If you are separating it's usually separating into a star/snowflake schema and fact table.
02-26-2015 07:41 PM
This macro should be flexible to meet your needs.
%MACRO SPLIT (
LENGTH VAR $ &LEN.;
do i=1 to &size until (last);
set sashelp.vcolumn (where=(LIBNAME="%upcase(&lib)" AND MEMNAME="%upcase(&mem)")) end=last;
VAR=CATX(' ', VAR, NAME);
CALL SYMPUTX(CATS('NAME', _N_),VAR);
IF LAST THEN CALL SYMPUTX('N', _N_);
%DO I=1 %TO &N;