What is the following section accomplishing? */ productSales = INPUT(TRIM(sales), COMMA20.); SELECT (product); WHEN (1) productName='Breakfast bar'; WHEN (2) productName='Cookie bar'; WHEN (3) productName='Savory meal bar'; OTHERWISE productName=.; END; RUN;
What is the following section accomplishing?
First, it converts a numerical value stored in a character variable into a numeric variable. Next, it creates a long-text character variable from codes in a numeric variable. The "otherwise" branch causes a NOTE concerning a numeric-to-character conversion, because of sloppy coding. The second action is better done with a custom format.
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.