Data Have;
String="meiraca";
run;
Through this data set can i get output string name as "america" ???
Please give a solution for this !!!!!!!
Not sure what a "10th table in SAS is" but to "throw" something at you:
data sample;
do i=1 to 10;
var=10*i;
string=cats('10*',i,'=',var);
output;
end;
stop;
run;
proc print data=sample;
run;
@Mohan_Reddy Hi and welcome to the SAS Community 🙂
What is the logic here? The string is not sorted in alphabetical order.. That would give "aaceimr".
Yes Correct what you say sorting...But in my way sort means to get string name America....if you have any answer please provide here..
What if you have the string "meiracam" (one extra 'm')? You can spell 'america' with some of the letters, but it leaves an 'm'..
And what if the letters can not be rearranged into 'america'. Should the string be left untouched, or?
No problem you should remove that extra M and through that remaining string please get that America output.....
And what if the letters can not be rearranged into 'america'. Should the string be left untouched, or?
Ok No problem...you should consider left untouched also...if any chances to get sort string to "america" please give a solution...
This is a strange requirement. To solve it, you need to count the letters required to create the word you want, in your example something like
countc(source, 'a') >= 2 and countc(source, 'm') >= 1 and countc(source, 'e') >= 1 ...
If all conditions are true, simply set source = 'america'.
I have dataset like below...
data ds;
do i=1 to 1000;
output;
end;
stop;
run;
Now i want output like
Using that dataset "i" value create 3 new columns(variables).....One Variable should contain Odd numbers and
One variable should contain Even numbers..
Last variable should contain Prime numbers...
Please write a programme for this .......
Close but not working. I could rearrange
String="maeirac";
But not the actual string that you posted.
Number the consonants sequentially.
Number the vowels sequentially.
In order, take a vowel, a consonant, a vowel, a consonant, etc.
Thank You for your information...If you don't mind please write a full programme for solve this question if you have answer...!!!
data ds;
string="maeirac";
run;
If you have answer for this question please write a full programme ...!!!
@Mohan_Reddy wrote:
How To Create Table in SAS ???
Like 10*1=10
10*2=20
..
10*10=100
like this i want output..please give a programme for this!!!
It's not clear to me how your last post relates to anything you were talking about before.
As for your initial requirement: That's a really very strange one. I could now spend time and write code for exactly the america use case but it wouldn't work for anything else/any other word.
It would really help if you could explain in more detail what you have and what you need. And then also provide sample data in form of a SAS data step and show us the expected result.
I'm trying to help you here - and also not waste my time on the wrong solution. And that's also why other people are asking all these questions and are not just throwing some "random" code at you. Sooo... you need to help us a bit more to help you.
I Really thankyou for your work..Please leave that america question if you have no answer i think that question will wrong.....please help in this my last question...
How to create 10th table in SAS???
i want output like 10*1=10
10*2=20
10*3=30
10*10=100
like this please write a programme !!!!!
Not sure what a "10th table in SAS is" but to "throw" something at you:
data sample;
do i=1 to 10;
var=10*i;
string=cats('10*',i,'=',var);
output;
end;
stop;
run;
proc print data=sample;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.