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.
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!
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.