I want to every second string in upcase
Do you mean every second word in a string or every second observation?
second observation by using data sets
data want;
set have;
retain flag 0; drop flag;
array varx $ _character_;
if flag=0 then do;
output;
flag=1;
end;
else
do i=1 to dim(varx);
varx(i) = upcase(varx(i));
output;
flag=0;
end;
run;
data have;
input string $20.;
datalines;
here
are
some
strings
;
data want;
set have;
if mod(_N_, 2)=0 then string=upcase(string);
run;
Please edit the title and add something meaningful. The word "sas" does not tell anybody anything about the issue you need to be solved.
You should although add data in usable format (data step with datalines) and explain. based on the input you show, what do expect as result.
@andreas_lds wrote:Please edit the title and add something meaningful. The word "sas" does not tell anybody anything about the issue you need to be solved.
You should although add data in usable format (data step with datalines) and explain. based on the input you show, what do expect as result.
He also has the right to say "Hello" don't you think ? haha
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.