I would like to split the value of history1 so that: coustmer id account_type history1
1 13 """STDSTD058030"""
1 3 """STDSTDSTDXXXSTDXXXS"""
2 4 """STDSTDSTDXXXSTDXXX"""
2 3 """000"""
2 10 """000000000"""
3 53 """STDXXX"""
3 10 """000001"""
"""STDxxxxxx000090030045STD"""
...would be like :
"""STD, xxx , xxx , 000, 090 , 030, 045, STD"""
I then want to count how many ac_num that have (value > 030) for each string and the min number of values before 030 appears. Maybe something like this:
select customer_No
count(ac_num)
if there is value in (type 1 ) > 030 else 0
count min number of values <30
from Test_Data
group by customer_no
;quit;
The output would be something like:
cosutmer_no , count_ac_num , values
1 2 4
2 1 5
3 0 0