I want 19 datasets using sashelp.class
I mean each observation as one dataset
And also how to find no of obs in unknown dataset
Thank u
Anand
Mind that most people here have an aversion against assisting people in being idiots, so forget that brain-dead splitting idea.
If it is an interview question, the proper answer is "don't do it, as it's a useless waste of time and therefore the employer's money".
To get the number of obs in a SAS dataset use Proc Contents.
proc contents data=sashelp.class;
run;
Another way
Usuing
1) Why on earth do you want a separate data set for each observation?
2) There are several ways to do this. Here are two..
data _null_;
if 0 then set sashelp.class nobs=nobs;
call symputx('nobs', nobs);
run;
%put &nobs.;
data _null_;
dsid=open('sashelp.class');
nobs=attrn(dsid, 'nobs');
rc=close(dsid);
put nobs;
run;
Usung macro s do loop
What do you mean? You have to be more specific than this.
Ok thank you
Bu i want split 19 datasets
Each obs as one dataset
Using sashelp.class library
Mind that most people here have an aversion against assisting people in being idiots, so forget that brain-dead splitting idea.
If it is an interview question, the proper answer is "don't do it, as it's a useless waste of time and therefore the employer's money".
Retrieve the number of observations from dictionary.tables (with SQL).
Splitting datasets is not helpful in >90 % of cases, and with a small dataset like sashelp.class it's plain stupidity.
splitting a datasets would be more for a process of bills payed and bills not payed from a dataset bills due during "this month".
Why make your life more complicated that it is.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.