BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
allurai0412
Fluorite | Level 6

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...

1 ACCEPTED SOLUTION

Accepted Solutions
sam369
Obsidian | Level 7

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;

View solution in original post

3 REPLIES 3
sam369
Obsidian | Level 7

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?

allurai0412
Fluorite | Level 6

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

sam369
Obsidian | Level 7

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;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 745 views
  • 5 likes
  • 2 in conversation