New_Variable=a,b,c,d,e,f,g,h,i... up ab,ac ...az
I want them to create new datasets
if New_Variable='a' then output;
if New_Variable='az' then output;
like this based on this varaible new dataset should be created how can i do this.
and in the middle there are different names also in New_Variable 'acz','mnb'
and based this new datasets should be created.
You can write a SAS macro that will execute for each SAS variable value. Suggest you write out your SAS DATA step so it works properly with one value, and then convert that DATA step into a macro where the "value" is substituted with a SAS macro variable -- the macro variable will be passed to the macro with each execution. One tip is that when referencing a macro variable as a literal, you enclose it in double-quote marks, not single-quotes.
To find all unique (DISTINCT) variable values, you may consider using the PROC SQL DICTIONARY members (or SAS view equivalent) - and with this information you could use macro code to generate macro invocations, once per data value.
Some highly recommended reading links provided below to get you started.
Suggested Google advanced search argument, this topic/post: