data one; length string $30.; input string $; cards; ab bc cd ef gh ij kl mn op qr st uv ; run; data two; set one; cnt_string=countw(string," "); run; proc print data=two; run; output: Obs string cnt_string 1 ab . log; no erros
Hi Sir, I have this dataset below. data Test; length Marks $15.; input Name $ Roll_Number Marks $; cards; Name1 101 70,80,90 Name2 102 80,90,90,80 Name3 102 90,80,90,80,90 ; run; The marks column have values in comma separated way like 70,80,90 i.e math, eng, Hindi right but observation 2 for marks have 4 values comma separated 80,90,90,80 i.e math, eng, Hindi, some other subject so basically what is want to do is I want to get each comma separated value in their respective column the catch is that we don't know how many values will be there in the Marks column it is dynamic it could be 3 or 4 or 5 I wan to use loop & scan or substr but I'm confused if you could please make a video or give an explanation on this
Please tell me gow to solve this . I have column id and columns more than 200 (numeric) like jan p_jan_2007,p_feb_2007,.....p_jun_2023 Q1) sum row wise Q2) drop the columns having zeros by id wise Ex below: Q1) Id p_jan2007 ..p_jun_2023 total Mx1 24 ... 112.5 136.5
Brilliant solution!
Thank you for sharing this explanation!!!
Very useful video and nicely explained
Every step so clearly explained, thanks sir
Awesome video. thank you
you saved me a ton of work! thank you!
Nice
I want joins interview scenario based questions and imp topics
countw is not working for me ,the same code when i tried to do practice.Your tutorials are much helpful.
Can you paste the code. So that I can check
data one;
length string $30.;
input string $;
cards;
ab bc cd ef gh ij kl mn op qr st uv
;
run;
data two;
set one;
cnt_string=countw(string," ");
run;
proc print data=two;
run;
output:
Obs string cnt_string
1 ab .
log;
no erros
you are reading only ab in dataset one. change your input statement to input string & $ ;
Yes sir,After changing also it's not working.I think it May be because of I'm using version 9.
@@kiranvenna what does '&' represent in input statement?
Hi,
You are doing great work!
Could you make a video for overlapping dates concept.
It would be of great help!!
Thank you Can you get me an example or sample data of what you are asking
Can you make a video on Hash object and Array in SAS
I would like to make videos on SAS hash object sometime in future.
how to extract the value of the maximum count sir ??
Please provide simple input and output, i can help you
Hi Sir,
I have this dataset below.
data Test;
length Marks $15.;
input Name $ Roll_Number Marks $;
cards;
Name1 101 70,80,90
Name2 102 80,90,90,80
Name3 102 90,80,90,80,90
;
run;
The marks column have values in comma separated way like 70,80,90 i.e math, eng, Hindi right
but observation 2 for marks have 4 values comma separated 80,90,90,80 i.e math, eng, Hindi, some other subject
so basically what is want to do is I want to get each comma separated value in their respective column
the catch is that we don't know how many values will be there in the Marks column it is dynamic it could be 3 or 4 or 5
I wan to use loop & scan or substr but I'm confused
if you could please make a video or give an explanation on this
I thought this video does that
Please tell me gow to solve this .
I have column id and columns more than 200 (numeric)
like jan p_jan_2007,p_feb_2007,.....p_jun_2023
Q1) sum row wise
Q2) drop the columns having zeros by id wise
Ex below:
Q1)
Id p_jan2007 ..p_jun_2023 total
Mx1 24 ... 112.5 136.5
Made a video on the first point, I did not clearly understand question2. ua-cam.com/video/Ou7cuCe9gbE/v-deo.html
hello how to split one column into many
unfortunately, I am unable to understand, can you give an example
Proc SQL step not working
This won't work in Proc SQL.