I read variable=contain(1)......
IS it posibble to write theassignement above?
If you read this as part of a SAS program, it means a DATA step contains an array named CONTAIN. That statement would assign (as the value of VARIABLE) the first element in the array.
Hi,
Could you be a little bit more verbose in the description of the problem, perhaps posting example test data (form of a datastep) and what the output should look like. I am going to guess that 1 is a character, and you want to search in a string of characters to see if that character exists and if so assign a boolean response to variable 1 being found, 0 not being found:
data have;
input a $;
b=ifn(findc(a,"1") > 0,1,0);
datalines;
045674
341232
run;
If you read this as part of a SAS program, it means a DATA step contains an array named CONTAIN. That statement would assign (as the value of VARIABLE) the first element in the array.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.