where account_id in ( select distinct account_id
i can control the out put of main query in terms of no of observation to be displayed. but now here how can i control the o/p of subquery.
in dim_account various account_id are availble and each distinct accout_id have various rows.
the output of subquery may be many account_id but i want only first row as output of subquery. so that all rows belongs single account_id will be displayed.
Hint: we use (Firstobs=1 obs=1) while reading value from data set .
I'm not too sure whether I understood your problem. Are you trying to identify records with no duplicate keys. If so ... this might help. It uses a nice feature of SAS called "query remerging". You can, of course, use this feature in a subquery.
do i=1 to 1000;
create table T02_output as
group by x