07-02-2021
souji
Obsidian | Level 7
Member since
11-26-2019
- 43 Posts
- 6 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by souji
Subject Views Posted 2229 07-17-2020 02:31 PM 2329 07-15-2020 05:50 PM 2422 07-15-2020 02:30 PM 2453 07-15-2020 01:17 PM 2491 07-15-2020 01:05 PM 999 01-11-2020 03:06 PM 1023 01-11-2020 02:33 PM 1369 01-11-2020 02:28 PM 1622 01-11-2020 01:00 PM 1408 01-11-2020 12:52 PM -
Activity Feed for souji
- Posted Re: Split single column to mutiple coulums on SAS Programming. 07-17-2020 02:31 PM
- Posted Re: Split single column to mutiple coulums on SAS Programming. 07-15-2020 05:50 PM
- Liked Re: Split single column to mutiple coulums for PaigeMiller. 07-15-2020 05:49 PM
- Liked Re: Split single column to mutiple coulums for Jagadishkatam. 07-15-2020 03:49 PM
- Liked Re: Split single column to mutiple coulums for PaigeMiller. 07-15-2020 02:31 PM
- Posted Re: Split single column to mutiple coulums on SAS Programming. 07-15-2020 02:30 PM
- Posted Re: Split single column to mutiple coulums on SAS Programming. 07-15-2020 01:17 PM
- Posted Split single column to mutiple coulums on SAS Programming. 07-15-2020 01:05 PM
- Got a Like for Re: How do I separate the values into two new variables. 01-20-2020 06:30 AM
- Posted Re: Proc means on SAS Programming. 01-11-2020 03:06 PM
- Posted Proc means on SAS Programming. 01-11-2020 02:33 PM
- Posted Re: Sum on SAS Programming. 01-11-2020 02:28 PM
- Posted Re: Merge on SAS Programming. 01-11-2020 01:00 PM
- Liked Re: Merge for ed_sas_member. 01-11-2020 12:58 PM
- Posted Sum on SAS Programming. 01-11-2020 12:52 PM
- Posted Merge on SAS Programming. 01-11-2020 12:15 PM
- Posted Re: IF-THEN on SAS Programming. 01-11-2020 11:24 AM
- Posted Re: IF-THEN on SAS Programming. 01-11-2020 11:20 AM
- Posted IF-THEN on SAS Programming. 01-11-2020 09:52 AM
- Posted Re: format on SAS Programming. 01-11-2020 09:27 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 1 1 -
My Liked Posts
Subject Likes Posted 1 01-10-2020 10:42 PM
07-17-2020
02:31 PM
Hi Miller,
Can you please make me understand below, why you add pos+1 for zip variable(+1) and pos-1 for state (-1),pos-2 for city(-2)
pos=anyalpha(city1,-200);
zip=substr(city1,pos+1);
state=substr(city1,pos-1,2); city=substr(city1,1,pos-2);
Thank you very much
... View more
07-15-2020
02:30 PM
Thank You Jagadish, Can you please explain or please refer any document that explain in detail
it was worked and trying to learn
soujanya
... View more
07-15-2020
01:17 PM
Thanks for quick response ,
State always has a 2 digit state and in the United States only
zip code has 9 digits with hyphen ( Ex: BRONX NY 10467-6021 , BATTLE MOUNTAIN NV 89820-1998)
And some rows has 5 digit zip code only ( Ex: LAS VEGAS NV 89119), no hyphen and pin code
... View more
07-15-2020
01:05 PM
Hi,
Can you please help me to split single column to multiple column, here below city1 has full address with city,state and zip code. I need to split it city1 column into city , state, Zip1, zip2 columns
city1
BRONX NY 10467-6021
LAS VEGAS NV 89119
BATTLE MOUNTAIN NV 89820-1998
NORTH LAS VEGAS NV 89031-3432
Thanks
Soujanya
... View more
01-11-2020
02:33 PM
Please correct me if I wrong coded in the below:
/*Scenario:
1. Subset the data into two data sets, work.young and work.mid based on Age variable.
2. work.young should contain observations with Age less than 40 years old.
3. work.mid should contain observations with Age between 40 and 65 years old, inclusively.
4. How many observations are in the mid data set?
5. What is the CustomerId for observation 14 in the young data set?
6. What is the average Age of the customer in the young data set? */
data work.young work.mid;
set Souj.Input41;
if Age<40 then output work.young;
else if 40<= Age <=65 then output work.mid;
run;
proc means data=work.young;/*I think,#6*/
var Age;
run;
... View more
01-11-2020
02:28 PM
Thank you very much for both of you @Cynthia_sas @ed_sas_member
for correcting me ... I am still learning
... View more
01-11-2020
01:00 PM
Hi @ed_sas_member
Thank you for your quick response, I appreciate you
What about : 5. what is the grand total totalprice for the product='screwdriver'?
please help me this too
Souji
... View more
01-11-2020
12:52 PM
Please correct me if I am wrong:
/*Scenario:
1. Create a variable, Bonus, that is 5% of Income. If the Bonus is over $7000, create the variable Total that sums Bonus and Income
2. Only output observations with Bonus greater than $7000 to the New dataset, BonusOver7K,
there should be no missing value for the Bonus variable in the data set.
3.what is the value of the variable Total for observation 114?
4. what is the grand total of the variable Total for the entire data set?*/
data work.BonusOver7K;
set Souj.input24;
Bonus=Income*0.5;
where Bonus ne .;
if Bonus>7000 then Total=sum(Bouns,Income);/* I think,#1*/
if Bonus>7000 then output BonusOver7K;/* I think, #2*/
run;
Proc print data=BonusOver7K;
sum Total; /* I think, #4 */
run;
... View more
01-11-2020
12:15 PM
Hi,
Another one, Please correct me, if I am wrong
#5- do not know how to get it
/*Scenario:
1.Souj.input24a contains 2 variables, Product and Qty for 20 transactions
2.Souj.input24b contains 2 variables, Product and Price for 20 transactions
3.Create output dataset results.output24
4.Merge data sets Souj.input24a and Souj.input24b one-to-one in order to calculate a new variable
totalprice(=Qtr*Price) for each observation
5. what is the grand total totalprice for the product='screwdriver'?
6.what is the average(mean) totalprice for product='Tape'? */
proc sort data=Souj.input24a out=out.input24a;
by product;
run;
proc sort data=Souj.input24b out=out.input24b;
by product;
run;
data results.output24;
merge out.input24a out.input24b;
by product;
totalPrice=gty*price;
run;
proc means data=results.output24;
by product;
where product='Tape';/* I think #6)
run;
... View more
01-11-2020
11:24 AM
actually, typo error, it was 39
Young15: People who are age 39 and younger
still I am correct right?
if age<=39 then output Young15;
... View more
01-11-2020
11:20 AM
Thank You very much for both of you @ed_sas_member and @PaigeMiller
... View more
01-11-2020
09:52 AM
Hi,
I am still learning, please let me know my code is correct for below scenario / correct me if I am wrong:
1. Create three data sets:
Young15:people who are age 30 and younger.
Mid15: people between the age of 40 and 60 , inclusive.
NotasYoung15: people who are age 61 and older
2.Remove the variables Test3, Test4,Test5 from the Young15 dataset
3.Create New variable avgTest that is the average of the reaming Test variables for Young15 dataset
4. what is the average (mean) of the Test5 variable in the NotasYoung15 data set
My code is:
data Young15 (drop=Test3 Test4 Test5) Mid15 NotsaYoung15;
set SOUJ.input15;
if age<=39 then output Young15;
else if 40<=age<=60 then output Mid15;
else if age>=61 then output NotasYoung15;
run;
data work.Young15;
set work.Young15;
avgInc=mean(of Test: ); /*3*/
run;
data work.NotsaYoung15;
set work.NotsaYoung15;
avgInc2=mean(of Test5); /* 4*/
run;
... View more