I have 2 records for one member :
data test;
infile datalines;
input flag $ mem_num $ model $;
datalines;
In_Mbr 2001000000000000 HMO
In_clms 2001000000000000 HMO
;
Can I get some help make it to one record :
/*
In_both 2001000000000000 HMO
*/
@asabou01 wrote:
I have 2 records for one member :
data test;
infile datalines;
input flag $ mem_num $ model $;
datalines;
In_Mbr 2001000000000000 HMO
In_clms 2001000000000000 HMO
;
Can I get some help make it to one record :
/*
In_both 2001000000000000 HMO
*/
You would have to supply every single possible value of Flag variable and then what you want to show for each possible combination of them.
Are there any other variables in the data set? If so which values are kept?
And what can you do with this data that could not be done with the original?
You can try the below code
data test;
infile datalines;
input flag $ mem_num $ model $;
datalines;
In_Mbr 2001000000000000 HMO
In_clms 2001000000000000 HMO
;
proc sql;
create table want as select count(*) as cnt, mem_num, model, 'In_both' as flag from test group by mem_num, model;
quit;
I don't see the logic here?
@asabou01 wrote:
I have 2 records for one member :
data test;
infile datalines;
input flag $ mem_num $ model $;
datalines;
In_Mbr 2001000000000000 HMO
In_clms 2001000000000000 HMO
;
Can I get some help make it to one record :
/*
In_both 2001000000000000 HMO
*/
You would have to supply every single possible value of Flag variable and then what you want to show for each possible combination of them.
Are there any other variables in the data set? If so which values are kept?
And what can you do with this data that could not be done with the original?
Thank you everyone. I am all set. There were only 3 values for flag.
Thanks again.
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.