hi,
i am providing you sample data ,
where i need to check
1)PAN no should and must be 10 digits .(first 5 places should and must be CHARACETERS)
2)I need to identify the customer who has more than 20% of available corpus
data have1;
infile datalines;
input trdatedate9. invname$ corpus trtype$ PANNO$
datalines;
14/1/2013 FAISAL 20,000.00 SWITCH AJYPA*****
14/1/2013 RAMESH 1,000,000.00 PURCHASE ALOPP*****
11/1/2013 AMIN 250,000.00 PURCHASE ***PA4084F
11/1/2013 A AMIN 200,000.00 PURCHASE A*********
15/1/2013 MOHAN 200,000.00 PURCHASE ACB*******
11/1/2013 RAHUL 100,000.00 PURCHASE ***PD9407B
10/1/2013 BHAT 15,000.00 PURCHASE AXQ*******
14/1/2013 SHIRISH 2,500,000.00 PURCHASE AAGPR9****
14/1/2013 CHATURBHUJ120,000.00 PURCHASE ***PD0807F
11/1/2013 KUMAR 95,000.00 PURCHASE ABTPG3****
11/1/2013 G. KUMAR 110,000.00 SWITCH ADTPM5692E
14/1/2013 SHASHI 175,000.00 SWITCH ADC********
;
RUN;
please help...
Hi Allu,
For your 2nd Question
proc sql;
create table test as
select *,sum(corpus) as total, (corpus/calculated total)*100 as perc
from have1
having calculated perc>20;
quit;
Hi ,
data have1;
informat trdate ddmmyy10.;
format trdate ddmmyy10.;
input trdate invname $10. corpus trtype $10. PANNO $10.;
datalines;
14/1/2013 FAISAL 20000 SWITCH AJYPA*****
14/1/2013 RAMESH 1000000 PURCHASE ALOPP*****
11/1/2013 AMIN 250000 PURCHASE ***PA4084F
11/1/2013 A AMIN 200000 PURCHASE A*********
15/1/2013 MOHAN 200000 PURCHASE ACB*******
11/1/2013 RAHUL 100000 PURCHASE ***PD9407B
10/1/2013 BHAT 15000 PURCHASE AXQ*******
14/1/2013 SHIRISH 2500000 PURCHASE AAGPR9****
14/1/2013 CHATURBHUJ 120000 PURCHASE ***PD0807F
11/1/2013 KUMAR 95000 PURCHASE ABTPG3****
11/1/2013 G. KUMAR 110000 SWITCH ADTPM5692E
14/1/2013 SHASHI 175000 SWITCH ADC********
;
RUN;
1) For your 1st Question
Data test;
set have1;
flag=ifc(NOTALPHA(substr(PANNO,1,5)),'N','Y');
if flag eq 'Y';
run;
2) Can you elobrate your 2nd question more than 20% of available corpus?
hi sam,
thanks for your reply..
the second condition....we need the customer of highest amount to the total corpus ....
i.e
invname corpus %of total
faisal 20000
ramesh 1,000,000
AMIN 250,000
.
.
.
like this i need % of each individual to the total corpus. ............and who has gone beyond 20%
regards
ALLU
Hi Allu,
For your 2nd Question
proc sql;
create table test as
select *,sum(corpus) as total, (corpus/calculated total)*100 as perc
from have1
having calculated perc>20;
quit;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.