I'm trying to name my labels in a table that I created what was entered as a prompt. I'm prompting for a date range (FromDate ToDate). Then within my code I'm using these variables to grab the information. When I create my table I want to use the FromDate and ToDate to label the fields.
Prompt field: FromDate as a value of 2014
Prompt field: ToDate as a value of 2015
PROC SQL;
CREATE TABLE MyTable AS
Select field1 as field1_2014, field2 as field2_2014, field3 as field3_2014
, field3 as field4_2015, field5 as field5_2015, field6 as field6_2015
Is this possible?
The macro variable names assigned to the date prompt or the the date range prompt will be listed in the log. Field1 is read via the from statement, field1 can assigned a new name with a date suffix. Field1 as field1_&FromDate. The contents of the macro variable &FromDate will be appended to the string field1 --- creating the field name "field1_ 2014 (from your example). Hope this is the question you were asking😉 Date prompt string is 9 characters, ddmmmyyyy -- 05MAY2016
The macro variable names assigned to the date prompt or the the date range prompt will be listed in the log. Field1 is read via the from statement, field1 can assigned a new name with a date suffix. Field1 as field1_&FromDate. The contents of the macro variable &FromDate will be appended to the string field1 --- creating the field name "field1_ 2014 (from your example). Hope this is the question you were asking😉 Date prompt string is 9 characters, ddmmmyyyy -- 05MAY2016
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.