<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Creating Table with Prompt in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430350#M27753</link>
    <description>&lt;P&gt;I created an empty programm in SAS EG, associated a prompt with a Datasourceelement (there are some tables where i need just some columns from, that selection can change so i need it that way).&lt;/P&gt;&lt;P&gt;When i start the programm the prompt gets displayed and i can select the columns from the different tables and proceed(but nothing happens except i get the log), but how i can create a table with the selected columns and data?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I checked some macro_variables... i get:&amp;nbsp; %LET Prompt_count=Number of selected columns, the name of the columns %LET Prompt = xyz, Prompt1 = zxy, some %SYMDEL and so on...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thxs and i´m new in SAS&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 11:11:31 GMT</pubDate>
    <dc:creator>VIU</dc:creator>
    <dc:date>2018-01-24T11:11:31Z</dc:date>
    <item>
      <title>Creating Table with Prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430350#M27753</link>
      <description>&lt;P&gt;I created an empty programm in SAS EG, associated a prompt with a Datasourceelement (there are some tables where i need just some columns from, that selection can change so i need it that way).&lt;/P&gt;&lt;P&gt;When i start the programm the prompt gets displayed and i can select the columns from the different tables and proceed(but nothing happens except i get the log), but how i can create a table with the selected columns and data?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I checked some macro_variables... i get:&amp;nbsp; %LET Prompt_count=Number of selected columns, the name of the columns %LET Prompt = xyz, Prompt1 = zxy, some %SYMDEL and so on...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thxs and i´m new in SAS&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 11:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430350#M27753</guid>
      <dc:creator>VIU</dc:creator>
      <dc:date>2018-01-24T11:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Table with Prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430407#M27770</link>
      <description>&lt;P&gt;I'd say this is quite a complex task to solve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to create a program and add all tables in some kind of a join and then select column to use depending on your prompt selections.&lt;/P&gt;
&lt;P&gt;To get all columns you need to loop through all prompt values with a macro loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't see how to solve this in an easy way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also want the data from the tables...so...the following example (dummy) code might give you some input:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Create a keep statement that have all columns from the prompts:&lt;/P&gt;
&lt;P&gt;%macro create_keep;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %let keep_stmt = ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %do i = 1 %to &amp;amp;prompt_count;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; %let keep_stmt =&amp;nbsp; &amp;amp;keep_stmt &amp;amp;prompt_value&amp;amp;i;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;%create_keep;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Create a sql statement or data step to select data and chose columns;&lt;/P&gt;
&lt;P&gt;data one(keep=&amp;amp;keep_stmt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;merge table1 table2 table3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;by key;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why use prompts instead of standard transformations and queries?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 13:22:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430407#M27770</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-01-24T13:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Table with Prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430443#M27775</link>
      <description>&lt;P&gt;Hi FredrikE &amp;amp; thxs,&lt;/P&gt;&lt;P&gt;i want to build a pre-defined table with some attributes which i get from some tables and add others if i need them..i thought thats the easiest way through prompts, but it doesnt seem so...is there an other way except putting all tables to EG and standard querying it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430443#M27775</guid>
      <dc:creator>VIU</dc:creator>
      <dc:date>2018-01-24T14:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Table with Prompt</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430459#M27779</link>
      <description>&lt;P&gt;I would create a EG project that creates your predefined table by using the query task and then modify the query depending on which columns you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can easily copy/paste the query if you want multiple tables with different columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think it is possible to achieve what you want by coding, but I wonder if it is worth the time/money to do that instead of using the standard tasks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 14:46:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-Table-with-Prompt/m-p/430459#M27779</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-01-24T14:46:53Z</dc:date>
    </item>
  </channel>
</rss>

