BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LisaSAS
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
thorneton
Fluorite | Level 6

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

View solution in original post

1 REPLY 1
thorneton
Fluorite | Level 6

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2023 views
  • 0 likes
  • 2 in conversation