I want to output obs rtf text=’xxx’, where the output content is judged based on the values of certain columns of the data set. I tried using IF-THEN statement but it didn't work well. Hope to get your help, thank you
Didn't work is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the "</>" to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "</>" icon or attached as text to show exactly what you have and that we can test code against.
Since you are mentioning "obs (??? ods perhaps) rtf text" it sounds like you may also need to include how you are using ODS RTF destination.
Actual conditions and actual desired result when the condition is true (or false) is a good idea. "Certain columns" is not very descriptive in SAS as SAS uses VARIABLES to identify values, not columns. The order of values (columns) can change with data manipulation but the Variables still have the same values.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for 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.