Is it possible to use a first.variable statement and an infile? I am tryin to sum up the album cost for each genre without using two data steps, currently the log says genre is unintialized. Please help.
First. and last. are only available with a by statement. Variables in the by statement must be in the input dataset.
So the answer to your question is no.
Read the raw data into a dataset, then you can use by processing.
To use a first.Variable statement you have to have a by statement in your code?
First. and last. are only available with a by statement. Variables in the by statement must be in the input dataset.
So the answer to your question is no.
Read the raw data into a dataset, then you can use by processing.
Depending on what you actually want for your final output one of the report procedures such as Proc Report or Tabulate might be more in line. These both support creating group totals based and often do not require a separate sort step.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.