data lemon; input food $ fooder $; datalines; apple applepie run; data test output=test1; set lemon; y=index(fooder,"pie"); run; proc print data=test1; run;
how can I also have y in my output table test1?
The correct syntax for this is:
data test test1;
set lemon;
y=index(fooder,"pie");
run;
Test and Test1 will be identical and both contain y.
if index(segment, "QHKG") then total = total _bad_count
originally I thought this statement is about if we can look for QHKG in segment, however if it exist QHKG will be a positive interger indicating its position, if not found, I will get a zero, so how does this statement work? when does total=total_bad_count? when it is not zero?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.